[Python-bugs-list] [ python-Feature Requests-748201 ] time.strptime() should display format and date on error

SourceForge.net noreply@sourceforge.net
Wed, 09 Jul 2003 10:13:55 -0700


Feature Requests item #748201, was opened at 2003-06-03 07:14
Message generated for change (Comment added) made by bcannon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=748201&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Thomas Guettler (guettli)
Assigned to: Brett Cannon (bcannon)
Summary: time.strptime() should display format and date on error

Initial Comment:
Hi!

It would be very nice if the ValueError of
time.strptime() would
display the format and the date if there is a mismatch.

Up to now (python 2.2.2) the Error looks like this:
 ValueError: format mismatch
It would be nice if it would look like this:
 format mismatch: str=2002.12.24 format=%Y-%m-%d

 thomas

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

>Comment By: Brett Cannon (bcannon)
Date: 2003-07-09 10:13

Message:
Logged In: YES 
user_id=357491

I will see what I can do.  I am not going to touch this, though, 
until after 2.3 is out since I don't want to risk breaking any code.  
Besides, strptime is going to get a slight overhaul after 2.3 comes 
out to clean it up and make it leaner.

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

Comment By: Walter Dörwald (doerwalter)
Date: 2003-06-30 04:08

Message:
Logged In: YES 
user_id=89016

Maybe time.strptime() should use a subclass of ValueError,
with proper attributes.

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

Comment By: Raymond Hettinger (rhettinger)
Date: 2003-06-27 23:17

Message:
Logged In: YES 
user_id=80475

Helpful, informative error messages are certainly a step in 
the right direction.  Referrring to Brett for implementation.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=748201&group_id=5470