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

2021-04-23 Thread Steve Dower


Steve Dower  added the comment:


New changeset e92d1106291e5a7d4970372478f2882056b7eb3a by Miss Islington (bot) 
in branch '3.8':
bpo-43607: Fix urllib handling of Windows paths with \\?\ prefix (GH-25539)
https://github.com/python/cpython/commit/e92d1106291e5a7d4970372478f2882056b7eb3a


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-04-23 Thread miss-islington


miss-islington  added the comment:


New changeset 04bcfe001cdf6290cb78fa4884002e5301e14c93 by Miss Islington (bot) 
in branch '3.9':
bpo-43607: Fix urllib handling of Windows paths with \\?\ prefix (GH-25539)
https://github.com/python/cpython/commit/04bcfe001cdf6290cb78fa4884002e5301e14c93


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-04-23 Thread Steve Dower


Change by Steve Dower :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-04-23 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +24277
pull_request: https://github.com/python/cpython/pull/25558

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-04-23 Thread Steve Dower


Steve Dower  added the comment:


New changeset 3513d55a617012002c3f82dbf3cec7ec1abd7090 by Steve Dower in branch 
'master':
bpo-43607: Fix urllib handling of Windows paths with \\?\ prefix (GH-25539)
https://github.com/python/cpython/commit/3513d55a617012002c3f82dbf3cec7ec1abd7090


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-04-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24278
pull_request: https://github.com/python/cpython/pull/25559

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-04-22 Thread Steve Dower


Change by Steve Dower :


--
assignee:  -> steve.dower
versions: +Python 3.10, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-04-22 Thread Steve Dower


Change by Steve Dower :


--
keywords: +patch
pull_requests: +24259
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25539

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-03-23 Thread D Levine


D Levine  added the comment:

I think that would make the most sense, yes.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-03-23 Thread Eryk Sun


Eryk Sun  added the comment:

> I suppose the most reasonable behavior is to strip out the "\\?\" before 
> attempting the conversion as the path is sensible and parsable without 

Okay, so you're not looking to preserve the fact that it's a \\?\ verbatim path 
in the URI. You just want to automatically convert from verbatim \\?\X: or 
\\?\UNC\server\share to normal form. Devices other than drive letters and "UNC" 
wouldn't be supported.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-03-23 Thread D Levine


D Levine  added the comment:

I really meant 255 characters not 256 because I was leaving three for ":/". I suppose the most reasonable behavior is to strip out the "\\?\" 
before attempting the conversion as the path is sensible and parsable without 
that, as opposed to the current behavior which is to  crash. The practical 
benefit is to permit the function to work on a wider range of inputs than 
currently is possible for essentially no cost.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-03-23 Thread Eryk Sun


Eryk Sun  added the comment:

RFC8089 doesn't specify "a mechanism for translating namespaced paths ["\\?\" 
and "\\.\"] to or from file URIs", and the Windows shell doesn't support them. 
So what's the practical benefit of supporting them in nturl2path?

> Windows file paths are limited to 256 characters,

Classically, normal filepaths are limited to MAX_PATH - 1 (259) characters, in 
most cases, except for a few cases in which the limit is even smaller. 

For a normal filepath, the API replaces slashes with backlashes; resolves 
relative paths; resolves "." and ".." components; strips trailing dots and 
spaces from the final path component; and, for relative paths and DOS 
drive-letter paths, reserves DOS device names in the final path component (e.g. 
CON, NUL). 

The kernel supports filepaths with up to 32,767 characters, but classically 
this was only accessible by using a verbatim \\?\ filepath, or by using 
workarounds based on substitute drives or filesystem mountpoints and symlinks.

With Python 3.6+ in Windows 10, if long paths are enabled in the system, normal 
filepaths support up to the full 32,767 characters in most cases. The need for 
the \\?\ prefix is thus limited to the rare case when a verbatim path is 
required, or when a filepath has to be passed to a legacy application that 
doesn't support long paths.

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-03-23 Thread D Levine


Change by D Levine :


--
type: crash -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-03-23 Thread D Levine


New submission from D Levine :

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com