[issue22172] Local files shadow system modules, even from system modules

Nick Coghlan report at bugs.python.org
Fri Aug 8 13:48:58 CEST 2014


Nick Coghlan added the comment:

This is not new behaviour. It's just normal system shadowing:

$ python test.py 
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    import collections
  File "/usr/lib64/python2.7/collections.py", line 9, in <module>
    from operator import itemgetter as _itemgetter, eq as _eq
ImportError: cannot import name itemgetter

Avoiding that behaviour is what the new isolated mode is for:

$ ~/devel/py34/python -I test.py 
$

----------
nosy: +ncoghlan
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22172>
_______________________________________


More information about the Python-bugs-list mailing list