This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Arfrever, Claudiu.Popa, antoine.pietri, fletom, neologix, pitrou, rominf, serhiy.storchaka, vajrasky, vstinner
Date 2014-07-26.09:49:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1406368188.44.0.896992586849.issue19776@psf.upfronthosting.co.za>
In-reply-to
Content
Here is alternative patch which doesn't use os.path.expanduser() and reimplement it's logic. Differences:

* expanduser() is part of concrete path API. This method access environment.
* RuntimeError is raised when user home can't be determined.
* Currently ntpath.expanduser() uses heuristic to expand path with specified username. This works with default homedirs but can return wrong result when homedirs was moved to different locations. WindowsPath.expanduser() also uses heuristic, but more robust. Of course it would be better to get other users homedirs from Windows API, and perhaps we should defer this issue until implementing pwd or like on Windows.
* Expanded tests.

Interesting, common idiom to escape tilda in relative path (adding "./" prefix) doesn't work with pathlib, because "." components are ignored.
History
Date User Action Args
2014-07-26 09:49:48serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, vstinner, Arfrever, neologix, Claudiu.Popa, vajrasky, antoine.pietri, fletom, rominf
2014-07-26 09:49:48serhiy.storchakasetmessageid: <1406368188.44.0.896992586849.issue19776@psf.upfronthosting.co.za>
2014-07-26 09:49:48serhiy.storchakalinkissue19776 messages
2014-07-26 09:49:48serhiy.storchakacreate