diff options
author | xi <xi@18f92427-320e-0410-9341-c67f048884a3> | 2008-12-28 20:41:41 +0000 |
---|---|---|
committer | xi <xi@18f92427-320e-0410-9341-c67f048884a3> | 2008-12-28 20:41:41 +0000 |
commit | 3d554c8abd6c7990948d13b110ac732cfb3d68c9 (patch) | |
tree | b4f76fe9f141441a2a8d49c5b7fec00a6dcb548b | |
parent | 4691639907112004c7242215370d8b42ffec3e5b (diff) | |
download | pyyaml-3d554c8abd6c7990948d13b110ac732cfb3d68c9.tar.gz |
Fixed an issue with ReaderError generated by the LibYAML wrapper.
git-svn-id: http://svn.pyyaml.org/pyyaml/trunk@323 18f92427-320e-0410-9341-c67f048884a3
-rw-r--r-- | lib/yaml/reader.py | 4 | ||||
-rw-r--r-- | tests/data/invalid-utf8-byte.loader-error | 34 |
2 files changed, 19 insertions, 19 deletions
diff --git a/lib/yaml/reader.py b/lib/yaml/reader.py index 1d4667c..1e7a4db 100644 --- a/lib/yaml/reader.py +++ b/lib/yaml/reader.py @@ -74,7 +74,7 @@ class ReaderError(YAMLError): else: return "unacceptable character #x%04x: %s\n" \ " in \"%s\", position %d" \ - % (ord(self.character), self.reason, + % (self.character, self.reason, self.name, self.position) class Reader(object): @@ -175,7 +175,7 @@ class Reader(object): if match: character = match.group() position = self.index+(len(self.buffer)-self.pointer)+match.start() - raise ReaderError(self.name, position, character, + raise ReaderError(self.name, position, ord(character), 'unicode', "special characters are not allowed") def update(self, length): diff --git a/tests/data/invalid-utf8-byte.loader-error b/tests/data/invalid-utf8-byte.loader-error index 15111c3..02b1605 100644 --- a/tests/data/invalid-utf8-byte.loader-error +++ b/tests/data/invalid-utf8-byte.loader-error @@ -1,18 +1,18 @@ -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- +*************************************************************** +*************************************************************** +*************************************************************** +*************************************************************** +*************************************************************** +*************************************************************** +*************************************************************** +*************************************************************** +*************************************************************** +*************************************************************** +*************************************************************** +*************************************************************** +*************************************************************** +*************************************************************** +*************************************************************** +*************************************************************** Invalid byte ('\xFF'): ÿ <-- -------------------------------------------------------------------------------------------------------------------------------- +*************************************************************** |