[Python-bugs-list] [ python-Bugs-409683 ] import tzparse --> fails

noreply@sourceforge.net noreply@sourceforge.net
Tue, 20 Mar 2001 15:15:56 -0800


Bugs item #409683, was updated on 2001-03-19 02:41
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=409683&group_id=5470

Category: Python Library
Group: None
>Status: Closed
Priority: 5
Submitted By: Hernan Martinez Foffani (hfoffani)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: import tzparse --> fails

Initial Comment:
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"...




----------------------------------------------------------------------

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2001-03-20 15:15

Message:
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.

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-03-20 10:32

Message:
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.

----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2001-03-19 15:37

Message:
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?


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=409683&group_id=5470