-
-
Notifications
You must be signed in to change notification settings - Fork 29.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
Inconsistent behavior between os.scandir and os.path for mfsymlinks #102503
Comments
@serhiy-storchaka (as an os.path module expert) |
The "mfsymlinks" option of the Linux "cifs" filesystem emulates native POSIX symlinks on an SMB share. When I compiled a "listdir" program that calls
As you can see, the links are misreported as type >>> open('dirlink', 'rb').read(47)
b'XSym\n0003\n736007832d2167baaae763fd3a3f3cf1\ndir\n'
>>> open('filelink', 'rb').read(48)
b'XSym\n0004\n8c7dd922ad47494fc02c388e12c00eac\nfile\n' The developers forgot to maintain the pretense for
|
Thank you for the investigation @eryksun. I've sent an email to linux-cifs@vger.kernel.org to follow up on this issue. |
We just ran into this as well. Looks like the thread on the mailing list died. Though, even if it did get patched it would take a long time to trickle into distributions. |
Bug report
With a network drive mounted with CIFS and using the mfsymlinks options, os.path.islink and os.path.isdir will return True for a symbolic link to a directory, whereas the corresponding DirEntry for the symlink will return False for both DirEntry.is_symlink() and DirEntry.is_dir().
Repro steps:
Your environment
Python version 3.8.10, Ubuntu 20.04
The text was updated successfully, but these errors were encountered: