[pypy-issue] [issue972] inconsistency with cpython (datetime?)

David Ripton tracker at bugs.pypy.org
Wed Jan 18 21:10:32 CET 2012

David Ripton <d+pypy at ripton.net> added the comment:

pypy/lib_pypy/pypy_test/test_datetime.py has an existing failure in function
test_more_datetime_rounding, which casts doubts on the current implementation.

pypy_pypy/datetime.py's fromtimestamp and utcfromtimestamp have subtly different
rounding code.  If I change fromtimestamp's rounding code to be like
utcfromtimestamp's, or vice versa, then the problem goes away.

Which is more correct?  I believe fromstampstamp's is, based on ancient commit
comments in
http://svn.python.org/view/sandbox/trunk/datetime/datetime.py?view=log  I
believe Tim Peters tweaked fromtimestamp to be more correct in some obscure edge
cases, but failed to change utcfromtimestamp to match.

I think I have a good fix, but I will test it some more, and also fix the unit
test, then submit a patch or a pull request.

nosy: +dripton
title: inconsistence with cpython (datetime?) -> inconsistency with cpython (datetime?)

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list