[issue46362] os.path.abspath() needs more normalization on Windows

2022-01-14 Thread Steve Dower


Steve Dower  added the comment:


New changeset 71c0b859ae16ee748cbb050a1f4de93c04e04f83 by neonene in branch 
'main':
bpo-46362: Ensure abspath() tests pass through environment variables to 
subprocess (GH-30595)
https://github.com/python/cpython/commit/71c0b859ae16ee748cbb050a1f4de93c04e04f83


--

___
Python tracker 

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



[issue46362] os.path.abspath() needs more normalization on Windows

2022-01-14 Thread neonene


Change by neonene :


--
pull_requests: +28793
pull_request: https://github.com/python/cpython/pull/30595

___
Python tracker 

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



[issue46362] os.path.abspath() needs more normalization on Windows

2022-01-13 Thread Steve Dower


Steve Dower  added the comment:

Thanks for the patch!

--
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



[issue46362] os.path.abspath() needs more normalization on Windows

2022-01-13 Thread Steve Dower


Steve Dower  added the comment:


New changeset d4e64cd4b0ea431d4e371f9b0a25f6b75a069dc1 by neonene in branch 
'main':
bpo-46362: Ensure ntpath.abspath() uses the Windows API correctly (GH-30571)
https://github.com/python/cpython/commit/d4e64cd4b0ea431d4e371f9b0a25f6b75a069dc1


--

___
Python tracker 

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



[issue46362] os.path.abspath() needs more normalization on Windows

2022-01-13 Thread Steve Dower


Steve Dower  added the comment:

One thing to be aware of is that Windows 11 has changed the rules around these 
files, so here's my results with 3.10:

>>> for path in paths:
... print(os.path.abspath(path))
...
C:\CON
C:\PRN
C:\AUX
\\.\NUL
C:\COM1
C:\COM2
C:\COM3
C:\COM9
C:\LPT1
C:\LPT2
C:\LPT3
C:\LPT9
C:\foo

But this shouldn't be an issue with the proposed (about to be merged) change.

--

___
Python tracker 

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



[issue46362] os.path.abspath() needs more normalization on Windows

2022-01-13 Thread neonene


neonene  added the comment:

Basically, PR30571 aims for compatibility with 3.10 and earlier. Using Windows 
API is the easiest and the same way as them:

import os.path
paths = [
r'C:\CON',
r'C:\PRN',
r'C:\AUX',
r'C:\NUL',
r'C:\COM1',
r'C:\COM2',
r'C:\COM3',
r'C:\COM9',
r'C:\LPT1',
r'C:\LPT2',
r'C:\LPT3',
r'C:\LPT9',
r'C:\foo. . .',
]
for path in paths:
print(os.path.abspath(path))

"""
3.11 before
C:\CON
C:\PRN
C:\AUX
C:\NUL
C:\COM1
C:\COM2
C:\COM3
C:\COM9
C:\LPT1
C:\LPT2
C:\LPT3
C:\LPT9
C:\foo. . .

3.11 after
\\.\CON
\\.\PRN
\\.\AUX
\\.\NUL
\\.\COM1
\\.\COM2
\\.\COM3
\\.\COM9
\\.\LPT1
\\.\LPT2
\\.\LPT3
\\.\LPT9
C:\foo

3.10.1
\\.\CON
\\.\PRN
\\.\AUX
\\.\NUL
\\.\COM1
\\.\COM2
\\.\COM3
\\.\COM9
\\.\LPT1
\\.\LPT2
\\.\LPT3
\\.\LPT9
C:\foo
"""

--

___
Python tracker 

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



[issue46362] os.path.abspath() needs more normalization on Windows

2022-01-13 Thread Eric V. Smith

Eric V. Smith  added the comment:

Can you show various paths, before and after your change? It’s not clear to me 
what you’re proposing to change.

--
nosy: +eric.smith

___
Python tracker 

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



[issue46362] os.path.abspath() needs more normalization on Windows

2022-01-12 Thread neonene


Change by neonene :


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

___
Python tracker 

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



[issue46362] os.path.abspath() needs more normalization on Windows

2022-01-12 Thread neonene


New submission from neonene :

3.11a3+ introduced the C version of abspath(), which shows incompletely 
normalized absolute path (see msg410068):

>>> os.path.abspath(r'\\spam\\eggs. . .')
'spameggs. . .'
>>> os.path.abspath('C:\\spam. . .')
'C:\\spam. . .'
>>> os.path.abspath('C:\\nul')
'C:\\nul'

The design is efficient on startup with getpath_abspath(), but 
ntpath.abspath()'s result after startup should be more normalized.

--
components: Windows
messages: 410456
nosy: neonene, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: os.path.abspath() needs more normalization on Windows
type: behavior
versions: Python 3.11

___
Python tracker 

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