Skip to content

Conversation

miss-islington
Copy link
Contributor

@miss-islington 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 [email protected]
(cherry picked from commit 092435e)

Co-authored-by: Toke Høiland-Jørgensen [email protected]

https://bugs.python.org/issue38811

…17225)

Commit 6b5b013 ("bpo-26978: Implement pathlib.Path.link_to (Using
os.link) (pythonGH-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 <[email protected]>
(cherry picked from commit 092435e)

Co-authored-by: Toke Høiland-Jørgensen <[email protected]>
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM, good bot.

@miss-islington
Copy link
Contributor Author

@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
@miss-islington miss-islington deleted the backport-092435e-3.8 branch December 16, 2019 12:42
@miss-islington
Copy link
Contributor Author

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

1 similar comment
@miss-islington
Copy link
Contributor Author

@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants