This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cgohlke
Recipients cgohlke, paul.moore, steve.dower, tim.golden, zach.ware
Date 2019-08-31.08:04:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1567238675.05.0.269696747191.issue37993@roundup.psfhosted.org>
In-reply-to
Content
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
```
History
Date User Action Args
2019-08-31 08:04:35cgohlkesetrecipients: + cgohlke, paul.moore, tim.golden, zach.ware, steve.dower
2019-08-31 08:04:35cgohlkesetmessageid: <1567238675.05.0.269696747191.issue37993@roundup.psfhosted.org>
2019-08-31 08:04:34cgohlkelinkissue37993 messages
2019-08-31 08:04:34cgohlkecreate