[Python-checkins] CVS: python/dist/src/Objects fileobject.c,2.135,2.136
Michael Hudson
mwh@users.sourceforge.net
2001年10月31日 10:51:04 -0800
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv19317/Objects
Modified Files:
fileobject.c
Log Message:
fix for
[ #476557 ] Wrong error message for file.write(a, b)
Makes file.write a METH_VARARGS function.
Index: fileobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v
retrieving revision 2.135
retrieving revision 2.136
diff -C2 -d -r2.135 -r2.136
*** fileobject.c 2001年10月23日 21:25:24 2.135
--- fileobject.c 2001年10月31日 18:51:01 2.136
***************
*** 1162,1166 ****
if (f->f_fp == NULL)
return err_closed();
! if (!PyArg_Parse(args, f->f_binary ? "s#" : "t#", &s, &n))
return NULL;
f->f_softspace = 0;
--- 1162,1166 ----
if (f->f_fp == NULL)
return err_closed();
! if (!PyArg_ParseTuple(args, f->f_binary ? "s#" : "t#", &s, &n))
return NULL;
f->f_softspace = 0;
***************
*** 1379,1383 ****
{"readline", (PyCFunction)file_readline, METH_VARARGS, readline_doc},
{"read", (PyCFunction)file_read, METH_VARARGS, read_doc},
! {"write", (PyCFunction)file_write, METH_OLDARGS, write_doc},
{"fileno", (PyCFunction)file_fileno, METH_NOARGS, fileno_doc},
{"seek", (PyCFunction)file_seek, METH_VARARGS, seek_doc},
--- 1379,1383 ----
{"readline", (PyCFunction)file_readline, METH_VARARGS, readline_doc},
{"read", (PyCFunction)file_read, METH_VARARGS, read_doc},
! {"write", (PyCFunction)file_write, METH_VARARGS, write_doc},
{"fileno", (PyCFunction)file_fileno, METH_NOARGS, fileno_doc},
{"seek", (PyCFunction)file_seek, METH_VARARGS, seek_doc},