[Python-bugs-list] [ python-Feature Requests-748201 ] time.strptime() should display format and date on error
SourceForge.net
noreply@sourceforge.net
Sat, 12 Jul 2003 18:31:52 -0700
Feature Requests item #748201, was opened at 2003-06-03 09:14
Message generated for change (Comment added) made by rhettinger
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=748201&group_id=5470
Category: Python Library
Group: None
>Status: Closed
>Resolution: Fixed
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: Raymond Hettinger (rhettinger)
Date: 2003-07-12 20:31
Message:
Logged In: YES
user_id=80475
Making an error message more informative is a worthwhile
usability fix since it is only a one line change.
Applied as:
Lib/_strptime.py 1.21
----------------------------------------------------------------------
Comment By: Brett Cannon (bcannon)
Date: 2003-07-09 12: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 06: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-28 01: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