I recently updated to 2.3 of pybind11-stubgen, but I've encountered a crash while running on the same code. I decided to go to the bottom of it and found the following.
I have a python module importing some pybind11 module sharing the same name as it's parent, thus the module's name is my_module.my_module. When parsed, the method FixCurrentModulePrefixInTypeNames._strip_current_module in fix.py will, as it's name says, remove the name my_module from my_module.my_module origin, which is my_module. At this point, the stripped origin becomes an empty string, then _get_parent_module returns None on this invalid module name, and finally report_error will fail to report the error, trying to print error.name[0] on an empty string error.name.
Removing the striping methods seems to work, but I guess it was there to address another kind of input.
What would be your opinion on this? What are the constrains while trying to fix fix.py?
Hi!
I recently updated to 2.3 of pybind11-stubgen, but I've encountered a crash while running on the same code. I decided to go to the bottom of it and found the following.
I have a python module importing some pybind11 module sharing the same name as it's parent, thus the module's name is
my_module.my_module
. When parsed, the methodFixCurrentModulePrefixInTypeNames._strip_current_module
in fix.py will, as it's name says, remove the namemy_module
frommy_module.my_module
origin, which ismy_module
. At this point, the stripped origin becomes an empty string, then_get_parent_module
returns None on this invalid module name, and finally report_error will fail to report the error, trying to printerror.name[0]
on an empty stringerror.name
.Removing the striping methods seems to work, but I guess it was there to address another kind of input.
What would be your opinion on this? What are the constrains while trying to fix fix.py?