[New-bugs-announce] [issue43607] urllib's request.pathname2url not compatible with extended-length Windows file paths

D Levine report at bugs.python.org
Tue Mar 23 18:56:49 EDT 2021


New submission from D Levine <levineds at gmail.com>:

Windows file paths are limited to 256 characters, and one of Windows's prescribed methods to address this is to prepend "\\?\" before a Windows absolute path (see: https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation)

urllib.request.pathname2url raises an error on such paths as this function calls nturl2path.py's pathname2url function which explicitly checks that the number of characters before the ":" in a Windows path is precisely one, which is, of course, not the case if you are using an extended-length path (e.g. "\\?\C:\Python39").

As a result, urllib cannot handle pathname2url conversion for some valid Windows paths.

----------
components: Windows
messages: 389415
nosy: levineds, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: urllib's request.pathname2url not compatible with extended-length Windows file paths
type: crash
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43607>
_______________________________________


More information about the New-bugs-announce mailing list