This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Truncated error message of original function while multiprocessing or multithreading
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: andrei.avk Nosy List: andrei.avk, mrshanth
Priority: normal Keywords:

Created on 2021-06-10 12:27 by mrshanth, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg395529 - (view) Author: Prasanth Rajendran (mrshanth) Date: 2021-06-10 12:27
Under multiprocessing package, in pool.py, when an error occurs on line 122:
result = (True, func(*args, **kwds))

The exception "e" has the error message due to execution of the function that is executed in parallel. 

However, the error message is lost when another error is occurred due to the execution of following line 128:
put((job, i, result))

The MaybeEncodingError masks or truncates the original error message, due to the following line at 130:
MaybeEncodingError(e, result[1])

where the repr function in the class truncates the message. 

The final error message has pickling error and the masked error of the actual execution.
msg408044 - (view) Author: Andrei Kulakov (andrei.avk) * (Python triager) Date: 2021-12-08 21:01
Prasanth: can you provide a bit more details, are you saying that this line:
https://github.com/python/cpython/blob/2109f7880b65755329a877da3a7f8a362de07350/Lib/multiprocessing/pool.py#L86

.. truncates the exception msg? What is the exact exception type that got truncated?

Can you post the exact error output you got here?
History
Date User Action Args
2022-04-11 14:59:46adminsetgithub: 88543
2021-12-08 21:03:19andrei.avksettype: behavior
versions: + Python 3.9, Python 3.10, Python 3.11, - Python 3.7
2021-12-08 21:01:12andrei.avksetassignee: andrei.avk

messages: + msg408044
nosy: + andrei.avk
2021-06-10 12:27:15mrshanthcreate