Skip to content

bpo-33399: Handle when module __cache__ is None in site.abs_path()#6675

Closed
demianbrecht wants to merge 1 commit into
python:masterfrom
demianbrecht:site-handle-none-cached-types
Closed

bpo-33399: Handle when module __cache__ is None in site.abs_path()#6675
demianbrecht wants to merge 1 commit into
python:masterfrom
demianbrecht:site-handle-none-cached-types

Conversation

@demianbrecht

@demianbrecht demianbrecht commented May 1, 2018

Copy link
Copy Markdown

I'll look at adding tests if this approach isn't just wrong. https://bugs.python.org/issue33399

https://bugs.python.org/issue33399

Comment thread Lib/site.py
try:
m.__cached__ = os.path.abspath(m.__cached__)
except (AttributeError, OSError):
except (AttributeError, OSError, TypeError):

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.

I would change the whole try block to:

if getattr(m, '__cached__', None) is not None:
    try:
        m.__cached__ = os.path.abspath(m.__cached__)
    except OSError:
        pass

@bedevere-bot

Copy link
Copy Markdown

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.

And if you don't make the requested changes, you will be put in the comfy chair!

@csabella

Copy link
Copy Markdown
Contributor

@demianbrecht, please address the code review from @brettcannon. Thanks!

@csabella

Copy link
Copy Markdown
Contributor

Since this PR seems to be abandoned, I am going to close it. It can be reopened if the original author is interested in working on it again or a new PR can be created to replace it.

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