Le 20/05/2016 22:47, Reiner Herrmann a écrit :
> On Wed, May 18, 2016 at 12:16:10PM +0200, Axel Beckert wrote:
>> could someone more python-savvy than me have a look at this claim that
>> our SOURCE_DATE_EPOCH example for Python on
>> https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal#Examples
>> is wrong.

When S_D_E is not set, time.gmtime() returns a struct_time that can't be
converted to int:

>>>
datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH',
time.gmtime())))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: int() argument must be a string or a number, not
'time.struct_time'

Maybe we should use time.time() instead.

Regards,
Alexis Bienvenüe.

_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to