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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Chris Jerdonek added the comment:
Last question: might trying different values of PYTHONHASHSEED help?
--
___
Python tracker
<https://bugs.python.org/issue44
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://
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
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
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.
--
___
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
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
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
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
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
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
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
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
Change by Chris Jerdonek :
--
nosy: +chris.jerdonek
___
Python tracker
<https://bugs.python.org/issue44112>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
Change by Chris Jerdonek :
--
nosy: +chris.jerdonek
___
Python tracker
<https://bugs.python.org/issue31212>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
Change by Chris Jerdonek :
--
nosy: +chris.jerdonek
___
Python tracker
<https://bugs.python.org/issue42130>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Chris Jerdonek :
--
pull_requests: +21719
pull_request: https://github.com/python/cpython/pull/22756
___
Python tracker
<https://bugs.python.org/issue38
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
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
Change by Chris Jerdonek :
--
title: Add re.replace(string, replacement_map) -> Add
str.replace(replacement_map)
___
Python tracker
<https://bugs.python.org/issu
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
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
Change by Chris Jerdonek :
--
nosy: +chris.jerdonek
___
Python tracker
<https://bugs.python.org/issue40932>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Chris Jerdonek :
--
nosy: +chris.jerdonek
___
Python tracker
<https://bugs.python.org/issue31213>
___
___
Python-bugs-list mailing list
Unsubscribe:
Chris Jerdonek added the comment:
Thanks a lot, Victor.
--
___
Python tracker
<https://bugs.python.org/issue40679>
___
___
Python-bugs-list mailing list
Unsub
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
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
Change by Chris Jerdonek :
--
nosy: +chris.jerdonek
___
Python tracker
<https://bugs.python.org/issue25782>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
Change by Chris Jerdonek :
--
nosy: +chris.jerdonek
___
Python tracker
<https://bugs.python.org/issue34852>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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 ->
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
--
___
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
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
Change by Chris Jerdonek :
--
stage: patch review -> needs patch
versions: +Python 3.7, Python 3.8
___
Python tracker
<https://bugs.python.org/issu
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
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
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
Change by Chris Jerdonek :
--
nosy: -chris.jerdonek
___
Python tracker
<https://bugs.python.org/issue19756>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Chris Jerdonek :
--
nosy: -chris.jerdonek
___
Python tracker
<https://bugs.python.org/issue19613>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
Chris Jerdonek added the comment:
Thanks again, Dennis!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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
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
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
Change by Chris Jerdonek :
--
nosy: +chris.jerdonek
___
Python tracker
<https://bugs.python.org/issue23188>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Chris Jerdonek :
--
components: +Interpreter Core
versions: +Python 3.10 -Python 3.9
___
Python tracker
<https://bugs.python.org/issue40679>
___
___
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
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
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
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
Change by Chris Jerdonek :
--
nosy: +chris.jerdonek
___
Python tracker
<https://bugs.python.org/issue40706>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
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
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
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
Change by Chris Jerdonek :
--
nosy: +chris.jerdonek
___
Python tracker
<https://bugs.python.org/issue40696>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
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
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
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
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
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
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
Change by Chris Jerdonek :
--
nosy: +chris.jerdonek
___
Python tracker
<https://bugs.python.org/issue36456>
___
___
Python-bugs-list mailing list
Unsubscribe:
1 - 100 of 1574 matches
Mail list logo