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(symlink to DOS devices path that starts with '\\?\Some without ":"\') returns without prefix. #102440
Comments
I don't see how A symbolic link reparse point contains a substitute path that the system uses, plus an optional print path for display1. What you see in the shell is the print path, but What is the result of
It's a known issue (#89760) that Footnotes |
I read a code of ntpath._getfinalpathname_nonstrict(), perhaps the bug is caused by os.readlink behaviors. The code of ntpath.realpath() processes L702-L706(Python3.11.0 amd64) because _getfinalpathname() causes FileNotFoundError (The specified path is symlink to DOS devices path that starts with '\?\Some without ":"'). except OSError as ex:
if strict:
raise
initial_winerror = ex.winerror
path = _getfinalpathname_nonstrict(path) That calls _getfinalpathname_nonstrict() and _getfinalpathname_nonstrict() calls os.readlink().
I know and read #89760 but the bug is remained even if patch #89760 (comment). |
This appears to be a shortcoming in If the reparse point is a symlink with If the reparse point is a mountpoint or if it's a symlink without Assuming the target of "media" really exists, then the following os.stat(r'\\?\GLOBALROOT\ContainerMappedDirectories\93AA221C-4061-460F-8C4E-A2EAC1BF3324') |
os.path.realpath(symblic link to DOS Device Paths)
returns a path without\\?\
prefix even if patch that fix.For example, there is below symlinks on C:\test.
Then exexute python and call os.path.realpath and call some functions to inspect.
As the log indicates, os.path.realpath returns without a prefix.
I think it is wrong that _getfinalpathname_nonstrict removes DOS devices paths prefix.
So to fix the problem, I think we need to fix _getfinalpathname function on "Modules/posixmodule.c".
Please some opinions.
The text was updated successfully, but these errors were encountered: