diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-10-25 17:40:09 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-10-25 17:40:09 -0400 |
commit | c370442bea855f0f87217db190760629fe559150 (patch) | |
tree | 3fc7a69e49849c5d95f5ee3c3163cdede38cec45 /coverage/parser.py | |
parent | 2825bdb540f1b14ae9855e57ecb0b1e4d1098894 (diff) | |
download | python-coveragepy-c370442bea855f0f87217db190760629fe559150.tar.gz |
Properly handle filenames with non-ASCII characters. #432
Diffstat (limited to 'coverage/parser.py')
-rw-r--r-- | coverage/parser.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/coverage/parser.py b/coverage/parser.py index 882c972..a5e9623 100644 --- a/coverage/parser.py +++ b/coverage/parser.py @@ -211,7 +211,7 @@ class PythonParser(object): else: lineno = err.args[1][0] # TokenError raise NotPython( - "Couldn't parse '%s' as Python source: '%s' at line %d" % ( + u"Couldn't parse '%s' as Python source: '%s' at line %d" % ( self.filename, err.args[0], lineno ) ) @@ -338,7 +338,7 @@ class ByteParser(object): self.code = compile_unicode(text, filename, "exec") except SyntaxError as synerr: raise NotPython( - "Couldn't parse '%s' as Python source: '%s' at line %d" % ( + u"Couldn't parse '%s' as Python source: '%s' at line %d" % ( filename, synerr.msg, synerr.lineno ) ) |