New submission from Christoph Gohlke <cgoh...@uci.edu>:
Re https://bugs.python.org/issue9949: Is it intended that Python-3.8.0b4 now also resolves mapped network drives and drives created with `subst`? I would not expect this from the documentation at https://docs.python.org/3.8/library/os.path.html#os.path.realpath. The documentation refers to symbolic links and junctions, which are different from mapped network and subst drives (AFAIU). For example, mapping `\\SERVER\Programs` as `X:` drive: ``` Python 3.8.0b4 (tags/v3.8.0b4:d93605d, Aug 29 2019, 23:21:28) [MSC v.1916 64 bit (AMD64)] on win32 >>> import sys, os >>> sys.executable 'X:\\Python38\\python.exe' >>> os.path.realpath(sys.executable) '\\\\SERVER\\Programs\\Python38\\python.exe' ``` ``` Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32 >>> import sys, os >>> sys.executable 'X:\\Python37\\python.exe' >>> os.path.realpath(sys.executable) 'X:\\Python37\\python.exe' ``` It seems this change causes an error in pytest-5.1.2 during numpy-1.17.1 tests: ``` X:\Python38>python.exe -c"import numpy;numpy.test()" NumPy version 1.17.1 NumPy relaxed strides checking option: True ============================================= ERRORS ============================================== __________________________________ ERROR collecting test session __________________________________ lib\site-packages\_pytest\config\__init__.py:440: in _importconftest return self._conftestpath2mod[conftestpath] E KeyError: local('\\\\SERVER\\programs\\python38\\lib\\site-packages\\numpy\\conftest.py') During handling of the above exception, another exception occurred: lib\site-packages\_pytest\config\__init__.py:446: in _importconftest mod = conftestpath.pyimport() lib\site-packages\py\_path\local.py:721: in pyimport raise self.ImportMismatchError(modname, modfile, self) E py._path.local.LocalPath.ImportMismatchError: ('numpy.conftest', 'X:\\Python38\\lib\\site-packages\\numpy\\conftest.py', local('\\\\SERVER\\programs\\python38\\lib\\site-packages\\numpy\\conftest.py')) During handling of the above exception, another exception occurred: lib\site-packages\_pytest\runner.py:220: in from_call result = func() lib\site-packages\_pytest\runner.py:247: in <lambda> call = CallInfo.from_call(lambda: list(collector.collect()), "collect") lib\site-packages\_pytest\main.py:485: in collect yield from self._collect(arg) lib\site-packages\_pytest\main.py:512: in _collect col = self._collectfile(pkginit, handle_dupes=False) lib\site-packages\_pytest\main.py:581: in _collectfile ihook = self.gethookproxy(path) lib\site-packages\_pytest\main.py:424: in gethookproxy my_conftestmodules = pm._getconftestmodules(fspath) lib\site-packages\_pytest\config\__init__.py:420: in _getconftestmodules mod = self._importconftest(conftestpath) lib\site-packages\_pytest\config\__init__.py:454: in _importconftest raise ConftestImportFailure(conftestpath, sys.exc_info()) E _pytest.config.ConftestImportFailure: (local('\\\\SERVER\\programs\\python38\\lib\\site-packages\\numpy\\conftest.py'), (<class 'py._path.local.LocalPath.ImportMismatchError'>, ImportMismatchError('numpy.conftest', 'X:\\Python38\\lib\\site-packages\\numpy\\conftest.py', local('\\\\SERVER\\programs\\python38\\lib\\site-packages\\numpy\\conftest.py')), <traceback object at 0x000000001B0F6B00>)) !!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1 error in 16.39s ``` ---------- components: Library (Lib), Windows messages: 350910 nosy: cgohlke, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: os.path.realpath on Windows resolves mapped network drives type: behavior versions: Python 3.8 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue37993> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com