Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Open
Description
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