New submission from Armin Rigo:
The documentation on the hash randomization says that date, time and datetime
have a hash based on strings, that is therefore nondeterministic in several
runs of Python. I may either be missing a caveat, or the actual implementation
does not follow its promise in case a timezone is attached to the datetime or
time object:
~/svn/python/3.7-debug/python -c "import datetime;print(hash(d
atetime.datetime(2016,10,10,0,0,0,0,datetime.timezone(datetime.timedelta(0,
36000)))))"
(this gives -6021186165085109055 all the time)
~/svn/python/3.7-debug/python -c "import
datetime;print(hash(datetime.time(0,0,0,0,
datetime.timezone(datetime.timedelta(0, 36000)))))"
(this gives -3850122659820237607 all the time)
----------
messages: 287601
nosy: arigo
priority: normal
severity: normal
status: open
title: datetime hash is deterministic in some cases
type: security
versions: Python 3.5, Python 3.7
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue29535>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com