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.

Title: Fix os.stat handling of UNC roots
Type: Stage:
Components: Interpreter Core Versions: Python 2.3
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: loewis Nosy List: glchapman, loewis
Priority: high Keywords: patch

Created on 2004-05-14 17:57 by glchapman, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
posixmodule.c.diff glchapman, 2004-05-14 17:57
Messages (2)
msg45972 - (view) Author: Greg Chapman (glchapman) Date: 2004-05-14 17:57
This is a patch for the bug described at:

The patch adds two new routines to posixmodule.c: 
IsUNCRootA and IsUNCRootW which test if a supplied 
path matches the pattern for a UNC root directory.  
These routines are called by posix_do_stat in two 
different places: 1) when testing if a path with a 
trailing slash is a drive root and 2) to see if a path 
without a trailing slash is a UNC root.

The first of these is the real bug fix; it allows UNC roots 
to be specified as "//server/share/" rather 
than "//server/share//".

The second was added because it is easy to forget to 
add the trailing slash to "//server/share", but stats of 
UNC roots without the trailing slash will fail.  However, I 
think this is an optional addition.

I'm not sure what to do about tests, since existing 
shares will obviously vary from system to system, and 
it seems to me that the test suite should not 
temporarily add a share just to test this feature.
msg45973 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-06-02 10:08
Logged In: YES 

Thanks for the patch. Applied as 
posixmodule.c 2.318 2.300.8.10
NEWS 1.982 1.831.4.113
Date User Action Args
2022-04-11 14:56:04adminsetgithub: 40255
2004-05-14 17:57:43glchapmancreate