Eryk Sun <eryk...@gmail.com> added the comment:

> I confirm that in a junction point

This path-parsing bug that strips a trailing slash occurs when a traversed 
directory is a reparse point, such as a mount-point (junction) or directory 
symbolic link. It may be limited to just the NTFS and ReFS file-system drivers, 
which is all I tested. Or it may be a bug in the I/O manager itself, which 
actually implements the name grafting for Microsoft's mount-point (0xA0000003) 
and symlink (0xA000000C) reparse tags.

I thought the suggested patch was ok because it followed the pattern of 
existing code that prevents opening directories on Unix. But I can see the 
distinction in that the latter is implementing behavior policy rather than 
working around a platform bug. Also, while _Py_open and _Py_fopen do allow 
opening a directory on a Linux box, in apparent violation of this policy, these 
are private, internal functions, and there's no use that I'm aware of in the 
CPython implementation for directory FDs or FILE streams opened this way.

----------
nosy: +eryksun

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34711>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to