Mikael Koli added the comment:
It seems the message's policy is actually used. However, the mangle_from_ is
still always True as the policy is not passed in the initiation of the
generator. It seems though that all the options I mentioned could still make
the mangle_from_ to be chang
New submission from Mikael Koli :
The method smtplib.SMTP.send_message does not use the message's Policy if all
of the from_addrs or to_addrs are not international. See:
https://github.com/python/cpython/blob/v3.10.3/Lib/smtplib.py#L983 (unchanged
in current main)
Mikael Koli added the comment:
I did subclass the QueueHandler and it did circumvent the issue for me. But
after spending some time to find out why I could not access the exc_text I
thought maybe there is something that could be done to make it more intuitive
and save others' time. I
Mikael Koli added the comment:
And the reason why overriding attribute 'record.msg' with the formatted message
is problematic is that the method 'record.getMessage' (which is used by
Formatter) fetches the log message from the variable 'record.msg'. Therefore
t
New submission from Mikael Koli :
The reason why logging.handlers.QueueHandler does not maintain exc_text is
obvious:
def prepare(self, record):
...
record = copy.copy(record)
record.message = msg
record.msg = msg
record.args = None