[issue27403] os.path.dirname doesn't handle Windows' URNs correctly

2016-06-27 Thread Eryk Sun
Eryk Sun added the comment: Paths starting with "\\.\" (or "//./") and "\\?\" are not UNC paths. I've provided some explanations and examples below, and I also encourage you to read "Naming Files, Paths, and Namespaces": https://msdn.microsoft.com/en-us/library/aa365247 "\\.\" is the general

[issue27403] os.path.dirname doesn't handle Windows' URNs correctly

2016-06-27 Thread Dustin Oprea
Dustin Oprea added the comment: Thank you for your elaborate response. I appreciate knowing that "\\server\share" could be considered as the "drive" portion of the path. I'm having trouble determining if "\\?\" is literally some type of valid UNC prefix or you're just using it to represent som

[issue27403] os.path.dirname doesn't handle Windows' URNs correctly

2016-06-27 Thread Eryk Sun
Eryk Sun added the comment: dirname() is implemented via split(), which begins by calling splitdrive(). The 'drive' for a UNC path is the r"\\server\share" component. For example: >>> path = r'\\server\share\folder\file' >>> os.path.splitdrive(path) ('server\\share', '\\folder\\

[issue27403] os.path.dirname doesn't handle Windows' URNs correctly

2016-06-27 Thread Eryk Sun
Changes by Eryk Sun : -- Removed message: http://bugs.python.org/msg269406 ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue27403] os.path.dirname doesn't handle Windows' URNs correctly

2016-06-27 Thread Eryk Sun
Eryk Sun added the comment: dirname() is implemented via split(), which begins by calling splitdrive(). The 'drive' for a UNC path is the r"\\server\share" component. For example: >>> path = r'\\server\share\folder\file' >>> os.path.splitdrive(path) ('server\\share', '\\folder\\

[issue27403] os.path.dirname doesn't handle Windows' URNs correctly

2016-06-27 Thread Dustin Oprea
New submission from Dustin Oprea: Notice that os.path.dirname() returns whatever it is given if it is given a URN, regardless of slash-type. Oddly, you have to double-up the forward-slashes (like you're escaping them) in order to get the correct result (if you're using forward-slashes). Back-s