Message289460
What's the rationale for not calling self._flavour.pathmod.abspath() to implement absolute()? For example:
>>> p = pathlib.Path('C:/con')
>>> p._flavour.pathmod.abspath(p)
'\\\\.\\con'
>>> p._from_parts((p._flavour.pathmod.abspath(p),), init=False)
WindowsPath('//./con/')
That's almost right except for an unrelated problem that pathlib shouldn't append a trailing slash for \\.\ local device paths. Doing so creates a different path, which may be invalid. \\.\con is a symbolic link to \Device\ConDrv\Console, and adding a trailing backslash after the "Console" filename is invalid. An example where the resulting path is valid but wrong is the volume device \\.\C:, which is a link to something like \Device\HarddiskVolume2. Appending a backslash refers to the root directory of the file system on the volume. |
|
Date |
User |
Action |
Args |
2017-03-12 00:47:05 | eryksun | set | recipients:
+ eryksun, brett.cannon, pitrou, docs@python, Jim Fasarakis-Hilliard |
2017-03-12 00:47:05 | eryksun | set | messageid: <1489279625.84.0.115528051027.issue29688@psf.upfronthosting.co.za> |
2017-03-12 00:47:05 | eryksun | link | issue29688 messages |
2017-03-12 00:47:05 | eryksun | create | |
|