This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author akira
Recipients akira, belopolsky, pitrou
Date 2015-08-31.16:47:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1441039679.61.0.146704205121.issue22798@psf.upfronthosting.co.za>
In-reply-to
Content
The C code produces correct values according to the tz database.

If TZ=Europe/Moscow then
tzname={"MSK", "MSD"} at 2010-07-01 and
tzname={"MSK", "MSK"} at 2015-07-01. Notice the difference!

The code calls C mktime() with corresponding time tuples
and checks that *tzname* is equal to the expected values. That's all.

If C code is incomprehensible; here's its Python analog:

  >>> import os
  >>> os.environ['TZ'] = 'Europe/Moscow'
  >>> import time
  >>> time.tzset()
  >>> time.mktime((2010,7,1,0,0,0,-1,-1,-1))
  1277928000.0
  >>> time.tzname #XXX expected ('MSK', 'MSD')
  ('MSK', 'MSK')
  >>> time.mktime((2015,7,1,0,0,0,-1,-1,-1))
  1435698000.0
  >>> time.tzname
  ('MSK', 'MSK')


C tzname changes on my machine after the corresponding C mktime() calls 
but Python time.tzname does not change after the time.mktime() calls.
History
Date User Action Args
2015-08-31 16:47:59akirasetrecipients: + akira, belopolsky, pitrou
2015-08-31 16:47:59akirasetmessageid: <1441039679.61.0.146704205121.issue22798@psf.upfronthosting.co.za>
2015-08-31 16:47:59akiralinkissue22798 messages
2015-08-31 16:47:59akiracreate