[Python-checkins] r71847 - in python/trunk: Lib/ctypes/test/test_pickling.py Misc/NEWS Modules/_ctypes/_ctypes.c

thomas.heller python-checkins at python.org
Fri Apr 24 22:00:41 CEST 2009


Author: thomas.heller
Date: Fri Apr 24 22:00:41 2009
New Revision: 71847

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


Modified:
   python/trunk/Lib/ctypes/test/test_pickling.py
   python/trunk/Misc/NEWS
   python/trunk/Modules/_ctypes/_ctypes.c

Modified: python/trunk/Lib/ctypes/test/test_pickling.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_pickling.py	(original)
+++ python/trunk/Lib/ctypes/test/test_pickling.py	Fri Apr 24 22:00:41 2009
@@ -66,6 +66,11 @@
             ]:
             self.assertRaises(ValueError, lambda: self.dumps(item))
 
+    def test_wchar(self):
+        pickle.dumps(c_char("x"))
+        # Issue 5049
+        pickle.dumps(c_wchar(u"x"))
+
 class PickleTest_1(PickleTest):
     def dumps(self, item):
         return pickle.dumps(item, 1)

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Fri Apr 24 22:00:41 2009
@@ -244,6 +244,8 @@
 Library
 -------
 
+- Issue #5041: ctypes does now allow pickling wide character.
+
 - Issue #5812: For the two-argument form of the Fraction constructor,
   Fraction(m, n), m and n are permitted to be arbitrary Rational
   instances.

Modified: python/trunk/Modules/_ctypes/_ctypes.c
==============================================================================
--- python/trunk/Modules/_ctypes/_ctypes.c	(original)
+++ python/trunk/Modules/_ctypes/_ctypes.c	Fri Apr 24 22:00:41 2009
@@ -1952,7 +1952,7 @@
 			ml = &c_void_p_method;
 			stgdict->flags |= TYPEFLAG_ISPOINTER;
 			break;
-		case 'u':
+		case 's':
 		case 'X':
 		case 'O':
 			ml = NULL;


More information about the Python-checkins mailing list