New submission from D Levine <levin...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue43607>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to