diff options
author | Guido van Rossum <guido@python.org> | 2002-04-29 13:54:48 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-04-29 13:54:48 +0000 |
commit | a883a3d5fdfefdf198bd34f6d07273063bc1f3b5 (patch) | |
tree | db37a916190c759d44f2f318779961f953a9acf7 /Modules/cStringIO.c | |
parent | 81b9251d5996ec89bcc016c29ecc0b5f0204e59b (diff) | |
download | cpython-git-a883a3d5fdfefdf198bd34f6d07273063bc1f3b5.tar.gz |
See discussion at SF bug 547537.
Unicode objects are currently taken as binary data by the write()
method. This is not what Unicode users expect, nor what the
StringIO.py code does. Until somebody adds a way to specify binary or
text mode for cStringIO objects, change the format string to use "t#"
instead of "s#", so that it will request the "text buffer" version.
This will try the default encoding for Unicode objects.
This is *not* a 2.2 bugfix (since it *is* a semantic change).
Diffstat (limited to 'Modules/cStringIO.c')
-rw-r--r-- | Modules/cStringIO.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/cStringIO.c b/Modules/cStringIO.c index 068a835413..1dbec84651 100644 --- a/Modules/cStringIO.c +++ b/Modules/cStringIO.c @@ -376,7 +376,7 @@ O_write(Oobject *self, PyObject *args) { char *c; int l; - UNLESS (PyArg_ParseTuple(args, "s#:write", &c, &l)) return NULL; + UNLESS (PyArg_ParseTuple(args, "t#:write", &c, &l)) return NULL; if (O_cwrite((PyObject*)self,c,l) < 0) return NULL; |