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-39895: Move pathlib.Path.touch() implementation into the path accessor #18838

Merged
merged 1 commit into from Apr 7, 2021

Conversation

barneygale
Copy link
Contributor

@barneygale barneygale commented Mar 8, 2020

Path.touch() does a lot of os-specific /stuff/ that should probably live in the accessor. Perhaps most importantly, is calls os.close() on whatever accessor.open() returns, which is problematic for those wishing to write their own accessor that doesn't work on a file descriptor level.

This PR:

  • Routes Path.touch() via the path's accessor, in conformity with most other Path methods.
  • Adds an _NormalAccessor.touch() method
  • Removes _NormalAccessor.utime() (which was only used by touch())
  • Removes Path._raw_open() (which was only used by touch())

https://bugs.python.org/issue39895

@the-knights-who-say-ni
Copy link

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 Missing

Our records indicate the following people have not signed the CLA:

@barneygale

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
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@barneygale
Copy link
Contributor Author

barneygale commented Mar 9, 2020

I think this doesn't require a NEWS entry as it's an internal refactor, assuming that subclassing Path/Accessor isn't (yet) properly supported.

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Could you please merge/rebase from master and fix the conflicts?

@barneygale
Copy link
Contributor Author

Rebased

@barneygale barneygale force-pushed the bpo-39895-pathlib-accessor-touch branch from 3b001d4 to 17e3af2 Compare January 22, 2021 00:21
@barneygale
Copy link
Contributor Author

@pitrou can this be merged? Thanks

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.

None yet

5 participants