Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-42998: add 'user' parameter to pathlib.Path.home() #25271

Conversation

barneygale
Copy link
Contributor

@barneygale barneygale commented Apr 8, 2021

Also slightly re-arrange the internals such that expanduser() calls home().
This is to aid with the creation of an AbstractPath class in bpo-24132,
where cwd() and home() will be abstract methods, but not absolute()
or expanduser().

https://bugs.python.org/issue42998

@barneygale
Copy link
Contributor Author

barneygale commented Apr 8, 2021

Needs tests and NEWS.

@barneygale barneygale changed the title WIP: bpo-42998: add 'username' parameter to pathlib.Path.home() WIP: bpo-42998: add 'user' parameter to pathlib.Path.home() Apr 8, 2021
@barneygale barneygale marked this pull request as ready for review April 8, 2021 20:57
@barneygale barneygale changed the title WIP: bpo-42998: add 'user' parameter to pathlib.Path.home() bpo-42998: add 'user' parameter to pathlib.Path.home() Apr 8, 2021
@barneygale
Copy link
Contributor Author

Pretty sure the test failure is unrelated to my changes.

Slightly re-arrange the internals such that `expanduser()` calls `home()`.
This is to aid with the creation of an `AbstractPath` class in bpo-24132,
where `cwd()` and `home()` will be abstract methods, but not `absolute()`
or `expanduser()`.
@barneygale barneygale force-pushed the bpo-42998-pathlib-home-username-parameter branch from 42a44e6 to 43e7456 Compare April 24, 2021 21:32
@barneygale
Copy link
Contributor Author

Closing this PR, as it looks like resolving other users' home directories isn't something we can rely on!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants