[issue44924] logging.handlers.QueueHandler does not maintain the exc_text

2021-08-16 Thread Mikael Koli
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

[issue44924] logging.handlers.QueueHandler does not maintain the exc_text

2021-08-16 Thread Mikael Koli
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 the exc_text needs to be set

[issue44924] logging.handlers.QueueHandler does not maintain the exc_text

2021-08-16 Thread Mikael Koli
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 find

[issue47047] smtplib: allow custom policy or use msg.policy in send_message

2022-03-17 Thread Mikael Koli
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 changeable

[issue47047] smtplib: allow custom policy or use msg.policy in send_message

2022-03-17 Thread Mikael Koli
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