Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-117535: Change unknown filename of warnings from sys to <sys> #118018

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
merged 3 commits into from
Apr 19, 2024

Conversation

gaogaotiantian
Copy link
Member

@gaogaotiantian gaogaotiantian commented Apr 18, 2024

The filename sys could be a real file in the file system and linecache will try to read the content of the file and print it out. Using <sys> will avoid the confusion and let linecache know this is not a real file.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

While we are here, I suggest to set lineno to 0 in this case.

@gaogaotiantian
Copy link
Member Author

While we are here, I suggest to set lineno to 0 in this case.

Ah, right. Done.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

I always thought this referred to the sys module.

@gaogaotiantian
Copy link
Member Author

Maybe we can merge this now consider this is a straightfoward fix and we already have 2 approvals?

@JelleZijlstra JelleZijlstra merged commit a09e472 into python:main Apr 19, 2024
@gaogaotiantian gaogaotiantian deleted the fix-sys-warning-main branch April 19, 2024 04:51
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.

3 participants