Axel Beckert <a...@debian.org> writes:

> See https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal#Examples
> for some examples on how to implement support for SOURCE_DATE_EPOCH,
> including an example for Python.

Response from the upstream author (please consider replying to the
upstream bug report, not here):

"FYI, the Python example is wrong. If `SOURCE_DATE_EPOCH` is supposed to
be a Unix timestamp (number of seconds since epoch), then
`time.gmtime()` is not the Python equivalent. However,
`calendar.timegm(datetime.datetime.utcnow().utctimetuple())` or
`calendar.timegm(time.gmtime())` is. It is annoyingly complicated to get
a Unix timestamp in Python. Although Python >= 3.3 makes it easier with
`datetime.datetime.utcnow().timestamp()`.  Not sure how the `datetime`
module went so long without the ability to return a timestamp."
-- 
Brian May <b...@debian.org>

_______________________________________________
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

Reply via email to