tests: add a substitution pattern for HTTP error log dates
This will make tests with error log content less of a nuisance. I didn't roll
it into to $LOGDATE$ because the regex got long and line wrapped. It didn't
seem worth the obscurity.
wireproto: convert python literal to object without using unsafe eval()
Follows up
cc5a040fe150.
At this point, I don't think we need a real eval(). If we want to support
a set literal, maybe we can vendor ast.literal_eval(), which is relatively
simple function.
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