This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Eric Cousineau
Recipients Eric Cousineau, ned.deily, ronaldoussoren
Date 2018-02-14.23:11:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1518649906.98.0.467229070634.issue32845@psf.upfronthosting.co.za>
In-reply-to
Content
We ran into an issue with our library; we build a submodule named `math.so`, and have a test `math_test` which is ran in the same directory as this module (since this is how we've written it with Bazel's generated Python binaries):
https://github.com/RobotLocomotion/drake/issues/8041

This happens for us on HighSierra / Sierra MacOS (for *.py and *.so modules); Ubuntu Linux seems fine.

I have a reproduction script just for *.py files here:
https://github.com/EricCousineau-TRI/repro/blob/b08bc47/bug/mac_builtin_shadow/test.sh#L38
(attached this as `test.sh`)

The module is exposed on the path given that it neighbors the first execution of the `import_test.py` script. The second execution (where the `import_test.py` script is moved up one level) succeeds on Mac (s.t. the `math.py` is not in `sys.path`).

This behavior seems to violate the documentation:
https://docs.python.org/2/tutorial/modules.html#the-module-search-path
History
Date User Action Args
2018-02-14 23:11:47Eric Cousineausetrecipients: + Eric Cousineau, ronaldoussoren, ned.deily
2018-02-14 23:11:46Eric Cousineausetmessageid: <1518649906.98.0.467229070634.issue32845@psf.upfronthosting.co.za>
2018-02-14 23:11:46Eric Cousineaulinkissue32845 messages
2018-02-14 23:11:46Eric Cousineaucreate