Author: Tyler Wade <[email protected]>
Branch: utf8-unicode2
Changeset: r72729:31e5deb73708
Date: 2014-08-09 04:04 -0500
http://bitbucket.org/pypy/pypy/changeset/31e5deb73708/

Log:    Fix crash when using an incomplete format specific (ie u'%(foo' %
        {})

diff --git a/pypy/interpreter/utf8.py b/pypy/interpreter/utf8.py
--- a/pypy/interpreter/utf8.py
+++ b/pypy/interpreter/utf8.py
@@ -50,6 +50,9 @@
     return res
 
 def utf8ord(ustr, start=0):
+    if start >= len(ustr):
+        raise IndexError()
+
     start = ustr.index_of_char(start)
     return utf8ord_bytes(ustr.bytes, start)
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to