-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
pure-Python warn_explicit() passes wrong arg to WarningMessage #129843
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
Comments
This indeed looks wrong. Do you want to send a PR fixing this? The patch is rather easy as you just need to write |
No. |
I can take this if no one else wants it. |
Go ahead Sergey! |
argument to named argument
@srinivasreddy In the future, it would be nice not to make a PR when someone else has already suggested to do it. If they do not open one for a few days, it's also better to first ask them if they are still working on the task. |
Apologies for raising the PR. If @sergey-miryanov wanted to raise PR, I am fine to close mine . |
@srinivasreddy |
…#129848) The pure Python implementation of `warnings.warn_explicit` constructs a `WarningMessage` with an incorrect source (it incorrectly sets the WarningMessage's line to the given `source`).
…licit` (pythonGH-129848) The pure Python implementation of `warnings.warn_explicit` constructs a `WarningMessage` with an incorrect source (it incorrectly sets the WarningMessage's line to the given `source`). (cherry picked from commit 80e00ec) Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) <thatiparthysreenivas@gmail.com>
…licit` (pythonGH-129848) The pure Python implementation of `warnings.warn_explicit` constructs a `WarningMessage` with an incorrect source (it incorrectly sets the WarningMessage's line to the given `source`). (cherry picked from commit 80e00ec) Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) <thatiparthysreenivas@gmail.com>
…plicit` (GH-129848) (#131349) gh-129843: fix pure Python implementation of `warnings.warn_explicit` (GH-129848) The pure Python implementation of `warnings.warn_explicit` constructs a `WarningMessage` with an incorrect source (it incorrectly sets the WarningMessage's line to the given `source`). (cherry picked from commit 80e00ec) Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) <thatiparthysreenivas@gmail.com>
…plicit` (GH-129848) (#131350) gh-129843: fix pure Python implementation of `warnings.warn_explicit` (GH-129848) The pure Python implementation of `warnings.warn_explicit` constructs a `WarningMessage` with an incorrect source (it incorrectly sets the WarningMessage's line to the given `source`). (cherry picked from commit 80e00ec) Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) <thatiparthysreenivas@gmail.com>
Thanks for the report & the fix! |
…licit` (python#129848) 6ACC The pure Python implementation of `warnings.warn_explicit` constructs a `WarningMessage` with an incorrect source (it incorrectly sets the WarningMessage's line to the given `source`).
…licit` (python#129848) The pure Python implementation of `warnings.warn_explicit` constructs a `WarningMessage` with an incorrect source (it incorrectly sets the WarningMessage's line to the given `source`).
Uh oh!
There was an error while loading. Please reload this page.
The pure-Python implementation of the
warnings.warn_explicit()
function does this:But the 5th argument of
WarningMessage
isfile
(the file the message is supposed to be printed into), notsource
("the destroyed object which emitted aResourceWarning
").Here's how to reproduce the bug:
Linked PRs
warnings.warn_explicit
(GH-129848) #131349warnings.warn_explicit
(GH-129848) #131350The text was updated successfully, but these errors were encountered: