Skip to content

Fix: Use os.readlink instead of Path.readlink before Python 3.9. #172

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

Merged

Conversation

jinchengJL
Copy link

Path.readlink is not available before Python 3.9, which is causing the tool to complain in a project I'm working on. This code was implemented as os.readlink() before rules_python was introduced (per 0e5b1aa), but didn't seem to be reverted when rules_python was reverted.

Verified locally that this fixes the issue for me.

Jincheng and others added 2 commits February 21, 2024 14:36
`Path.readlink` is not available before Python 3.9, which is causing the tool to complain in a project I'm working on. This code was implemented as `os.readlink()` before rules_python was introduced (per hedronvision@0e5b1aa), but didn't seem to be reverted when rules_python was reverted.

Verified locally that this fixes the issue for me.
@cpsauer
Copy link
Contributor

cpsauer commented Feb 22, 2024

Thanks for flagging and for contributing a fix, Jincheng! Sorry about that. Merging!

(I also added a conversion to a pathlib path to avoid a spurious error about the prior link pointing to the wrong place. Otherwise os.readlink returns a string which fails comparison with a later path.)

Thanks and happy coding!
Chris

@cpsauer cpsauer merged commit 204aa59 into hedronvision:main Feb 22, 2024
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.

2 participants