-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os.path.realpath fails with WinError 161 #88980
Comments
Using os.path.realpath(...) in the MVFS of Clearcase SCM (virtual file system) in Windows 10 a exception occures: X:\my_view\tools\python\3_8>python.exe
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path.realpath('.')
Traceback (most recent call last):
File "X:\my_view\tools\python\3_8\lib\ntpath.py", line 647, in realpath
path = _getfinalpathname(path)
OSError: [WinError 87] Falscher Parameter: 'X:\\my_view\\tools\\python\\3_8\\.'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "X:\my_view\tools\python\3_8\lib\ntpath.py", line 651, in realpath
path = _getfinalpathname_nonstrict(path)
File "X:\my_view\tools\python\3_8\lib\ntpath.py", line 601, in _getfinalpathname_nonstrict
path = _getfinalpathname(path)
FileNotFoundError: [WinError 161] Der angegebene Pfadname ist ungültig: 'X:\\'
>>> The error 161 (ERROR_BAD_PATHNAME) should also be ignored in _getfinalpathname_nonstrict. |
It should also ignore ERROR_BAD_NETPATH (53). |
Updated with ERROR_BAD_NETPATH (53).
|
ERROR_NETWORK_ACCESS_DENIED (65) should probably be added to the ignore list. I don't know whether it occurs in practice, but we have it mapped to EACCES in PC/errmap.h. The common access error is ERROR_ACCESS_DENIED (5), even on a UNC share with restricted access. Add ERROR_DEV_NOT_EXIST (55) only if you have a case that fails with this error code. It's from the NT status code STATUS_DEVICE_DOES_NOT_EXIST. This might occur when trying to automount a device that's pending removal (see the implementation in ReactOS IopMountVolume [1]), but I can't create this condition. I think a device object would need to be practically stuck in the pending removal state for this to be a practical problem. ERROR_LOCK_VIOLATION (33) isn't relevant. It's an I/O access error for a locked range of a file. realpath() doesn't read or write file data. For the others, I'd wait for an issue to be reported. --- [1] https://github.com/reactos/reactos/blob/master/ntoskrnl/io/iomgr/volume.c#L457 |
Done. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: