bpo-32642: adding compatibility for pathlike objects in sys.path by jayyyin · Pull Request #5691 · python/cpython (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation8 Commits6 Checks0 Files changed

Conversation

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

[ Show hidden characters]({{ revealButtonHref }})

jayyyin

I'm uncertain if that's all that needs to be done for the code to do what is intended since I'm kind of new to the whole path-like object concept, I've noticed that there's still self.path in the class and recall reading something about removing path attributes from classes, but I've been unable to find documentation on how to add compatibility to something for path-like objects.

https://bugs.python.org/issue32642

@jayyyin

@jayyyin

I'm having issues with my local changes for this PR, I'm unsure why my local machine takes a seemingly infinite amount of time on test_poplib, so again I think something to do with my local environment is causing issues again, any help would be appreciated...

@jayyyin

@csabella

@jayyyin Please resolve the file conflict.

brettcannon

Choose a reason for hiding this comment

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

Thanks for the PR but this needs tests.

@@ -1241,6 +1241,8 @@ def _get_spec(cls, fullname, path, target=None):
# the list of paths that will become its __path__
namespace_path = []
for entry in path:
if hasattr(entry, '__fspath__'):

Choose a reason for hiding this comment

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

This is unnecessary as os.fspath() passes strings through without issue.

@@ -0,0 +1 @@
adding compatibility for pathlike objects in sys.path

Choose a reason for hiding this comment

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

adding compatibility for pathlike objects in sys.path
Add compatibility for path-like objects on sys.path.
Patch by jayyin.

@bedevere-bot

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@csabella

The original author of the pull request hasn't been active on this issue for a long time, so I'm going to close it. This can be reopened or a new pull request can be created for work to continue on the issue. Thanks!

@sroet sroet mentioned this pull request

Aug 29, 2020