Author: Tyler Wade <[email protected]>
Branch: utf8-unicode2
Changeset: r72721:3a4bfe6c37ee
Date: 2014-08-08 22:00 -0500
http://bitbucket.org/pypy/pypy/changeset/3a4bfe6c37ee/
Log: Explictly check for negative codepoints
diff --git a/pypy/interpreter/utf8.py b/pypy/interpreter/utf8.py
--- a/pypy/interpreter/utf8.py
+++ b/pypy/interpreter/utf8.py
@@ -642,7 +642,9 @@
def append_codepoint(self, c):
- if c < 0x80:
+ if c < 0:
+ raise ValueError("Invalid unicode codepoint < 0.")
+ elif c < 0x80:
self._builder.append(chr(c))
elif c < 0x800:
self._builder.append(chr(0xC0 | (c >> 6)))
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit