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.

classification
Title: import tzparse --> fails
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: fdrake Nosy List: fdrake, gvanrossum, hfoffani, jhylton
Priority: normal Keywords:

Created on 2001-03-19 10:41 by hfoffani, last changed 2022-04-10 16:03 by admin. This issue is now closed.

Messages (4)
msg3955 - (view) Author: Hernan Foffani (hfoffani) Date: 2001-03-19 10:41
In Windows OS, an import tzparse fails. May be 
See below:

Python 2.1b1 (#11, Mar  2 2001, 11:23:29) [MSC 32 bit 
(Intel)] on win32
Type "copyright", "credits" or "license" for more 
information.
>>> import tzparse
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "c:\python21\lib\tzparse.py", line 67, in ?
    tzset()
  File "c:\python21\lib\tzparse.py", line 50, in tzset
    tzstr = os.environ['TZ']
  File "C:\Python21\lib\os.py", line 371, in 
__getitem__
    return self.data[key.upper()]
KeyError: TZ
>>>

At line 67 there is a call to tzset() which fails if:
- TZ environment variable is not set
- TZ is set but with an unrecognized format

Commenting such line works for me. I don't need 
tzparse, just was get the docs thru pydoc the utility. 
But that's just me, I don't know about other guys.
(BTW, the module is said to be obsolote)

I don't know if this is really a bug... I read GvR 
that Ping is going to change pydoc from "import" 
to "parse source"...


msg3956 - (view) Author: Jeremy Hylton (jhylton) (Python triager) Date: 2001-03-19 23:37
Logged In: YES 
user_id=31392

I also find it annoying that this module can't be imported
if there isn't a valid TZ environment variable.  

I also noticed in the CVS log that tzparse.py was labelled
"no longer necessary" in June 1993.  Is it still useful?
msg3957 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2001-03-20 18:32
Logged In: YES 
user_id=6380

I propose to make tzparse obsolete.  It clearly doesn't work
right, and doesn't seem to be neede.

Assigning to Fred to implement the necessary doc changes.
msg3958 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2001-03-20 23:15
Logged In: YES 
user_id=3066

Updated the documentation to indicate that this module is obsolete and that it doesn't work in some circumstances.
History
Date User Action Args
2022-04-10 16:03:52adminsetgithub: 34187
2001-03-19 10:41:44hfoffanicreate