[pypy-issue] [issue1092] 1.8.0 datetime.timedelta issue

behackett tracker at bugs.pypy.org
Fri Mar 16 02:46:16 CET 2012


New submission from behackett <bernie at 10gen.com>:

pypy 1.7.0:

[PyPy 1.7.0 with GCC 4.5.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``"anyway, python is a vast
language" (fijal)''
>>>> import datetime
>>>> d = datetime.datetime.utcnow()
>>>> d = d - datetime.timedelta(microseconds=d.microsecond)
>>>> d
datetime.datetime(2012, 3, 16, 1, 43, 51)

pypy 1.8.0:

[PyPy 1.8.0 with GCC 4.5.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``we have much more interpreters
than users''
>>>> import datetime
>>>> d = datetime.datetime.utcnow()
>>>> d = d - datetime.timedelta(microseconds=d.microsecond)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/lib64/pypy1.8/lib_pypy/datetime.py", line 1859, in __sub__
    return self + -other
  File "/usr/lib64/pypy1.8/lib_pypy/datetime.py", line 1850, in __add__
    t.microsecond, tzinfo=self._tzinfo)
  File "/usr/lib64/pypy1.8/lib_pypy/datetime.py", line 1451, in __new__
    _check_time_fields(hour, minute, second, microsecond)
  File "/usr/lib64/pypy1.8/lib_pypy/datetime.py", line 286, in _check_time_fields
    raise TypeError('int expected')
TypeError: int expected

----------
messages: 4104
nosy: behackett, pypy-issue
priority: bug
status: unread
title: 1.8.0 datetime.timedelta issue

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1092>
________________________________________


More information about the pypy-issue mailing list