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

[3.8] bpo-38811: Check for presence of os.link method in pathlib (GH-17225) #17626

Merged
merged 1 commit into from Dec 16, 2019

Conversation

@miss-islington
Copy link

miss-islington commented Dec 16, 2019

Commit 6b5b013 ("bpo-26978: Implement pathlib.Path.link_to (Using
os.link) (GH-12990)") introduced a new link_to method in pathlib. However,
this makes pathlib crash when the 'os' module is missing a 'link' method.

Fix this by checking for the presence of the 'link' method on pathlib
module import, and if it's not present, turn it into a runtime error like
those emitted when there is no lchmod() or symlink().

Signed-off-by: Toke Høiland-Jørgensen toke@redhat.com
(cherry picked from commit 092435e)

Co-authored-by: Toke Høiland-Jørgensen toke@redhat.com

https://bugs.python.org/issue38811

Commit 6b5b013 ("bpo-26978: Implement pathlib.Path.link_to (Using
os.link) (GH-12990)") introduced a new link_to method in pathlib. However,
this makes pathlib crash when the 'os' module is missing a 'link' method.

Fix this by checking for the presence of the 'link' method on pathlib
module import, and if it's not present, turn it into a runtime error like
those emitted when there is no lchmod() or symlink().

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
(cherry picked from commit 092435e)

Co-authored-by: Toke Høiland-Jørgensen <toke@redhat.com>
Copy link
Member

vstinner left a comment

LGTM, good bot.

@miss-islington

This comment has been minimized.

Copy link
Author

miss-islington commented Dec 16, 2019

@tohojo and @vstinner: Status check is done, and it's a success .

@miss-islington miss-islington merged commit 8d0f369 into python:3.8 Dec 16, 2019
5 checks passed
5 checks passed
Azure Pipelines PR #20191216.11 succeeded
Details
bedevere/issue-number Issue number 38811 found
Details
bedevere/maintenance-branch-pr Valid maintenance branch PR title.
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@miss-islington miss-islington deleted the miss-islington:backport-092435e-3.8 branch Dec 16, 2019
@miss-islington

This comment has been minimized.

Copy link
Author

miss-islington commented Dec 16, 2019

@tohojo and @vstinner: Status check is done, and it's a success .

1 similar comment
@miss-islington

This comment has been minimized.

Copy link
Author

miss-islington commented Dec 16, 2019

@tohojo and @vstinner: Status check is done, and it's a success .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.