diff options
| author | Damian Johnson <atagar@torproject.org> | 2016-03-27 13:08:28 -0700 |
|---|---|---|
| committer | Damian Johnson <atagar@torproject.org> | 2016-03-27 13:08:28 -0700 |
| commit | a82f7fcfd08174d6edbbb7d120a28ea2d478eea1 (patch) | |
| tree | 9c001f42769bf7ea64dac4a54d36a7d324d9adec | |
| parent | 878f90cc3aba39fe86f762ef15bac9f848938f4b (diff) | |
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
| -rw-r--r-- | stem/descriptor/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/stem/descriptor/__init__.py b/stem/descriptor/__init__.py index 65e6ed4a..05c6087a 100644 --- a/stem/descriptor/__init__.py +++ b/stem/descriptor/__init__.py @@ -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)) |
