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

2019-09-25 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2019-06-05 Thread Steve Dower
Steve Dower added the comment: There are certainly people relying on sys.prefix being in sys.path (for .pth files and embedding), but probably not so many that we couldn't remove it in a major release. It is a bit strange in a venv, where there's typically nothing in the root of the

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

2019-06-04 Thread Eryk Sun
Eryk Sun added the comment: sys.prefix is usually argv0_path, but in a virtual environment argv0_path is set from "home" in pyvenv.cfg in order to find the standard library, and, if the site module is imported, sys.prefix is set to the virtual environment directory. Since for Windows

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

2019-06-04 Thread Guido van Rossum
Guido van Rossum added the comment: I doubt it's meant as a feature. I don't recall anything about it. I suspect it's got to do with limitations of the Windows installer (at the time). Maybe there are other things that are siblings of "Lib" that must be importable, e.g. DLLs? I recommend

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

2019-05-31 Thread Terry J. Reedy
Terry J. Reedy added the comment: If .../Tools and its subdirectories had __init__.py files, the presence of sys.prefix on sys.path, on Windows, would allow imports from those subdirs. Otherwise, it only provides a second way to import stdlib modules. This seems like a bit of a bug.

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

2019-05-29 Thread Anthony Sottile
Anthony Sottile added the comment: If I'm reading this correctly this is the relevant line for python3: https://github.com/python/cpython/blob/29cb21ddb92413931e473eb799a02e2d8cdf4a45/PC/getpathp.c#L1068 it was added in 4d0d471a8031de90a2b1ce99c4ac4780e60b3bc9 python2 seems to do the same

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

2019-05-29 Thread Steve Dower
Steve Dower added the comment: Honestly, no idea. Because it always has been :) If you can find when it was added, we may be able to answer that. -- ___ Python tracker ___

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

2019-05-29 Thread Anthony Sottile
Anthony Sottile added the comment: sys.prefix isn't on sys.path on other platforms -- why is it on windows? -- ___ Python tracker ___

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

2019-05-29 Thread Steve Dower
Steve Dower added the comment: I don't think we can change the assumption that sys.prefix is in sys.path at this point, though technically it's not required (certainly not in 3.7). Maybe we could create a new marker file that means "never treat this directory as a namespace package"?

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

2019-05-29 Thread Anthony Sottile
New submission from Anthony Sottile : 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",