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-slashes appear to be broken no matter what.
C:\Python35-32>python Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os.path >>> os.path.dirname("\\\\a\\b") '\\\\a\\b' >>> os.path.dirname("//a/b") '//a/b' >>> os.path.dirname("////a//b") '////a' Any ideas? ---------- components: Windows messages: 269404 nosy: Dustin.Oprea, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: os.path.dirname doesn't handle Windows' URNs correctly type: behavior versions: Python 2.7, Python 3.5 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27403> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com