Merged revisions 76806,76808 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r76806 | benjamin.peterson | 2009-12-13 13:25:34 -0600 (Sun, 13 Dec 2009) | 14 lines

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

  ........
    r76805 | benjamin.peterson | 2009-12-13 13:19:07 -0600 (Sun, 13 Dec 2009) | 7 lines

    accept None as the same as having passed no argument in file types #7349

    This is for consistency with imitation file objects like StringIO and BytesIO.

    This commit also adds a few tests, where they were lacking for concerned
    methods.
  ........
................
  r76808 | benjamin.peterson | 2009-12-13 13:28:09 -0600 (Sun, 13 Dec 2009) | 9 lines

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

  ........
    r76807 | benjamin.peterson | 2009-12-13 13:27:02 -0600 (Sun, 13 Dec 2009) | 1 line

    remove unused variable
  ........
................
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c
index d8b6471..7f1bdb0 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -716,7 +716,7 @@
     PyObject *res;
 
     CHECK_INITIALIZED(self)
-    if (!PyArg_ParseTuple(args, "|n:read", &n)) {
+    if (!PyArg_ParseTuple(args, "|O&:read", &_PyIO_ConvertSsize_t, &n)) {
         return NULL;
     }
     if (n < -1) {
@@ -949,10 +949,8 @@
     Py_ssize_t limit = -1;
 
     CHECK_INITIALIZED(self)
-
-    if (!PyArg_ParseTuple(args, "|n:readline", &limit)) {
+    if (!PyArg_ParseTuple(args, "|O&:readline", &_PyIO_ConvertSsize_t, &limit))
         return NULL;
-    }
     return _buffered_readline(self, limit);
 }