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

New repl closes CLI session on SyntaxError inside of the match statement #119555

Closed
Labels
3.13bugs and security fixes3.14bugs and security fixestopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error
@skirpichev

Description

@skirpichev

Bug report

Bug description:

>>> match1:...     case {0: _,0j: _}:...passTraceback (most recent call last):  File "<frozen runpy>", line 198, in _run_module_as_main  File "<frozen runpy>", line 88, in _run_code  File "/home/sk/src/cpython/Lib/_pyrepl/__main__.py", line 47, in <module>    interactive_console()    ~~~~~~~~~~~~~~~~~~~^^  File "/home/sk/src/cpython/Lib/_pyrepl/__main__.py", line 44, in interactive_console    return run_interactive(mainmodule)  File "/home/sk/src/cpython/Lib/_pyrepl/simple_interact.py", line 176, in run_multiline_interactive_console    more = console.push(_strip_final_indent(statement), filename=input_name, _symbol="single")  # type: ignore[call-arg]  File "/home/sk/src/cpython/Lib/code.py", line 303, in push    more = self.runsource(source, filename, symbol=_symbol)  File "/home/sk/src/cpython/Lib/_pyrepl/simple_interact.py", line 98, in runsource    code = compile(item, filename, the_symbol)  File "<python-input-0>", line 2SyntaxError: mapping pattern checks duplicate key (0j)

At that point I'm in the system shell...

C.f.:

>>>deff():...raiseValueError("boo!")...     >>> f()Traceback (most recent call last):  File "<python-input-1>", line 1, in <module>    f()    ~^^  File "<python-input-0>", line 2, in f    raise ValueError("boo!")ValueError: boo!>>>3.to_bytes()  File "<unknown>", line 1    3.to_bytes()     ^SyntaxError: invalid decimal literal

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixestopic-replRelated to the interactive shelltype-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