-> > Apparently file.seek doesn't have this DeprecationWarning though.. -> > Strange, that. -> > >>> f.seek(3.6) -> > >>> f.tell() -> > 3L -> -> That's a bug. Who'll fix it? Added: + if (PyFloat_Check(offobj)) + PyErr_Warn(PyExc_DeprecationWarning, + "integer argument expected, got float" ); see attached diff. I also attached it to the patch at SourceForge, with a comment, just to keep the record straight. The DeprecationWarning wasn't given because a manual PyObject --> int/long conversion was being done, rather than the usual conversion implicit in ParseTuple. Regression tests run w/o problem on RH 9.0/i386. Now you get the correct behavior: --
f = open('/dev/zero') f.seek(5) f.tell() 5L f.seek(5.2) __main__:1: DeprecationWarning: integer argument expected, got float f.tell() 5L --
This seems like a reasonable resolution to patch #1067760, to me... cheers, --titus