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 sometimes incrementally indents traceback lines #131968

Open
Labels
stdlibPython modules in the Lib dirtopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error
@picnixz

Description

@picnixz

Bug report

Bug description:

The reproducer I found comes from#84376 and it was entirely by chance that I stumbled upon the REPL issue itself. I don't know if it's because we're usingmultiprocessing or if it's because the exception is in another thread or process, or if it's again something else.

Python3.14.0a6+ (heads/main:3b3720f1a26,Apr12025,10:14:27) [GCC7.5.0]onlinuxType"help","copyright","credits"or"license"formoreinformation.>>>importmultiprocessing...q=multiprocessing.Queue()...try:...q.put(lambda:None)...print("Success!")...exceptException:...print("Failure")...Success!>>>AttributeError:module'__main__'hasnoattribute'<lambda>'Duringhandlingoftheaboveexception,anotherexceptionoccurred:Traceback (mostrecentcalllast):File"/$HOME/lib/python/cpython/Lib/multiprocessing/queues.py",line262,in_feedobj=_ForkingPickler.dumps(obj)File"/$HOME/lib/python/cpython/Lib/multiprocessing/reduction.py",line51,indumpscls(buf,protocol).dump(obj)~~~~~~~~~~~~~~~~~~~~~~~^^^^^_pickle.PicklingError:Can't pickle <function <lambda> at 0x7f1410a13a10>: it'snotfoundas__main__.<lambda>KeyboardInterrupt>>>

In the old REPL, the traceback is properly shown.

Python3.14.0a6+ (heads/main:3b3720f1a26,Apr12025,10:14:27) [GCC7.5.0]onlinuxType"help","copyright","credits"or"license"formoreinformation.>>>importmultiprocessing>>>q=multiprocessing.Queue()>>>try:...q.put(lambda:None)...print("Success!")...exceptException:...print("Failure")...Success!>>>AttributeError:module'__main__'hasnoattribute'<lambda>'Duringhandlingoftheaboveexception,anotherexceptionoccurred:Traceback (mostrecentcalllast):File"/$HOME/lib/python/cpython/Lib/multiprocessing/queues.py",line262,in_feedobj=_ForkingPickler.dumps(obj)File"/$HOME/lib/python/cpython/Lib/multiprocessing/reduction.py",line51,indumpscls(buf,protocol).dump(obj)~~~~~~~~~~~~~~~~~~~~~~~^^^^^_pickle.PicklingError:Can't pickle <function <lambda> at 0x7f2119283350>: it'snotfoundas__main__.<lambda>>>>

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtopic-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