[issue23888] Fixing fractional expiry time bug in cookiejar

Demian Brecht report at bugs.python.org
Tue Apr 14 17:28:55 CEST 2015


Demian Brecht added the comment:

Although it's likely not going to be a high frequency issue (but would be painful to track down when it does become an issue), by doing an int(float(expires)), you're losing the sub-second portion of the expiry. Why not something like this:

try:
    expires = int(expires)
except ValueError:
    expires = int(float(expires) * 1e6)

Looking at the values in the Chrome sqlite3 database, it seems like the above is what they're storing (INTEGER datatype).

How are wget and curl treating the fractional part? I'd be really surprised if they were ignoring it as in the proposed patch.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23888>
_______________________________________


More information about the Python-bugs-list mailing list