limited time.gmtime() on 32-bit platforms.

Bug #1670243 reported by Florent Gallaire on 2017-03-06
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Medium
Florent Gallaire
Breezy
Undecided
Unassigned

Bug Description

time.gmtime() can't handle date before 1901 and after 2038 on 32-bits platforms.

[flext@web99 tb]$ python2.7 ../BZRR/bzr/bzr commit --commit-time "1900-01-01 00:00:00 +0000"
bzr: ERROR: exceptions.ValueError: timestamp out of range for platform time_t
[...]
  File "/home/flext/BZRR/bzr/bzrlib/osutils.py", line 928, in compact_date
    return time.strftime('%Y%m%d%H%M%S', time.gmtime(when))
ValueError: timestamp out of range for platform time_t

bzr 2.8.0dev1 on python 2.7.12 (Linux-2.6.18-416.el5PAE-i686-with-
    redhat-5.11-Final)

[flext@web99 tb]$ python2.7 ../BZRR/bzr/bzr commit --commit-time "2039-01-01 00:00:00 +0000"
bzr: ERROR: exceptions.ValueError: timestamp out of range for platform time_t
[...]
  File "/home/flext/BZRR/bzr/bzrlib/osutils.py", line 928, in compact_date
    return time.strftime('%Y%m%d%H%M%S', time.gmtime(when))
ValueError: timestamp out of range for platform time_t

bzr 2.8.0dev1 on python 2.7.12 (Linux-2.6.18-416.el5PAE-i686-with-
    redhat-5.11-Final)

Related branches

summary: - limited time.gmtime() on 32-bits platforms.
+ limited time.gmtime() on 32-bit platforms.
Vincent Ladeuil (vila) on 2017-03-15
Changed in bzr:
assignee: nobody → Florent Gallaire (fgallaire)
importance: Undecided → Medium
milestone: none → 2.8b1
status: New → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers