Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-111085 Fix logic order causing nicer error to never be raised in asyncio.Timeout#110910

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Gobot1234 wants to merge4 commits intopython:mainfromGobot1234:patch-3

Conversation

@Gobot1234
Copy link
Contributor

@Gobot1234Gobot1234 commentedOct 15, 2023
edited
Loading

I don't think this needs a news entry or an issue

@Gobot1234Gobot1234 changed the titleFix logic order causing nicer error to never be raisedFix logic order causing nicer error to never be raised in asyncio.TimeoutOct 15, 2023
Copy link
Contributor

@hauntsaninjahauntsaninja left a comment
edited
Loading

Choose a reason for hiding this comment

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

Thanks for fixing this! However, it does need a NEWS entry since exception type change is user visible behaviour

@Gobot1234
Copy link
ContributorAuthor

@hauntsaninja does this also need an issue then?

@AlexWaygood
Copy link
Member

AlexWaygood commentedOct 19, 2023
edited
Loading

@hauntsaninja does this also need an issue then?

Yeah, it's not possible to add a news entry without linking the news entry to a GitHub issue.

(Or, shouldn't be possible, anyway, since the news entry is meant to be linked to an issue :p )

Gobot1234 reacted with laugh emoji

@Gobot1234Gobot1234 changed the titleFix logic order causing nicer error to never be raised in asyncio.Timeoutgh-111085 Fix logic order causing nicer error to never be raised in asyncio.TimeoutOct 19, 2023
Copy link
Member

@Eclips4Eclips4 left a comment

Choose a reason for hiding this comment

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

LGTM. Should it be backported to 3.12?

@Gobot1234
Copy link
ContributorAuthor

Turns out the bug exists on 3.11 as well

Eclips4 reacted with thumbs up emoji

@Eclips4Eclips4 added needs backport to 3.11only security fixes needs backport to 3.12only security fixes labelsOct 19, 2023
@hauntsaninja
Copy link
Contributor

hauntsaninja commentedOct 20, 2023
edited
Loading

I think this probably should not be backported. This effectively just changes a bad error message to a good one and has a chance of breaking code, so doesn't feel like good cost benefit.

Thanks again, I see Serhiy self requested review, so will wait for that before merging.

Eclips4 and AlexWaygood reacted with thumbs up emoji

@hauntsaninjahauntsaninja removed needs backport to 3.11only security fixes needs backport to 3.12only security fixes labelsOct 20, 2023
serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull requestOct 20, 2023
asyncio.TaskGroup and asyncio.Timeout classes now raise proper RuntimeErrorif they are improperly used.* When they are used without entering the context manager.* When they are used after finishing.* When the context manager is entered more than once (simultaneously or  sequentially).* If there is no current task when entering the context manager.They are now left in consistent state after raising an exception, sofollowing operations can be correctly performed (if they are allowed).
serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull requestOct 20, 2023
asyncio.TaskGroup and asyncio.Timeout classes now raise proper RuntimeErrorif they are improperly used.* When they are used without entering the context manager.* When they are used after finishing.* When the context manager is entered more than once (simultaneously or  sequentially).* If there is no current task when entering the context manager.They are now left in consistent state after raising an exception, sofollowing operations can be correctly performed (if they are allowed).Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull requestOct 20, 2023
asyncio.TaskGroup and asyncio.Timeout classes now raise proper RuntimeErrorif they are improperly used.* When they are used without entering the context manager.* When they are used after finishing.* When the context manager is entered more than once (simultaneously or  sequentially).* If there is no current task when entering the context manager.They are now left in consistent state after raising an exception, sofollowing operations can be correctly performed (if they are allowed).Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
@Gobot1234
Copy link
ContributorAuthor

Closing in favour of#111111

@serhiy-storchaka
Copy link
Member

While this change fixes an AttributeError in__enter__(), it left the object in inconsistent state, so other AttributeError can be raised in specific circumferences in other place. There are also other issues in the current code. It makes sense to fix them all at once.

In any case, thank you for your contribution. I included your changes in the other PR and added you as a co-author.

Gobot1234 reacted with heart emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@Eclips4Eclips4Eclips4 approved these changes

@hauntsaninjahauntsaninjahauntsaninja approved these changes

@1st11st1Awaiting requested review from 1st11st1 is a code owner

@asvetlovasvetlovAwaiting requested review from asvetlovasvetlov is a code owner

@gvanrossumgvanrossumAwaiting requested review from gvanrossum

@kumaraditya303kumaraditya303Awaiting requested review from kumaraditya303kumaraditya303 is a code owner

@willingcwillingcAwaiting requested review from willingcwillingc is a code owner

@serhiy-storchakaserhiy-storchakaAwaiting requested review from serhiy-storchaka

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@Gobot1234@AlexWaygood@hauntsaninja@serhiy-storchaka@Eclips4

[8]ページ先頭

©2009-2025 Movatter.jp