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 <>
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.
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: <>
2014-07-26 09:49:48serhiy.storchakalinkissue19776 messages
2014-07-26 09:49:48serhiy.storchakacreate