[New-bugs-announce] [issue37089] `import Lib.os` works on windows (but shouldn't)

Anthony Sottile report at bugs.python.org
Wed May 29 16:52:39 EDT 2019


New submission from Anthony Sottile <asottile at umich.edu>:

Additionally, virtualenvs have the root of their directory on `sys.path` -- this is unlike posix behaviour

For example:

$ python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD6
4)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import Lib.os
>>> Lib.os.__file__
'C:\\Python37\\Lib\\os.py'
>>> Lib.os.listdir('C:\\')
['$Recycle.Bin', 'BGinfo', 'Documents and Settings', 'pagefile.sys', 'PerfLogs',
 'Program Files', 'Program Files (x86)', 'ProgramData', 'Python27', 'Python37',
'Recovery', 'swapfile.sys', 'System Volume Information', 'Users', 'Windows']

----------
components: Library (Lib), Windows
messages: 343923
nosy: Anthony Sottile, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: `import Lib.os` works on windows (but shouldn't)
versions: Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37089>
_______________________________________


More information about the New-bugs-announce mailing list