Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f2c62787
Commit
f2c62787
authored
Sep 26, 2006
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the error message for when the time data and format do not match clearer.
parent
f6cb6a4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
Lib/_strptime.py
Lib/_strptime.py
+1
-1
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/_strptime.py
View file @
f2c62787
...
...
@@ -306,7 +306,7 @@ def strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
_cache_lock.release()
found = format_regex.match(data_string)
if not found:
raise ValueError("time data
did not match format: data=%s fmt=%s
" %
raise ValueError("time data
%r does not match format %r
" %
(data_string, format))
if len(data_string) != found.end():
raise ValueError("unconverted data remains: %s" %
...
...
Misc/NEWS
View file @
f2c62787
...
...
@@ -56,6 +56,9 @@ Core and builtins
Library
-------
-
Made
the
error
message
for
time
.
strptime
when
the
data
data
and
format
do
match
be
more
clear
.
-
Fix
a
bug
in
traceback
.
format_exception_only
()
that
led
to
an
error
being
raised
when
print_exc
()
was
called
without
an
exception
set
.
In
version
2.4
,
this
printed
"None"
,
restored
that
behavior
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment