GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing bugs.python.org — bugs.python.org

diff -r ce67f965a37d Lib/datetime.py --- a/Lib/datetime.py Sun Mar 08 09:42:40 2015 -0400 +++ b/Lib/datetime.py Sun Mar 08 16:43:58 2015 +0100 @@ -1394,8 +1394,8 @@ @classmethod def utcfromtimestamp(cls, t): """Construct a naive UTC datetime from a POSIX timestamp.""" - t, frac = divmod(t, 1.0) - us = int(frac * 1e6) + t, frac = divmod(t, 1) + us = int(frac * 1000000) # long form required for decimal support # If timestamp is less than one microsecond smaller than a # full second, us can be rounded up to 1000000. In this case, diff -r ce67f965a37d Lib/test/datetimetester.py --- a/Lib/test/datetimetester.py Sun Mar 08 09:42:40 2015 -0400 +++ b/Lib/test/datetimetester.py Sun Mar 08 16:43:58 2015 +0100 @@ -1807,6 +1807,8 @@ expected = time.gmtime(ts) got = self.theclass.utcfromtimestamp(ts) self.verify_field_equality(expected, got) + got = self.theclass.utcfromtimestamp(decimal.Decimal(ts)) + self.verify_field_equality(expected, got) # Run with US-style DST rules: DST begins 2 a.m. on second Sunday in # March (M3.2.0) and ends 2 a.m. on first Sunday in November (M11.1.0).
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.