[Patches] [ python-Patches-1067760 ] fix for 1067728: Better handling of float arguments to seek

SourceForge.net noreply at sourceforge.net
Thu Dec 23 09:29:12 CET 2004


Patches item #1067760, was opened at 2004-11-16 17:28
Message generated for change (Comment added) made by titus
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1067760&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Robert Church (churchr)
Assigned to: Nobody/Anonymous (nobody)
Summary: fix for 1067728: Better handling of float arguments to seek

Initial Comment:
Instead of converting all float arguments to ints, this
first attempts to 
convert the argument to a PyLong, and then the old
conversion code takes over.

The upshot is that the limit of floating point
arguments to seek() is raised from (2 ** 32) - 1 to
somewhere above (2 ** 62).

Perhaps a better way to handle this would be to not
accept floating point arguments to seek().

----------------------------------------------------------------------

Comment By: Titus Brown (titus)
Date: 2004-12-23 00:29

Message:
Logged In: YES 
user_id=23486

Bob Ippolito pointed out that nowadays float-->int conversion of
arguments is deprecated; a DeprecationWarning wasn't being raised 
because conversion was done manually in seek.  Patch to fix this
at

http://issola.caltech.edu/~t/transfer/patch-1067760-seekwarn.diff

Linux RH 9.0 works, regression tests run w/o problem.

The patch is against the current HEAD but can probably be backported w/
o a problem.

----------------------------------------------------------------------

Comment By: Titus Brown (titus)
Date: 2004-12-19 01:38

Message:
Logged In: YES 
user_id=23486

Sorry, I should add: patch works against head on Linux RH 9.0 (and 
should work everywhere).  Behavior tested with a script.

----------------------------------------------------------------------

Comment By: Titus Brown (titus)
Date: 2004-12-19 01:37

Message:
Logged In: YES 
user_id=23486

The patch works against HEAD; updated for line numbers (there's a very 
similar set of line elsewhere in the file):

http://issola.caltech.edu/~t/transfer/patch-1067760-seek.diff

rhettinger thought the current behavior was reasonable (see bug 
1067728).  I'm not qualified to comment ;) but it seems odd that floats 
would have drastically different limits than longs.  This looks like a 
reasonable compromise IMO.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1067760&group_id=5470


More information about the Patches mailing list