diff Python/modsupport.c @ 42305:d0719406b2c6

Change Py_BuildValue to generate Unicode objects for 's' and 'c' codes. Change pickle to dump bytes objects using the 'S' code, and to load the 'S' code as byte objects. Change datetime and array to generate and expect bytes objects in reduce/unreduce.
author Martin v. Löwis <martin@v.loewis.de>
date Wed, 18 Jul 2007 02:28:27 +0000
parents 1f7b66a9ffb0
children 0fcc18aba385
line wrap: on
line diff
--- a/Python/modsupport.c	Tue Jul 17 20:59:35 2007 +0000
+++ b/Python/modsupport.c	Wed Jul 18 02:28:27 2007 +0000
@@ -387,7 +387,7 @@
 		{
 			char p[1];
 			p[0] = (char)va_arg(*p_va, int);
-			return PyString_FromStringAndSize(p, 1);
+			return PyUnicode_FromStringAndSize(p, 1);
 		}
 		case 'C':
 		{
@@ -438,7 +438,7 @@
 					}
 					n = (Py_ssize_t)m;
 				}
-				v = PyString_FromStringAndSize(str, n);
+				v = PyUnicode_FromStringAndSize(str, n);
 			}
 			return v;
 		}