Message224037
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:48 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, pitrou, vstinner, Arfrever, neologix, Claudiu.Popa, vajrasky, antoine.pietri, fletom, rominf |
2014-07-26 09:49:48 | serhiy.storchaka | set | messageid: <1406368188.44.0.896992586849.issue19776@psf.upfronthosting.co.za> |
2014-07-26 09:49:48 | serhiy.storchaka | link | issue19776 messages |
2014-07-26 09:49:48 | serhiy.storchaka | create | |
|