Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3k
Changeset: r58408:3b8a6e70f232
Date: 2012-10-24 22:02 +0200
http://bitbucket.org/pypy/pypy/changeset/3b8a6e70f232/

Log:    Skip an implementation detail, and cherry-pick change for CPython
        Issue #14177 that is not yet released and that PyPy already
        implements (marshal.loads rejects unicode strings)

diff --git a/lib-python/3.2/test/test_marshal.py 
b/lib-python/3.2/test/test_marshal.py
--- a/lib-python/3.2/test/test_marshal.py
+++ b/lib-python/3.2/test/test_marshal.py
@@ -162,9 +162,10 @@
                 pass
 
     def test_loads_recursion(self):
-        s = 'c' + ('X' * 4*4) + '{' * 2**20
+        s = b'c' + (b'X' * 4*4) + b'{' * 2**20
         self.assertRaises(ValueError, marshal.loads, s)
 
+    @test_support.impl_detail('specific recursion check')
     def test_recursion_limit(self):
         # Create a deeply nested structure.
         head = last = []
@@ -235,6 +236,11 @@
             finally:
                 support.unlink(support.TESTFN)
 
+    def test_loads_reject_unicode_strings(self):
+        # Issue #14177: marshal.loads() should not accept unicode strings
+        unicode_string = 'T'
+        self.assertRaises(TypeError, marshal.loads, unicode_string)
+
 
 def test_main():
     support.run_unittest(IntTestCase,
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to