gh-64978: Add chown() to pathlib.Path#31212
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). CLA MissingOur records indicate the following people have not signed the CLA: For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
Sorry, something went wrong.
6d47346 to
55b70c0
Compare
February 8, 2022 11:52
196cf81 to
9032f1b
Compare
February 8, 2022 13:47
No support for WindowsPath
c72a2f3 to
f9a611b
Compare
February 13, 2022 09:38
|
I'm supportive of adding I don't love Couple more things to consider/discuss:
|
Sorry, something went wrong.
|
I'm fine with adding I also concur on not wanting No opinion on the name/ID question. I don't quite follow the |
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
I have already removed the |
Sorry, something went wrong.
|
I am not sure with On the other hand I have removed |
Sorry, something went wrong.
|
Thanks for making the requested changes! @brettcannon: please review the changes made to this pull request. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Having given it more thought, and considering the context where this is likely to be used (devops-y scripts), I think supporting owner and group names (in addition to IDs) is important. I think the new method should call through to |
Sorry, something went wrong.
Co-authored-by: Barney Gale <barney.gale@gmail.com>
We would need to drop the |
Sorry, something went wrong.
|
Or add |
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
|
I left a comment on the issue, but after thinking about it, right now there isn't really enough here to warrant taking this PR as it's just wrapping a function call in a method. Without some added benefit to being attached to |
Sorry, something went wrong.
|
Thanks for the PR, @y0urself. I'm afraid I'm going to close this as rejected, as I agree with Brett's comments, as well as @barneygale's and @CAM-Gerlach's remarks on the associated issue. However, I hope this doesn't discourage you from contributing to CPython in the future! We do appreciate the contribution :) |
Sorry, something went wrong.
|
A few words about one thing. pip install -U 'xonsh[full]'
xonsh
cd /tmp && echo world > hello.txt
p'hello.txt'
# Path('hello.txt')
p'hello.txt'.read_text()
# 'world\n'
for f in p'/tmp'.glob('hello*'):
print(f, f.exists())
# /tmp/hello.txt TrueIt will be cool to run I'm for reopening this issue and favor for enriching pathlib. |
Sorry, something went wrong.
|
@barneygale , as you're now officially the pathlib maintainer, what is your take on considering re-opening this PR and/or a revised one? |
Sorry, something went wrong.
|
I've re-opened the issue, we could continue discussion there if that works? |
Sorry, something went wrong.
This PR adds
chown()andlchown()to thepathliblibrary.As for
chmodand other existing functions, this is achieved by usingos.chown()within the new functions.