Author eryksun
Recipients Jim Fasarakis-Hilliard, brett.cannon, docs@python, eryksun, pitrou
Date 2017-03-12.00:47:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489279625.84.0.115528051027.issue29688@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-03-12 00:47:05eryksunsetrecipients: + eryksun, brett.cannon, pitrou, docs@python, Jim Fasarakis-Hilliard
2017-03-12 00:47:05eryksunsetmessageid: <1489279625.84.0.115528051027.issue29688@psf.upfronthosting.co.za>
2017-03-12 00:47:05eryksunlinkissue29688 messages
2017-03-12 00:47:05eryksuncreate