[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2022-02-23 Thread Chris Jerdonek
Chris Jerdonek added the comment: For future reference, with Andrew's change merged above, the traceback for the example snippet in my message above: https://bugs.python.org/issue45390#msg403570 is now the following. Observe that (1) the call to sleep() continues to be present, but (2

[issue46829] Confusing CancelError message if multiple cancellations are scheduled

2022-02-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: I don't really understand all the hate around the idea of a cancel message. One reason it's useful is that it provides a simple way to say *why* something is being cancelled or *what* is cancelling it. It provides additional context to the exception

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2022-02-17 Thread Chris Jerdonek
Chris Jerdonek added the comment: Andrew, the approach I described would I feel be much better. It would result in more concise, less verbose tracebacks, as opposed to more verbose -- not just because the message won't be repeated, but also because it eliminates the unneeded creation

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: > I'm not sure yet (if anything I'd need it for a task, not a future). (By future, I also meant task, as task inherits from future.) For now, I think it would be safer to get the message from the CancelledError, if possible, since how it gets there tr

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: > I note that there is no documented way to retrieve the cancel message Does retrieving it from the CancelledError that is bubbling up suffice? Or do you need to be able to obtain it from the future object? -- nosy: +chris.jerdo

[issue45718] asyncio: MultiLoopWatcher has a race condition (Proposed work-around)

2021-11-05 Thread Chris Jerdonek
Chris Jerdonek added the comment: Since issue 38323 is still open, I think you should just comment on that instead of creating a new issue. -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue45

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-09 Thread Chris Jerdonek
Chris Jerdonek added the comment: Here's a simplification of Marco's snippet to focus the discussion. import asyncio async def job(): # raise RuntimeError('error!') await asyncio.sleep(5) async def main(): task = asyncio.create_task(job()) await asyncio.sleep(1

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-09 Thread Chris Jerdonek
Chris Jerdonek added the comment: I still don't see you calling asyncio.Task.exception() in your new attachment... -- ___ Python tracker <https://bugs.python.org/issue45

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-09 Thread Chris Jerdonek
Chris Jerdonek added the comment: > 2) Now: if I re-raise the asyncio.CancelledError as-is, I lose the message, if I call the `asyncio.Task.exception()` function. Re-raise asyncio.CancelledError where? (And what do you mean by "re-raise"?) Call asyncio.Task.exception() where? Th

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-07 Thread Chris Jerdonek
Chris Jerdonek added the comment: > But, once the asyncio.Task is cancelled, is impossible to retrieve that > original asyncio.CancelledError(msg) exception with the message, because it > seems that *a new* asyncio.CancelledError() [without the message] is raised > when asyncio

[issue45075] confusion between frame and frame_summary in traceback module

2021-09-01 Thread Chris Jerdonek
Chris Jerdonek added the comment: Or frame_info (more readable), since FrameSummary is proposed to be "Information about a single frame from a traceback." -- ___ Python tracker <https://bugs.python.o

[issue45075] confusion between frame and frame_summary in traceback module

2021-09-01 Thread Chris Jerdonek
Chris Jerdonek added the comment: I was suggesting keeping more similarity between FrameSummary and StackSummary in addition to differentiating frame from FrameSummary. Since stack is used for StackSummary, frame_sum is more similar than f_summary while still providing the differentiation

[issue45075] confusion between frame and frame_summary in traceback module

2021-09-01 Thread Chris Jerdonek
Chris Jerdonek added the comment: It might be good to have consistency with what will be used for StackSummary so two different approaches to naming aren't used. By the way, frame_sum is another possibility since I see frame_gen being used. -- nosy: +chris.jerdonek

[issue44938] Expose PyErr_ChainExceptions in the stable API

2021-08-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: I agree with Serhiy that this API isn't necessarily the right one. It's just what happens to be there now. Also, we're still not clear on our stance towards cycles (see the issue25782 discussion). (Maybe the exposed version should result in an error

[issue44895] refleak test failure in test_exceptions

2021-08-13 Thread Chris Jerdonek
Chris Jerdonek added the comment: FYI, I tried myself, and setting PYTHONHASHSEED didn't make the failures deterministic. -- ___ Python tracker <https://bugs.python.org/issue44

[issue44895] refleak test failure in test_exceptions

2021-08-13 Thread Chris Jerdonek
Chris Jerdonek added the comment: Last question: might trying different values of PYTHONHASHSEED help? -- ___ Python tracker <https://bugs.python.org/issue44

[issue44895] refleak test failure in test_exceptions

2021-08-13 Thread Chris Jerdonek
Chris Jerdonek added the comment: "How does this explain it not being non-deterministic on" -> "How does this explain it not being deterministic on" -- ___ Python tracker <https://

[issue44895] refleak test failure in test_exceptions

2021-08-13 Thread Chris Jerdonek
Chris Jerdonek added the comment: > Maybe it's a very precise threshold which triggers the issue. Between Linux > and macOS, the site module executes different code paths which produce > different GC counters. > Sometimes, the GC must happen in a very precise line, one line

[issue44895] refleak test failure in test_exceptions

2021-08-12 Thread Chris Jerdonek
Chris Jerdonek added the comment: Out of curiosity, is the failure deterministic in environments where it fails? If not, what is the source of the indeterminism -- some kind of race condition or something else? -- nosy: +chris.jerdonek ___ Python

[issue25782] CPython hangs on error __context__ set to the error itself

2021-08-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: > Preventing creation of the loop will fix all other code that iterate the > __context__ chain. We can still do / discuss that following Irit's proposed change, which is an improvement, IMO. -- ___

[issue40696] Exception handling with "await" can hang in Python3.9.0b1

2021-08-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: Okay, I'll close the issue and update it to reflect that it was restricted to the narrower, originally reported issue. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: exception chain cycles ca

[issue25782] CPython hangs on error __context__ set to the error itself

2021-08-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: > No, I meant C -> A -> B -> C -> A Oh, good. I support your reasoning and approach, by the way. -- ___ Python tracker <https://bugs.pyt

[issue25782] CPython hangs on error __context__ set to the error itself

2021-08-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: > the result is C -> A -> B -> C Did you mean C -> A -> B? By the way, if you applied to this example your reasoning that PyErr_SetObject shouldn't try to fix user bugs, should this example instead be C -> A -> B -> C

[issue25782] CPython hangs on error __context__ set to the error itself

2021-08-06 Thread Chris Jerdonek
Chris Jerdonek added the comment: That's okay. I didn't mean to suggest I thought your patch needed to handle that case or that we needed to decide it before moving forward. I was just wondering what would happen with your patch with it, even if it means a hang. Or were you saying

[issue25782] CPython hangs on error __context__ set to the error itself

2021-08-06 Thread Chris Jerdonek
Chris Jerdonek added the comment: Yes, that seems like a good approach. And how about with Serhiy's example from above? > If there is a chain A -> B -> C -> D -> E, after assignment C.__context__ = A > ... -- ___ Pyth

[issue25782] CPython hangs on error __context__ set to the error itself

2021-08-06 Thread Chris Jerdonek
Chris Jerdonek added the comment: Thanks, Irit. Can you show how your patch behaves using some representative examples (maybe using arrow examples from above)? And if it behaves differently from Dennis's patch, can you include an example showing that, too

[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2021-06-04 Thread Chris Jerdonek
Chris Jerdonek added the comment: > MultiLoopChildWatcher must ensures that the event loop is awaken when it > receives a signal by using signal.setwakeup(). This is done by > _UnixSelectorEventLoop.add_signal_handler(). Maybe MultiLoopChildWatcher > could reuse t

[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2021-06-04 Thread Chris Jerdonek
Chris Jerdonek added the comment: > This issue is not solved. Yes, nothing was changed. After diagnosing this issue and trying some things out in a draft PR, my conclusion is that an asyncio maintainer really needs to weigh in on what to do (especially Andrew who authored the cl

[issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots

2021-06-04 Thread Chris Jerdonek
Change by Chris Jerdonek : -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue44112> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43837] Operator precedence documentation could be more clear

2021-04-18 Thread Chris Jerdonek
Chris Jerdonek added the comment: > So maybe we should change the terminology while we’re at it. When math is taught to elementary school students in the US, it's called "order of operations": https://en.wikipedia.org/wiki/Order_of_operations Since this was raised in the context

[issue37712] Exception frames from unittest.TestCase.fail dependent on nesting

2021-04-09 Thread Chris Jerdonek
Chris Jerdonek added the comment: > I think this is the same as issue37712. This issue was first reported as issue24959. It would be better to close the newer issues as duplicates of the first one, instead of keeping all the duplicates open. Otherwise, the history and discussion g

[issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp

2021-01-31 Thread Chris Jerdonek
Change by Chris Jerdonek : -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue31212> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42140] asyncio.wait function creates futures set two times

2020-10-26 Thread Chris Jerdonek
Chris Jerdonek added the comment: If it's just a code cleanup and not a bugfix though, it shouldn't be backported. But yes, as a cleanup it's fine. And even if it's expected to go away later, it's okay to do now. -- ___ Python tracker <ht

[issue42140] asyncio.wait function creates futures set two times

2020-10-25 Thread Chris Jerdonek
Chris Jerdonek added the comment: Are you suggesting this is a bug, or is it just a suggested code cleanup? I ask because the docs suggest that a set should be passed: https://docs.python.org/3/library/asyncio-task.html#asyncio.wait And the docstring says it should be a sequence: https

[issue30181] Correct the parsing of a test case docstring.

2020-10-25 Thread Chris Jerdonek
Chris Jerdonek added the comment: I'm closing this as a duplicate of issue 39450, which has been resolved. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> unittest TestCase shortDescription does not stri

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-10-24 Thread Chris Jerdonek
Chris Jerdonek added the comment: Issue #42130 that was recently filed appears related to this change. -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue37

[issue42130] AsyncIO's wait_for can hide cancellation in a rare race condition

2020-10-24 Thread Chris Jerdonek
Chris Jerdonek added the comment: It looks like issue 37658 might be the relevant change rather. Here is the new logic it introduced: https://github.com/python/cpython/blob/db455296be5f792b8c12b7cd7f3962b52e4f44ee/Lib/asyncio/tasks.py#L483-L488 (via https://github.com/python/cpython/pull

[issue42130] AsyncIO's wait_for can hide cancellation in a rare race condition

2020-10-24 Thread Chris Jerdonek
Change by Chris Jerdonek : -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue42130> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2020-10-18 Thread Chris Jerdonek
Change by Chris Jerdonek : -- pull_requests: +21719 pull_request: https://github.com/python/cpython/pull/22756 ___ Python tracker <https://bugs.python.org/issue38

[issue30181] Correct the parsing of a test case docstring.

2020-10-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: I believe this was addressed by issue 39450, which I think was technically a duplicate of this issue. -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue30

[issue39450] unittest TestCase shortDescription does not strip whitespace

2020-10-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: I believe this also resolves issue 30181 (which was the same issue). -- nosy: +chris.jerdonek resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 ___ Pytho

[issue33647] Add str.replace(replacement_map)

2020-10-08 Thread Chris Jerdonek
Change by Chris Jerdonek : -- title: Add re.replace(string, replacement_map) -> Add str.replace(replacement_map) ___ Python tracker <https://bugs.python.org/issu

[issue33647] Add re.replace(string, replacement_map)

2020-10-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: Another API option is to use str.replace's existing arguments: str.replace(old, new[, count]). In addition to "old" and "new" being strings, they could also be lists of strings of equal length, similar to how str.maketrans() can accept t

[issue40941] Merge generator.gi_running and frame executing flag into single frame state

2020-07-09 Thread Chris Jerdonek
Chris Jerdonek added the comment: Mark, I want to flag issue29590 for you ("Incorrect stack traces when re-entering a generator/coroutine stack via .throw()") in case this issue relates to or would help at all with that. -- nosy: +chri

[issue40932] subprocess docs should warn of shlex use on Windows

2020-06-10 Thread Chris Jerdonek
Change by Chris Jerdonek : -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue40932> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31213] __context__ reset to None in nested exception

2020-06-06 Thread Chris Jerdonek
Change by Chris Jerdonek : -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue31213> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40679] show class name in method invocation TypeError

2020-06-03 Thread Chris Jerdonek
Chris Jerdonek added the comment: Thanks a lot, Victor. -- ___ Python tracker <https://bugs.python.org/issue40679> ___ ___ Python-bugs-list mailing list Unsub

[issue40222] "Zero cost" exception handling

2020-06-03 Thread Chris Jerdonek
Chris Jerdonek added the comment: To clarify, would there be any observable difference in behavior aside from speed? And would there be any limitations in when the speedup can be applied? -- nosy: +chris.jerdonek ___ Python tracker <ht

[issue25782] CPython hangs on error __context__ set to the error itself

2020-05-31 Thread Chris Jerdonek
Chris Jerdonek added the comment: I think this issue needs deeper discussion to know how to proceed. > If there is a chain A -> B -> C -> D -> E, after assignment C.__context__ = A > we will get a chain C -> A -> B -> D -> E. No exception is lost. I understand

[issue25782] CPython hangs on error __context__ set to the error itself

2020-05-30 Thread Chris Jerdonek
Change by Chris Jerdonek : -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue25782> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40736] better message for re.search TypeError ("expected string or bytes-like object")

2020-05-25 Thread Chris Jerdonek
Chris Jerdonek added the comment: I already started one actually. But if I don't get to it in a week, I'll make a note here and you can take it up. -- ___ Python tracker <https://bugs.python.org/issue40

[issue34852] Counter-intuitive behavior of Server.close() / wait_closed()

2020-05-23 Thread Chris Jerdonek
Change by Chris Jerdonek : -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue34852> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40743] [CMake] It's 2020, where is CMake?

2020-05-23 Thread Chris Jerdonek
Chris Jerdonek added the comment: This was discussed a bit last December 2019 here ("Is there prior discussion around the build system of CPython itself?"): https://discuss.python.org/t/is-there-prior-discussion-around-the-build-system-of-cpython-itself/2813 -- nosy: +chri

[issue39343] Travis CI: documentation job fails in library/nntplib.rst with random network issue on news.gmane.io

2020-05-23 Thread Chris Jerdonek
Chris Jerdonek added the comment: Reopening as this is happening again -- twice for me: https://github.com/python/cpython/pull/20329/checks?check_run_id=701405252#step:7:117 -- nosy: +chris.jerdonek resolution: fixed -> status: closed ->

[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2020-05-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: > The documentation of PyErr_SetObject, PyErr_SetString et al should also be > updated to mention exception chaining. I just posted a PR to do the above: https://github.com/python/cpython/pull/20329 -- ___

[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2020-05-22 Thread Chris Jerdonek
Change by Chris Jerdonek : -- keywords: +patch pull_requests: +19597 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/20329 ___ Python tracker <https://bugs.python.org/issu

[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2020-05-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: I just want to point out one difference between _PyErr_ChainExceptions and PyErr_SetObject that I encountered while working on this issue: https://bugs.python.org/issue40696 While both functions set the context, only PyErr_SetObject does a check to prevent

[issue40696] exception chain cycles cause hangs (was "Exception handling with "await" can hang in Python3.9.0b1")

2020-05-22 Thread Chris Jerdonek
Change by Chris Jerdonek : -- stage: patch review -> needs patch versions: +Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issu

[issue40696] exception chain cycles cause hangs (was "Exception handling with "await" can hang in Python3.9.0b1")

2020-05-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: Good to hear, Mariusz! And thanks for the report! Also, as discussed above, I'm leaving this issue open (and retitling) until the following more general issue is fixed: try: raise RuntimeError except Exception as exc: print(f'handling: {exc!r

[issue40696] Exception handling with "await" can hang in Python3.9.0b1

2020-05-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: New changeset 7f77ac463cff219e0c8afef2611cad5080cc9df1 by Miss Islington (bot) in branch '3.9': bpo-40696: Fix a hang that can arise after gen.throw() (GH-20287) https://github.com/python/cpython/commit/7f77ac463cff219e0c8afef2611cad5080cc9df1

[issue40679] show class name in method invocation TypeError

2020-05-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: > _PyObject_FunctionString as discussed here ( > https://bugs.python.org/issue37645 ) returns a string that also includes the > module name where applicable. By the way, Dennis, regarding the above, one thing I noticed is that Python doesn't

[issue19756] test_nntplib: sporadic failures, network isses? server down?

2020-05-22 Thread Chris Jerdonek
Change by Chris Jerdonek : -- nosy: -chris.jerdonek ___ Python tracker <https://bugs.python.org/issue19756> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19613] test_nntplib: sporadic failures, test_article_head_body()

2020-05-22 Thread Chris Jerdonek
Change by Chris Jerdonek : -- nosy: -chris.jerdonek ___ Python tracker <https://bugs.python.org/issue19613> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40736] better message for re.search TypeError ("expected string or bytes-like object")

2020-05-22 Thread Chris Jerdonek
New submission from Chris Jerdonek : This TypeError could be a bit better: "/Users/runner/runners/2.262.1/work/cpython/cpython/Lib/test/test_nntplib.py", line 293, in test_with_statement if re.search(r'(?i)KEY.TOO.SMALL', ssl_err.reason): File "/Users/runner/runners/2.262

[issue19613] test_nntplib: sporadic failures, test_article_head_body()

2020-05-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: See also: https://bugs.python.org/issue40735 (test_with_statement) -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue19

[issue19756] test_nntplib: sporadic failures, network isses? server down?

2020-05-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: See also: https://bugs.python.org/issue40735 (test_with_statement) -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue19

[issue40735] test_nntplib: sporadic failures, NetworkedNNTP_SSLTests.test_with_statement

2020-05-22 Thread Chris Jerdonek
New submission from Chris Jerdonek : A sporadic failure of test_nntplib.NetworkedNNTP_SSLTests.test_with_statement on the CI for macOS: https://github.com/python/cpython/pull/20321/checks?check_run_id=700729471#step:6:612 See also: * https://bugs.python.org/issue19613 (test_article_head_body

[issue40679] show class name in method invocation TypeError

2020-05-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: Thanks again, Dennis! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue40679] show class name in method invocation TypeError

2020-05-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: New changeset b5cc2089cc354469f12eabc7ba54280e85fdd6dc by Dennis Sweeney in branch 'master': bpo-40679: Use the function's qualname in certain TypeErrors (GH-20236) https://github.com/python/cpython/commit/b5cc2089cc354469f12eabc7ba54280e85fdd6dc

[issue40696] Exception handling with "await" can hang in Python3.9.0b1

2020-05-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: New changeset 7c30d12bd5359b0f66c4fbc98aa055398bcc8a7e by Chris Jerdonek in branch 'master': bpo-40696: Fix a hang that can arise after gen.throw() (GH-20287) https://github.com/python/cpython/commit/7c30d12bd5359b0f66c4fbc98aa055398bcc8a7e

[issue40690] unittest: if FunctionTestCase is imported, the loader loads "tests" from it

2020-05-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: > then you will have 1 extra test in that module (the imported one), moreover, > that test will be broken. If this is true, then how is anyone able to be using FunctionTestCase in their tests today? Is the feature broken? -- nosy: +chris.je

[issue40696] Exception handling with "await" can hang in Python3.9.0b1

2020-05-21 Thread Chris Jerdonek
Chris Jerdonek added the comment: Mariusz, someone may also want to review Django's code there. Raising an exception that would otherwise create a cycle in the chain could be obscuring another issue, or there could be more straightforward alternatives. (The Python issue will still be fixed

[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2020-05-21 Thread Chris Jerdonek
Change by Chris Jerdonek : -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue23188> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40679] show class name in method invocation TypeError

2020-05-21 Thread Chris Jerdonek
Change by Chris Jerdonek : -- components: +Interpreter Core versions: +Python 3.10 -Python 3.9 ___ Python tracker <https://bugs.python.org/issue40679> ___ ___

[issue40696] Exception handling with "await" can hang in Python3.9.0b1

2020-05-21 Thread Chris Jerdonek
Change by Chris Jerdonek : -- components: +Interpreter Core -asyncio title: "await" hangs in Python3.9.0b1. -> Exception handling with "await" can hang in Python3.9.0b1 type: -> behavior versions: +Python 3.10

[issue40696] "await" hangs in Python3.9.0b1.

2020-05-21 Thread Chris Jerdonek
Chris Jerdonek added the comment: Also, I just want to point out one thing about _PyErr_SetObject(). I believe it can detect cycles of arbitrary length (which is what the while loop is for). It's just that it can only detect cycles that involve the first node. So for things to fail

[issue40696] "await" hangs in Python3.9.0b1.

2020-05-21 Thread Chris Jerdonek
Chris Jerdonek added the comment: I just posted a draft PR that implements the narrower fix: https://github.com/python/cpython/pull/20287 I confirmed that the Django test passes with it. I also included two regression tests: one using only generators, and one more like the Django test

[issue40696] "await" hangs in Python3.9.0b1.

2020-05-21 Thread Chris Jerdonek
Change by Chris Jerdonek : -- keywords: +patch pull_requests: +19561 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20287 ___ Python tracker <https://bugs.python.org/issu

[issue40706] Unreachable code in _PyEval_EvalCode

2020-05-21 Thread Chris Jerdonek
Change by Chris Jerdonek : -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue40706> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40679] show class name in method invocation TypeError

2020-05-20 Thread Chris Jerdonek
Chris Jerdonek added the comment: > So maybe the test coverage (or removal?) should be a separate issue. That sounds good. Want to file the issue? -- ___ Python tracker <https://bugs.python.org/issu

[issue40696] "await" hangs in Python3.9.0b1.

2020-05-20 Thread Chris Jerdonek
Chris Jerdonek added the comment: Okay, I'll keep it one issue then. Someone else is still welcome to work on the more general issue. Note that there is some chance the narrower fix should happen independent of the more general fix. This is because _PyErr_ChainExceptions() (which

[issue40696] "await" hangs in Python3.9.0b1.

2020-05-20 Thread Chris Jerdonek
Chris Jerdonek added the comment: >From a process perspective, I think we should probably pursue two PR's for >this: one for the general issue that affects all Python versions (what Yury is >talking about), and something narrower that addresses the 3.9.0b1 case that >came up he

[issue40696] "await" hangs in Python3.9.0b1.

2020-05-20 Thread Chris Jerdonek
Chris Jerdonek added the comment: I don't think that would be a real solution because it looks like that would cause the while loop always to loop at most once (which would defeat its purpose) -- because the loop ends with "o = context": while ((context = PyException_Ge

[issue40696] "await" hangs in Python3.9.0b1.

2020-05-20 Thread Chris Jerdonek
Chris Jerdonek added the comment: The Django details might not matter so much at this point, but to add to something I said above: It might not only be process_exception_by_middleware() as I mentioned, but also asgiref's sync_to_async() function. In that function, you can see an already

[issue40696] "await" hangs in Python3.9.0b1.

2020-05-20 Thread Chris Jerdonek
Chris Jerdonek added the comment: To start out sharing what I found in the Django code: Here inside BaseHandler._get_response_async(): https://github.com/django/django/blob/3460ea49e839fd6bb924c48eaa1cd3d6dc888035/django/core/handlers/base.py#L226-L232 try: response = await

[issue40696] "await" hangs in Python3.9.0b1.

2020-05-20 Thread Chris Jerdonek
Chris Jerdonek added the comment: FWIW, I found that the following hangs, but it also hangs on earlier versions of Python: import traceback try: raise RuntimeError except Exception as exc: print(f'handling: {exc!r}') exc.__context__ = exc print('printing traceback

[issue40696] "await" hangs in Python3.9.0b1.

2020-05-20 Thread Chris Jerdonek
Chris Jerdonek added the comment: I'm getting close to tracking this down. There is a certain point in the code path of the Django test where `exc is exc.__context__` becomes True. I'm guessing this is what's causing the hang. I'll try to get a simple reproducer (there is a lot of Django

[issue40696] "await" hangs in Python3.9.0b1.

2020-05-20 Thread Chris Jerdonek
Change by Chris Jerdonek : -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue40696> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40679] show class name in method invocation TypeError

2020-05-20 Thread Chris Jerdonek
Chris Jerdonek added the comment: Oh, that string is used in even more spots (sorry wasn't looking too closely the first time). -- ___ Python tracker <https://bugs.python.org/issue40

[issue40679] show class name in method invocation TypeError

2020-05-20 Thread Chris Jerdonek
Chris Jerdonek added the comment: Oh, I see now I was hitting a different line: https://github.com/python/cpython/blob/master/Objects/call.c#L1009 Maybe my suggestion is enough to help you (I didn't really look closely at the code), or maybe you were already aware

[issue40679] show class name in method invocation TypeError

2020-05-20 Thread Chris Jerdonek
Chris Jerdonek added the comment: > Or should we be satisfied with the half-measure of including the qualname but > not the module (at least for now)? This is something I was wondering myself, too (also for other contexts). Let's take things one step at a time and limit ourselve

[issue29590] Incorrect stack traces when re-entering a generator/coroutine stack via .throw()

2020-05-19 Thread Chris Jerdonek
Chris Jerdonek added the comment: I just filed a related issue to this that's also similar to issue 29587: https://bugs.python.org/issue40694 -- ___ Python tracker <https://bugs.python.org/issue29

[issue40694] gen.throw() with multiple yield froms skips intermediate exceptions

2020-05-19 Thread Chris Jerdonek
New submission from Chris Jerdonek : Here is another gen.throw() exception chain example similar to the examples in issue 29587: https://bugs.python.org/issue29587 def f(): yield def g(): try: raise RuntimeError('a') except Exception as exc: print(f'handling: {exc

[issue40679] show class name in method invocation TypeError

2020-05-19 Thread Chris Jerdonek
Chris Jerdonek added the comment: Thanks! I think it does. Also, I see now that using the __qualname__ is better than including the object's type for locating the method because you can have cases like super().foo() or even-- class A: def foo(self): pass def bar(): pass

[issue40124] Clearer assertion error

2020-05-19 Thread Chris Jerdonek
Chris Jerdonek added the comment: How about we review Phil's PR, which adds a message to the assertion. And then we can keep this issue open to discuss converting the assertion to an exception. I think Phil's PR is an improvement. -- nosy: +chris.jerdonek

[issue39976] Add "**other_popen_kwargs" to subprocess API signatures in docs

2020-05-19 Thread Chris Jerdonek
Chris Jerdonek added the comment: New changeset 05525fff8a46f4d479cc029e4ea57b35b153f015 by Miss Islington (bot) in branch '3.7': bpo-39976: Add **other_popen_kwargs to subprocess docs (GH-20145) https://github.com/python/cpython/commit/05525fff8a46f4d479cc029e4ea57b35b153f015

[issue39976] Add "**other_popen_kwargs" to subprocess API signatures in docs

2020-05-19 Thread Chris Jerdonek
Chris Jerdonek added the comment: New changeset 257e11cebde6b29177a206abd1e395367799ed42 by Miss Islington (bot) in branch '3.8': bpo-39976: Add **other_popen_kwargs to subprocess docs (GH-20145) https://github.com/python/cpython/commit/257e11cebde6b29177a206abd1e395367799ed42

[issue40679] show class name in method invocation TypeError

2020-05-19 Thread Chris Jerdonek
New submission from Chris Jerdonek : When calling an instance method incorrectly, you will often get a TypeError that is some variation of the following: Traceback (most recent call last): File "/.../test.py", line 6, in a.foo(1) TypeError: foo() takes 1

[issue38306] High level API for loop.run_in_executor(None, ...)?

2020-05-18 Thread Chris Jerdonek
Chris Jerdonek added the comment: Is this issue the same as this one? https://bugs.python.org/issue32309 -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue38

[issue36456] task.cancel unbound recursion

2020-05-18 Thread Chris Jerdonek
Change by Chris Jerdonek : -- nosy: +chris.jerdonek ___ Python tracker <https://bugs.python.org/issue36456> ___ ___ Python-bugs-list mailing list Unsubscribe:

  1   2   3   4   5   6   7   8   9   10   >