Author steve.dower
Recipients Kevin.Norris, eryksun, pitrou, steve.dower, tim.golden, zach.ware
Date 2014-09-06.15:00:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Actually, I'd be inclined to never use the prefix within pathlib and then add it on if necessary when converting to a string. That would also solve a problem like:

>>> p = Path("C:\\") / ('a'*150) / ('a'*150)
>>> p.stat()
FileNotFoundError: [WinError 3] The system cannot find the path specified: ...
>>> p2 = Path("\\\\?\\" + str(p))
>>> p2.stat()

The hardest part about this is knowing with certainty whether it's needed. We can certainly detect most cases automatically.

Maybe we also need an extra method or a format character to force a str() with prefix? Or maybe having an obvious enough function that people can monkey-patch if necessary - the "\\?\" prefix is an edge case for most people already, and checking the total length would bring that to >99% IME.
Date User Action Args
2014-09-06 15:00:41steve.dowersetrecipients: + steve.dower, pitrou, tim.golden, zach.ware, eryksun, Kevin.Norris
2014-09-06 15:00:41steve.dowersetmessageid: <>
2014-09-06 15:00:41steve.dowerlinkissue22299 messages
2014-09-06 15:00:41steve.dowercreate