Mercurial > hg
comparison hgdemandimport/demandimportpy3.py @ 37469:7edf68862fe3
py3: work around weird handling of bytes/unicode in decode_header()
Basically decode_header() works as follows, and on Python 3, email headers
ARE UNICODE.
def decode_header(header):
if not ecre.search(header): # ecre is unicode regexp
return [(header, None)] # so header is unicode string
... decode header into [(bytes_data, unicode_charset_name)]
return collapsed
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 08 Apr 2018 15:22:30 +0900 |
parents | fcb1ecf2bef7 |
children | 670eb4fa1b86 |
comparison
equal
deleted
inserted
replaced
37468:ef661ce45cdb | 37469:7edf68862fe3 |
---|