summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-11-08 18:04:45 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-11-08 18:04:45 (GMT)
commit8e42a0a0e0358c2004c33e0c7415ca48874df991 (patch)
tree79d6df5b01ae1da021d2776d085186742dfd774a /Modules
parent8bd14fb398b1b89c82defdac6c5755c9ca86859b (diff)
downloadcpython-8e42a0a0e0358c2004c33e0c7415ca48874df991.zip
cpython-8e42a0a0e0358c2004c33e0c7415ca48874df991.tar.gz
cpython-8e42a0a0e0358c2004c33e0c7415ca48874df991.tar.bz2
Fixed bug #1081: file.seek allows float arguments
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_fileio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/_fileio.c b/Modules/_fileio.c
index c357a73..0fd8b66 100644
--- a/Modules/_fileio.c
+++ b/Modules/_fileio.c
@@ -556,6 +556,10 @@ portable_lseek(int fd, PyObject *posobj, int whence)
if (posobj == NULL)
pos = 0;
else {
+ if(PyFloat_Check(posobj)) {
+ PyErr_SetString(PyExc_TypeError, "an integer is required");
+ return NULL;
+ }
#if !defined(HAVE_LARGEFILE_SUPPORT)
pos = PyInt_AsLong(posobj);
#else