Skip to content

Commit 76ee1b8

Browse files
committed
Fixed a Py3 issue trying run .decode() on (already decoded) str.
- Legacy-Id: 17248
1 parent cb6be1c commit 76ee1b8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

ietf/submit/parsers/plain_parser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright The IETF Trust 2011-2019, All Rights Reserved
1+
# Copyright The IETF Trust 2011-2020, All Rights Reserved
22

33

44
from __future__ import absolute_import, print_function, unicode_literals
@@ -58,16 +58,16 @@ def parse_name(self):
5858
extra_chars = re.sub(r'[0-9a-z\-]', '', name)
5959
if extra_chars:
6060
if len(extra_chars) == 1:
61-
self.parsed_info.add_error(('The document name on the first page, "%s", contains a disallowed character with byte code: %s ' % (name.decode('utf-8','replace'), ord(extra_chars[0]))) +
61+
self.parsed_info.add_error(('The document name on the first page, "%s", contains a disallowed character with byte code: %s ' % (name, ord(extra_chars[0]))) +
6262
'(see https://www.ietf.org/id-info/guidelines.html#naming for details).')
6363
else:
64-
self.parsed_info.add_error(('The document name on the first page, "%s", contains disallowed characters with byte codes: %s ' % (name.decode('utf-8','replace'), (', '.join([ str(ord(c)) for c in extra_chars] )))) +
64+
self.parsed_info.add_error(('The document name on the first page, "%s", contains disallowed characters with byte codes: %s ' % (name, (', '.join([ str(ord(c)) for c in extra_chars] )))) +
6565
'(see https://www.ietf.org/id-info/guidelines.html#naming for details).')
6666
match_revision = revisionre.match(name)
6767
if match_revision:
6868
self.parsed_info.metadata.rev = match_revision.group(1)
6969
else:
70-
self.parsed_info.add_error('The name found on the first page of the document does not contain a revision: "%s"' % (name.decode('utf-8','replace'),))
70+
self.parsed_info.add_error('The name found on the first page of the document does not contain a revision: "%s"' % (name,))
7171
name = re.sub(r'-\d+$', '', name)
7272
self.parsed_info.metadata.name = name
7373
return

0 commit comments

Comments
 (0)