summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-03-12 17:17:58 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-03-12 17:17:58 (GMT)
commit624dbf622059250872db3f606066f90ecb7d8786 (patch)
treedc282c62b834f70c20dce18abec79b465eccf9d0 /Lib
parent3f1af5c42e915775e9cc32224e090b05430a23de (diff)
downloadcpython-624dbf622059250872db3f606066f90ecb7d8786.zip
cpython-624dbf622059250872db3f606066f90ecb7d8786.tar.gz
cpython-624dbf622059250872db3f606066f90ecb7d8786.tar.bz2
Issue #6697: catch _PyUnicode_AsString() errors in getattr() and setattr()
builtin functions.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_builtin.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index b4bdf11..5d24000 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -479,6 +479,8 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(TypeError, getattr, sys, 1, "foo")
self.assertRaises(TypeError, getattr)
self.assertRaises(AttributeError, getattr, sys, chr(sys.maxunicode))
+ # unicode surrogates are not encodable to the default encoding (utf8)
+ self.assertRaises(AttributeError, getattr, 1, "\uDAD1\uD51E")
def test_hasattr(self):
import sys