Skip to content
Snippets Groups Projects
Commit a82f7fcf authored by Damian Johnson's avatar Damian Johnson
Browse files

Python3 regression when reading descriptors

Oops! Recent commit broke all descriptor parsing for python3, caught by
toralf...

  https://trac.torproject.org/projects/tor/ticket/18658
parent 878f90cc
Branches
Tags
No related merge requests found
......@@ -861,7 +861,7 @@ def _get_descriptor_components(raw_contents, validate, extra_keywords = (), non_
if validate and keyword not in non_ascii_fields:
try:
value.decode('ascii')
value.encode('ascii')
except UnicodeError:
replaced = ''.join([(char if char in string.printable else '?') for char in value])
raise ValueError("'%s' line had non-ascii content: %s" % (keyword, replaced))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment