summaryrefslogtreecommitdiff
path: root/scanner.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2019-02-27 22:23:14 +0100
committerAnthon van der Neut <anthon@mnt.org>2019-02-27 22:23:14 +0100
commit17af0e7a084955b5c0bf4124bba87190ac16734d (patch)
tree99a390343fd3cc141278c5768e9cbfd15778ebba /scanner.py
parent1fa26ba7438db4edcd6f7748dd7cf2ec3a00c241 (diff)
downloadruamel.yaml-17af0e7a084955b5c0bf4124bba87190ac16734d.tar.gz
fix issue #280 namedtuple erorring in error generation on safe_dump
*When this change indeed resolves your problem, please **Close** this issue*. *(You can do so using the WorkFlow pull-down (close to the top right of this page))*
Diffstat (limited to 'scanner.py')
-rw-r--r--scanner.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/scanner.py b/scanner.py
index 1296160..1967a56 100644
--- a/scanner.py
+++ b/scanner.py
@@ -1065,7 +1065,7 @@ class Scanner(object):
ch = srp(length)
if not length:
raise ScannerError(
- 'while scanning an %s' % name,
+ 'while scanning an %s' % (name,),
start_mark,
'expected alphabetic or numeric character, but found %r' % utf8(ch),
self.reader.get_mark(),
@@ -1077,7 +1077,7 @@ class Scanner(object):
# assert ch1 == ch
if ch not in '\0 \t\r\n\x85\u2028\u2029?:,[]{}%@`':
raise ScannerError(
- 'while scanning an %s' % name,
+ 'while scanning an %s' % (name,),
start_mark,
'expected alphabetic or numeric character, but found %r' % utf8(ch),
self.reader.get_mark(),
@@ -1638,7 +1638,7 @@ class Scanner(object):
ch = srp()
if ch != '!':
raise ScannerError(
- 'while scanning a %s' % name,
+ 'while scanning a %s' % (name,),
start_mark,
"expected '!', but found %r" % utf8(ch),
self.reader.get_mark(),
@@ -1652,7 +1652,7 @@ class Scanner(object):
if ch != '!':
self.reader.forward(length)
raise ScannerError(
- 'while scanning a %s' % name,
+ 'while scanning a %s' % (name,),
start_mark,
"expected '!', but found %r" % utf8(ch),
self.reader.get_mark(),
@@ -1690,7 +1690,7 @@ class Scanner(object):
length = 0
if not chunks:
raise ScannerError(
- 'while parsing a %s' % name,
+ 'while parsing a %s' % (name,),
start_mark,
'expected URI, but found %r' % utf8(ch),
self.reader.get_mark(),
@@ -1709,7 +1709,7 @@ class Scanner(object):
for k in range(2):
if srp(k) not in '0123456789ABCDEFabcdef':
raise ScannerError(
- 'while scanning a %s' % name,
+ 'while scanning a %s' % (name,),
start_mark,
'expected URI escape sequence of 2 hexdecimal numbers,'
' but found %r' % utf8(srp(k)),
@@ -1726,7 +1726,7 @@ class Scanner(object):
else:
value = unicode(b"".join(code_bytes), 'utf-8')
except UnicodeDecodeError as exc:
- raise ScannerError('while scanning a %s' % name, start_mark, str(exc), mark)
+ raise ScannerError('while scanning a %s' % (name,), start_mark, str(exc), mark)
return value
def scan_line_break(self):