]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 71848 via svnmerge from
authorThomas Heller <theller@ctypes.org>
Fri, 24 Apr 2009 20:09:23 +0000 (20:09 +0000)
committerThomas Heller <theller@ctypes.org>
Fri, 24 Apr 2009 20:09:23 +0000 (20:09 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r71848 | thomas.heller | 2009-04-24 22:05:20 +0200 (Fr, 24 Apr 2009) | 9 lines

  Merged revisions 71847 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r71847 | thomas.heller | 2009-04-24 22:00:41 +0200 (Fr, 24 Apr 2009) | 2 lines

    Issue 5041: ctypes unwilling to allow pickling wide character.
  ........
................

Lib/ctypes/test/test_pickling.py
Misc/NEWS
Modules/_ctypes/_ctypes.c

index 94a14b97bd9d182a3e5c8c7d765a2afedd0dd9ac..d88f08b9f0849a5490e6de95346b2302967870da 100644 (file)
@@ -66,6 +66,11 @@ class PickleTest(unittest.TestCase):
             ]:
             self.assertRaises(ValueError, lambda: self.dumps(item))
 
+    def test_wchar(self):
+        pickle.dumps(c_char(b"x"))
+        # Issue 5049
+        pickle.dumps(c_wchar("x"))
+
 class PickleTest_1(PickleTest):
     def dumps(self, item):
         return pickle.dumps(item, 1)
index 34d41e6357dc30d24427f1a20b1fbcb18829330a..f867d84700d7be4d7a49a6334e04e1ec2b7cdcd2 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -230,6 +230,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #5041: ctypes does now allow pickling wide character.
+
 - Issue #5731: Distutils bdist_wininst no longer worked on non-Windows 
   platforms. Initial patch by Paul Moore.
 
index 69a8c731b0fd07c9929ca17ab9c3767820dc09f2..5fedba30088d0456cc6ae819ba206f9737e67d52 100644 (file)
@@ -1927,7 +1927,7 @@ SimpleType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
                        ml = &c_void_p_method;
                        stgdict->flags |= TYPEFLAG_ISPOINTER;
                        break;
-               case 'u':
+               case 's':
                case 'X':
                case 'O':
                        ml = NULL;