New submission from Alexander Belopolsky:

With TZ=America/New_York,

>>> from datetime import *
>>> u = datetime(2015, 11, 1, 5, tzinfo=timezone.utc)
>>> t = u.astimezone()
>>> print(t)
2015-11-01 01:00:00-04:00
>>> print(t.astimezone())
2015-11-01 00:00:00-05:00

which is wrong - the second call to astimezone() should not change the 
timezone.  Note that pure python code does not have this bug.  (Try setiing 
sys.module['_datetime'] = None before running the code above.)

----------
components: Extension Modules
messages: 262239
nosy: belopolsky
priority: normal
severity: normal
stage: needs patch
status: open
title: A bug in datetime.astimezone() method
type: behavior
versions: Python 3.5, Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26616>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to