Author barneygale
Recipients barneygale, eryksun, serhiy.storchaka, steve.dower
Date 2021-04-26.19:08:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619464095.84.0.928509241699.issue42998@roundup.psfhosted.org>
In-reply-to
Content
Thanks very much for taking a look. I can understand the view that, given the unreliability of `os.path.expanduser('~foo')`, we shouldn't be making that functionality *more* available.

My argument for this being a reasonable change is as follows:

Firstly, `os.getcwd()` is a more fundamental operation than `os.path.absolute()`. In both pathlib and os.path, the `absolute()` implementation is built on the `getcwd()` implementation. The process is: call the more fundamental operation, and append whatever else was passed as an argument.

Analagously, `gethomedir()` is a more fundamental operation than `expanduser()`. In the same way, `expanduser()` can call a more fundamental operation and then append the path passed in.

Secondly, for a `pathlib.AbstractPath` implementation, it's a much cleaner API to have `getcwd()` and `gethomedir()` as abstract methods with identical signatures, and `absolute()` and `expanduser()` with default implementations.

Thirdly, if there's are issues with the implementation for retrieving other user's home directories, those should be treated as individual issues with their own bugs, and we should add suitable warnings in the docs in the short term. My patch should make these cases *easier* to solve as we no longer have two competing implementations of the same thing.

Finally, I don't think anyone is going to see `home('barney')` in the docs and decided to retrieve a user's home directory on a whim. If someone *does* need to retrieve another user's home directory, they're going to use `Path('~' + user).expanduser()` if `Path.home(user)` isn't available.

My argument mostly comes from the similarities I perceive between getcwd/absolute and gethomedir/expanduser. We don't expect users to `os.path.absolute('.')` to get the current working directory, after all! But perhaps I've overestimated the similarities here. Any thoughts?

Thanks again for taking a look.
History
Date User Action Args
2021-04-26 19:08:15barneygalesetrecipients: + barneygale, serhiy.storchaka, eryksun, steve.dower
2021-04-26 19:08:15barneygalesetmessageid: <1619464095.84.0.928509241699.issue42998@roundup.psfhosted.org>
2021-04-26 19:08:15barneygalelinkissue42998 messages
2021-04-26 19:08:15barneygalecreate