[pywin32-bugs] [ pywin32-Bugs-2820111 ] Timezone Problem
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2012-01-28 14:30:18
|
Bugs item #2820111, was opened at 2009-07-11 09:55 Message generated for change (Comment added) made by jaraco You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2820111&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: pythonwin Group: None >Status: Closed >Resolution: Works For Me Priority: 5 Private: No Submitted By: Roscoe Bailey (rebstwok) Assigned to: Jason R. Coombs (jaraco) Summary: Timezone Problem Initial Comment: I've been wrestling with the timezone module in pywin32 for several of days and was wondering if any one here might know how to solve the following Keyword: 'Std' error. I've looked at the code and double checked my system registry and there is an entry for Std in each of the timezones in the hive. Here is a listing from PythonWin and what can be done to repeat the failure: PythonWin 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit (Intel)] on win32. Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for further copyright information. >>> import os >>> import sys >>> import time >>> import pywin32 >>> import pywin32api >>> import win32api >>> import win32file >>> import win32timezone >>> import datetime >>> assert 'Mountain Standard Time' in win32timezone.TimeZoneInfo.get_sorted_time_zone_names() Traceback (most recent call last): File "<interactive input>", line 1, in <module> File "C:\Python30\lib\site-packages\win32\lib\win32timezone.py", line 588, in get_sorted_time_zone_names tzs = TimeZoneInfo.get_sorted_time_zones() File "C:\Python30\lib\site-packages\win32\lib\win32timezone.py", line 606, in get_sorted_time_zones zones = TimeZoneInfo.get_all_time_zones() File "C:\Python30\lib\site-packages\win32\lib\win32timezone.py", line 594, in get_all_time_zones return [TimeZoneInfo(n) for n in TimeZoneInfo._get_time_zone_key_names()] File "C:\Python30\lib\site-packages\win32\lib\win32timezone.py", line 594, in <listcomp> return [TimeZoneInfo(n) for n in TimeZoneInfo._get_time_zone_key_names()] File "C:\Python30\lib\site-packages\win32\lib\win32timezone.py", line 385, in __init__ self._LoadInfoFromKey() File "C:\Python30\lib\site-packages\win32\lib\win32timezone.py", line 406, in _LoadInfoFromKey key = self._FindTimeZoneKey() File "C:\Python30\lib\site-packages\win32\lib\win32timezone.py", line 392, in _FindTimeZoneKey zoneNames = dict(self._get_indexed_time_zone_keys('Std')) File "C:\Python30\lib\site-packages\win32\lib\win32timezone.py", line 581, in get_index_value return key[index_key] KeyError: 'Std' Thanks ---------------------------------------------------------------------- >Comment By: Jason R. Coombs (jaraco) Date: 2012-01-28 06:30 Message: For me also, I'm unable to reproduce. The error suggests that there is a non-standard key in the registry in the time zone definitions. I'm going to close this ticket as we're unable to reproduce. If this is still a problem, please re-open the ticket (or add a comment). Please also run this command and attach the resulting tz.reg file: reg export "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Time Zones" tz.reg I will analyze the file and determine if the failure is something that we can correct against. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-01-27 21:04 Message: I can't reproduce this, but I've assigned it to Jason who might have some insights (and sorry for the delay!) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2820111&group_id=78018 |