New submission from Eric Cousineau <>:

We ran into an issue with our library; we build a submodule named ``, 
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):

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:
(attached this as ``)

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

This behavior seems to violate the documentation:

components: macOS
messages: 312183
nosy: Eric Cousineau, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Mac: Local modules can shadow builtins (e.g. a local `` can 
shadow `math`)
type: behavior
versions: Python 2.7
Added file:

Python tracker <>
Python-bugs-list mailing list

Reply via email to