FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-39895: Move `pathlib.Path.touch()` implementation into the path accessor by barneygale · Pull Request #18838 · python/cpython · GitHub

/ cpython Public

bpo-39895: Move pathlib.Path.touch() implementation into the path accessor - #18838

Merged
zooba merged 1 commit into
python:masterfrom
barneygale:bpo-39895-pathlib-accessor-touch
Apr 7, 2021
Merged

bpo-39895: Move pathlib.Path.touch() implementation into the path accessor#18838
zooba merged 1 commit into
python:masterfrom
barneygale:bpo-39895-pathlib-accessor-touch

Conversation

barneygale commented Mar 8, 2020
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown

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 commented Mar 9, 2020
edited
Loading

Copy link
Copy Markdown
Contributor Author

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.

pitrou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

barneygale force-pushed the bpo-39895-pathlib-accessor-touch branch from 767e7c3 to 3b001d4 Compare May 29, 2020 01:00

Copy link
Copy Markdown
Contributor Author

Rebased

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

Copy link
Copy Markdown
Contributor Author

@pitrou can this be merged? Thanks

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

5 participants


Back | FazBrowse Home | New Git URL