| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead. |
Sorry, something went wrong.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead. |
Sorry, something went wrong.
…MG5ux.rst Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
|
Tip:
https://devguide.python.org/getting-started/pull-request-lifecycle/#quick-guide |
Sorry, something went wrong.
I see, thanks for letting me know. |
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry to be arguing.
Sorry, something went wrong.
|
|
||
| try: | ||
| self.close() | ||
| except RuntimeError: |
There was a problem hiding this comment.
Catching all RuntimeErrors always feels scary -- it could mark other, more serious bugs. How about only issuing the new warning if self._loop.is_closed()?
Sorry, something went wrong.
There was a problem hiding this comment.
Have you confirmed that this version solves the problem in your code? How hard would it be to write a unit test to confirm that this warning is reported?
Sorry, something went wrong.
There was a problem hiding this comment.
Change looks good. Thanks. Happy to merge after we have a test. This would be the file to add the test: https://github.com/python/cpython/blob/main/Lib/test/test_asyncio/test_streams.py
Sorry, something went wrong.
|
Thanks @dpr-0 for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Sorry, something went wrong.
|
Sorry, @dpr-0 and @gvanrossum, I could not cleanly backport this to 3.12 due to a conflict. cherry_picker e0f512797596282bff63260f8102592aad37cdf1 3.12 |
Sorry, something went wrong.
|
Sorry, @dpr-0 and @gvanrossum, I could not cleanly backport this to 3.11 due to a conflict. cherry_picker e0f512797596282bff63260f8102592aad37cdf1 3.11 |
Sorry, something went wrong.
|
@dpr-0 Are you interested in attempting the backports? |
Sorry, something went wrong.
Yes, any brief backport steps or I just cherry-pick and create two PRs? |
Sorry, something went wrong.
|
I think it's just a matter of checking out the right branch (3.11 or 3.12), cherry-picking the commit from main, resolving conflicts, and submitting a PR. Repeat for the other branch. The PR title should follow certain conventions (see either the devguide or just wait for the test to fail -- I always forget what it is and I use the latter). I don't know what caused the conflict -- if it's complicated just ping this thread with the conflict info. |
Sorry, something went wrong.
| try: | ||
| self.loop.run_until_complete(inner(httpd)) | ||
| # This exception is caused by `self.loop.stop()` as expected. | ||
| except RuntimeError: |
There was a problem hiding this comment.
If this exception is expected then why not use self.assertRaises etc?
Sorry, something went wrong.
There was a problem hiding this comment.
except allows/tolerates an exception, assert requires one and will fail if it does not happen because of other improvements.
Sorry, something went wrong.
|
@kumaraditya303 @gvanrossum I am planning to backport this PR and issue a new PR to improve test case. |
Sorry, something went wrong.
… closed loop (python#111983) Issue a ResourceWarning instead. Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> (cherry picked from commit e0f5127)
|
GH-112141 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
|
GH-112142 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
…ed with closed loop (pythonGH-111983) Issue a ResourceWarning instead. (cherry picked from commit e0f5127) pythongh-109538: Avoid RuntimeError when StreamWriter is deleted with closed loop (python#111983) Issue a ResourceWarning instead. Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> (cherry picked from commit e0f5127)
|
GH-112141 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
|
GH-112141 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
|
GH-112142 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
…H-111983) (#112142) * [3.12] gh-109538: Avoid RuntimeError when StreamWriter is deleted with closed loop (GH-111983) Issue a ResourceWarning instead. (cherry picked from commit e0f5127) gh-109538: Avoid RuntimeError when StreamWriter is deleted with closed loop (#111983) Issue a ResourceWarning instead. Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> (cherry picked from commit e0f5127) * Fix missing warnings import
… closed loop (python#111983) Issue a ResourceWarning instead. Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
… closed loop (python#111983) Issue a ResourceWarning instead. Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
Catch RuntimeError("Event loop is closed") from base_events.py line 514 then issue a warning to user