[issue43333] utf8 in BytesGenerator

2022-02-24 Thread Chris
Chris added the comment: found this issue while googling the error. Also having the same problem with as_bytes() breaking on non-ascii characters. I've tried policy=policy.default.clone(utf8=True) but it gives the same error. My sample.py file attached contains a string sample email -

[issue43333] utf8 in BytesGenerator

2022-01-24 Thread R. David Murray
R. David Murray added the comment: Yeah, I think we need a complete example here. Note that in the general case there is no such thing as an RFC-valid email in unicode (which is what python strings are), though with utf8=True and an email involving only text you might get away with it. I

[issue43333] utf8 in BytesGenerator

2022-01-24 Thread Irit Katriel
Irit Katriel added the comment: Are you able to provide a runnable script that reproduces the error? -- nosy: +iritkatriel type: crash -> behavior ___ Python tracker ___

[issue43333] utf8 in BytesGenerator

2021-02-26 Thread Darcy Beurle
New submission from Darcy Beurle : I have some emails that I'm importing from an XML format according to rfc822. Some of these have some encoding other than ascii. I create the message with the default policy: message = email.message_from_string( # Extract text from