-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fix --custom-typeshed-dir
crash caused by #13155
#13296
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
Conversation
This comment has been minimized.
This comment has been minimized.
--custom-typeshed-dir
crash caused by #13155
This comment has been minimized.
This comment has been minimized.
1 similar comment
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
@@ -674,6 +674,7 @@ def __init__( | |||
if options.custom_typeshed_dir is not None: | |||
# Check if module lives under custom_typeshed_dir subtree | |||
custom_typeshed_dir = os.path.abspath(options.custom_typeshed_dir) | |||
path = os.path.abspath(path) | |||
if os.path.commonpath((path, custom_typeshed_dir)) == custom_typeshed_dir: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it still can through ValueError
on Windows if path and custom_typeshed_dir
live on different drives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point (though I'm tempted to say that anybody trying to do that deserves what they're getting!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Description
This seems to fix #13295.
Test Plan
I manually verified that this fixes #13295.
Not sure how or where to add a test.I also added a test case totest-data/unit/cmdline.test
which reproduces the crash onmaster
, but passes with this patch applied.