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

Short repeated regex patterns can skip signal handling #109631

Closed
Assignees
serhiy-storchaka
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-regextype-bugAn unexpected behavior, bug, or error
@pan324

Description

@pan324

Bug report

Bug description:

I mentioned regex but this probably applies to other modules as well. In the code below, if the# line right after the findall is commented out (as it is right now), the code raises the exception past the try-except block on theprint("Safely reached EOF.") statement. The exception happens one statement later than expected. NB: I tested all Python versions on Windows but only 3.11 on Linux.

import_thread,refromthreadingimportTimers="ab"*20000000pattern=re.compile("ab+")Timer(0.2,_thread.interrupt_main).start()try:pattern.findall(s)#    print() ###################################################################except:print("Exception block")print("Safely reached EOF.")

CPython versions tested on:

3.9, 3.10, 3.11, 3.12, CPython main branch

Operating systems tested on:

Linux, Windows

Linked PRs

Metadata

Metadata

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-regextype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp