wireproto: show unknown id and flags in repr(frame)
Perhaps we'll want it for debugging.
wireproto: fix repr(frame) to not crash by unknown type id
Follows up
5ef2da00e935.
py3: use s.startswith() instead of s[n] while parsing patches
I know 'bytes[n] in bytes' magically works, but I'm tired of finding which
one breaks the tests.
py3: do not try to byte-stringify None in cmdutil.tryimportone()
It's a debug message, so just use '' instead.
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
py3: fix string issues of email message in test-import.t
- payload can be bytes
- headers must be unicode on Python 3
- need to call msg.as_bytes() on Python 3, but msg.as_string() on Python 2,
where bytes(msg) magic works