glyph at divmod.com wrote: > > My preference would be that > > message.headers['Subject'] = b'Some Bytes' > > would simply raise an exception. If you've got some bytes, you should > instead do > > message.bytes_headers['Subject'] = b'Some Bytes' Remind me again why you need to differentiate between headers and bytes_headers? I think bytes headers are evil. If you don't know the encoding when you have one, who does or ever will? > message.headers['Subject'] = Header(bytes=b'Some Bytes', > encoding='utf-8') > > Explicit is better than implicit, right? Indeed, and the case for the above would be to keep indempotence of incoming messages in applications like mailman... ...otherwise we could just decode them and be done with it. cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4