Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 357872 Details for
Bug 482034
www-apps/trac-1.0.1 - migrate to distutils-r1.eclass
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
files/trac-1.0.1-changeset_11769.diff
trac-1.0.1-changeset_11769.diff (text/plain), 3.08 KB, created by
Bertrand Jacquin
on 2013-09-04 22:21:19 UTC
(
hide
)
Description:
files/trac-1.0.1-changeset_11769.diff
Filename:
MIME Type:
Creator:
Bertrand Jacquin
Created:
2013-09-04 22:21:19 UTC
Size:
3.08 KB
patch
obsolete
>------------------------------------------------------------------------ >r11769 | jomae | 2013-04-10 13:08:01 +0200 (Wed, 10 Apr 2013) | 2 lines > >1.0.2dev: merge [11768] from 0.12-stable > > >Index: trac/util/tests/datefmt.py >=================================================================== >--- trac/util/tests/datefmt.py (revision 11768) >+++ trac/util/tests/datefmt.py (revision 11769) >@@ -1169,6 +1169,29 @@ > self.assertEqual('2011-10-30T02:45:42.123456+01:00', > dt.astimezone(datefmt.localtz).isoformat()) > >+ def test_astimezone_invalid_range_on_gmt01(self): >+ self._tzset('GMT-1') >+ >+ # 1899-12-30T23:59:58+00:00 is -0x83ac4e92 for time_t, out of range >+ # for 32-bit signed integer >+ dt = datetime.datetime(1899, 12, 30, 23, 59, 58, 123456, datefmt.utc) >+ self.assertEqual('1899-12-31T00:59:58.123456+01:00', >+ dt.astimezone(datefmt.localtz).isoformat()) >+ dt = datetime.datetime(1899, 12, 30, 23, 59, 58, 123456, >+ datefmt.localtz) >+ self.assertEqual('1899-12-30T22:59:58.123456+00:00', >+ dt.astimezone(datefmt.utc).isoformat()) >+ >+ # 2040-12-31T23:59:58+00:00 is 0x858c84ee for time_t, out of range for >+ # 32-bit signed integer >+ dt = datetime.datetime(2040, 12, 31, 23, 59, 58, 123456, datefmt.utc) >+ self.assertEqual('2041-01-01T00:59:58.123456+01:00', >+ dt.astimezone(datefmt.localtz).isoformat()) >+ dt = datetime.datetime(2040, 12, 31, 23, 59, 58, 123456, >+ datefmt.localtz) >+ self.assertEqual('2040-12-31T22:59:58.123456+00:00', >+ dt.astimezone(datefmt.utc).isoformat()) >+ > def test_arithmetic_localized_non_existent_time(self): > self._tzset('Europe/Paris') > t = datetime.datetime(2012, 3, 25, 1, 15, 42, 123456) >Index: trac/util/datefmt.py >=================================================================== >--- trac/util/datefmt.py (revision 11768) >+++ trac/util/datefmt.py (revision 11769) >@@ -842,12 +842,15 @@ > def fromutc(self, dt): > if dt.tzinfo is None or dt.tzinfo is not self: > raise ValueError('fromutc: dt.tzinfo is not self') >- tt = time.localtime(to_timestamp(dt.replace(tzinfo=utc))) >+ try: >+ tt = time.localtime(to_timestamp(dt.replace(tzinfo=utc))) >+ except ValueError: >+ return dt.replace(tzinfo=self._std_tz) + self._std_offset > if tt.tm_isdst > 0: > tz = self._dst_tz > else: > tz = self._std_tz >- return datetime(microsecond=dt.microsecond, tzinfo=tz, *tt[0:6]) >+ return datetime(*(tt[:6] + (dt.microsecond, tz))) > > > utc = FixedOffset(0, 'UTC') >Index: . >=================================================================== >--- . (revision 11768) >+++ . (revision 11769) > >Property changes on: . >___________________________________________________________________ >Modified: svn:mergeinfo > Merged /branches/0.12-stable:r11768 > >------------------------------------------------------------------------
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 482034
:
356648
|
356650
|
356652
|
357850
|
357858
|
357860
|
357862
|
357864
|
357866
|
357868
|
357870
| 357872 |
357874
|
357876
|
357878
|
357880
|
357882
|
357884
|
357886
|
357888
|
376934
|
377034
|
377036
|
377038