]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #10812: Revert os.lseek change.
authorRoss Lagerwall <rosslagerwall@gmail.com>
Thu, 17 Mar 2011 19:54:07 +0000 (21:54 +0200)
committerRoss Lagerwall <rosslagerwall@gmail.com>
Thu, 17 Mar 2011 19:54:07 +0000 (21:54 +0200)
Modules/posixmodule.c

index cc908e2a13ac0a32c808fce3507c17e240546d2c..0de6fdfe888e44df8d5c8c2b91fb66a31c38b9a4 100644 (file)
@@ -6080,7 +6080,8 @@ posix_lseek(PyObject *self, PyObject *args)
 #else
     off_t pos, res;
 #endif
-    if (!PyArg_ParseTuple(args, "iO&i:lseek", &fd, _parse_off_t, &pos, &how))
+    PyObject *posobj;
+    if (!PyArg_ParseTuple(args, "iOi:lseek", &fd, &posobj, &how))
         return NULL;
 #ifdef SEEK_SET
     /* Turn 0, 1, 2 into SEEK_{SET,CUR,END} */
@@ -6091,6 +6092,11 @@ posix_lseek(PyObject *self, PyObject *args)
     }
 #endif /* SEEK_END */
 
+#if !defined(HAVE_LARGEFILE_SUPPORT)
+    pos = PyLong_AsLong(posobj);
+#else
+    pos = PyLong_AsLongLong(posobj);
+#endif
     if (PyErr_Occurred())
         return NULL;