[issue39750] UnicodeError becomes unpicklable if data is appended to args

2020-03-01 Thread João Eiras
João Eiras added the comment: On a related note, after inspecting the UnicodeEror C code, the exception object keeps explicit references to 'encoding', 'object', 'start', 'end' and 'reason'. That means that if those properties are set (the C code does have setters) then the properties stored

[issue39750] UnicodeError becomes unpicklable if data is appended to args

2020-02-26 Thread João Eiras
João Eiras added the comment: Hi. It's perfectly fine for classes to have their public APIs and intended uses. But then unpickling would be the worst place to complain, specially when running 40 parallel processes while an unhandled stacktrace appears between a couple hundred thousand lines

[issue39752] multiprocessing halts when child process crashes/quits

2020-02-25 Thread João Eiras
New submission from João Eiras : Hi. When one of the processes in a multiprocessing.pool picks up a task then then somehow crashes (and by crash I mean crashing the python process with something like a SEGV) or is killed, the pool in the main process will notice one of the workers died

[issue39751] multiprocessing breaks when payload fails to unpickle

2020-02-25 Thread João Eiras
Change by João Eiras : -- type: -> crash ___ Python tracker <https://bugs.python.org/issue39751> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue39751] multiprocessing breaks when payload fails to unpickle

2020-02-25 Thread João Eiras
New submission from João Eiras : The multiprocessing module uses pickles to send data between processes. If a blob fails to unpickle (bad implementation of __setstate__, invalid payload from __reduce__, random crash in __init__) when the multiprocessing module will crash inside

[issue39750] UnicodeError becomes unpicklable if data is appended to args

2020-02-25 Thread João Eiras
New submission from João Eiras : Given some exception `ex`, you can append data like ex.args += (value1, value2, ...) and then re-raise. This is something I do in my projects to sometime propagate context when errors are raised, e.g., stacktraces across process boundaries or blobs of text

[issue29036] logging module: Add `full_module_name` to LogRecord details

2019-08-02 Thread João Eiras
João Eiras added the comment: Hi. I ask for this to be reconsidered. The "recommended" approach of using "getLogger(__name__)" comes with some downsides. In my projects I often have many many files (in one particularly I have hundreds) and creating Logger object for eac

[issue9625] argparse: Problem with defaults for variable nargs when using choices

2019-07-12 Thread João Eiras
Change by João Eiras : -- nosy: -João Eiras ___ Python tracker <https://bugs.python.org/issue9625> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9625] argparse: Problem with defaults for variable nargs when using choices

2019-07-12 Thread João Eiras
João Eiras added the comment: Another workaround for who might ever need it. The benefit of this solution comparing to a custom type is that argparse will generate the help string properly with the choices, and this solution does workaround the place when the bug happens: class Choices