genmsg
genmsg copied to clipboard
Generation of python cache objects leaks host path on target
Hi!
When using genmsg / genpy to generate messages, the path of the host is leaked into the python cache modules. For example, in the official deployed ubunut packages, it is: for /opt/ros/noetic/lib/python3/dist-packages/std_msgs/__pycache__/__init__.cpython-38.pyc:
/tmp/binarydeb/ros-noetic-std-msgs-0.5.13/obj-x86_64-linux-gnu/devel/lib/python3/dist-packages/std_msgs/__init__.py
but it should be
/opt/ros/noetic/lib/python3/dist-packages/std_msgs/__init__.py
This is unwanted behavior. From the Docs, this path is used for
This [path] will appear in compilation time tracebacks, and is also compiled in to the byte-code file, where it will be used in tracebacks and other messages in cases where the source file does not exist at the time the byte-code file is executed.
Hence, the impact is very low, but still, it is an error