[issue28992] Use bytes.fromhex()

STINNER Victor report at bugs.python.org
Wed Dec 21 06:52:52 EST 2016


STINNER Victor added the comment:

Unhappy buildbot:

buildbot.python.org/all/builders/AMD64 Debian root 3.x/builds/103/steps/test/logs/stdio

Example:


======================================================================
ERROR: test_complex_address_list (test.test_email.test_headerregistry.TestAddressHeader)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_email/test_headerregistry.py", line 1243, in test_complex_address_list
    h = self.make_header('to', source)
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_email/test_headerregistry.py", line 78, in make_header
    return self.factory(name, value)
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/email/headerregistry.py", line 586, in __call__
    return self[name](name, value)
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/email/headerregistry.py", line 197, in __new__
    cls.parse(value, kwds)
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/email/headerregistry.py", line 337, in parse
    kwds['parse_tree'] = address_list = cls.value_parser(value)
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/email/headerregistry.py", line 328, in value_parser
    address_list, value = parser.get_address_list(value)
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/email/_header_value_parser.py", line 2336, in get_address_list
    token, value = get_address(value)
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/email/_header_value_parser.py", line 2313, in get_address
    token, value = get_group(value)
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/email/_header_value_parser.py", line 2269, in get_group
    token, value = get_display_name(value)
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/email/_header_value_parser.py", line 2095, in get_display_name
    token, value = get_phrase(value)
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/email/_header_value_parser.py", line 1770, in get_phrase
    token, value = get_word(value)
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/email/_header_value_parser.py", line 1751, in get_word
    token, value = get_atom(value)
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/email/_header_value_parser.py", line 1668, in get_atom
    token, value = get_encoded_word(value)
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/email/_header_value_parser.py", line 1444, in get_encoded_word
    text, charset, lang, defects = _ew.decode('=?' + tok + '?=')
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/email/_encoded_words.py", line 166, in decode
    bstring, defects = _cte_decoders[cte](bstring)
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/email/_encoded_words.py", line 69, in decode_q
    return _q_byte_subber(encoded), []
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/email/_encoded_words.py", line 65, in <lambda>
    lambda m: bytes.fromhex(m.group(1)))
TypeError: fromhex() argument must be str, not bytes

----------
nosy: +haypo
resolution: fixed -> 
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28992>
_______________________________________


More information about the Python-bugs-list mailing list