Improve Tf.Status
python binding
#3311
Labels
needs review
Issue needing input/review by the repo maintainer (Pixar)
Tf.Status
python binding
#3311
Description of Issue
Tf.Status
accepts a verbose argument in pythonOpenUSD/pxr/base/tf/__init__.py
Line 181 in 59992d2
This has no equivalent in C++, so the binding attempts to set a "null context" by passing empty strings for module, functio, and filename.
Those arguments are passed to
Tf_PythonCallContext
OpenUSD/pxr/base/tf/wrapStatus.cpp
Line 32 in 59992d2
which joins the module & function name without checking if they are empty
https://github.com/PixarAnimationStudios/OpenUSD/blob/release/pxr/base/tf/pyCallContext.cpp#L42
resulting in a
TfCallContext
with a function "." instead of the intended "" (or ideally None/nullptr).This is highly confusing on the c++ side (e.g. in a TfDiagnosticMgr Delegate implementation).
Hopefully this is a non-contentious fix to check for empty string before joining.
But I also wonder if it wouldn't be better to use TfCallContext::hide() instead so c++ callsites could check
diagnostic.GetContext().IsHidden()
rather thandiagnostic.GetSourceFunction().empty()
Steps to Reproduce
System Information (OS, Hardware)
Package Versions
Build Flags
The text was updated successfully, but these errors were encountered: