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
4ddfcd3b
Commit
4ddfcd3b
authored
Sep 30, 2006
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #1556784: allow format strings longer than 127 characters in
datetime's strftime function.
parent
154324a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
Lib/test/test_datetime.py
Lib/test/test_datetime.py
+1
-0
Misc/NEWS
Misc/NEWS
+3
-0
Modules/datetimemodule.c
Modules/datetimemodule.c
+2
-2
No files found.
Lib/test/test_datetime.py
View file @
4ddfcd3b
...
...
@@ -844,6 +844,7 @@ class TestDate(HarmlessMixedComparison):
t
=
self
.
theclass
(
2005
,
3
,
2
)
self
.
assertEqual
(
t
.
strftime
(
"m:%m d:%d y:%y"
),
"m:03 d:02 y:05"
)
self
.
assertEqual
(
t
.
strftime
(
""
),
""
)
# SF bug #761337
self
.
assertEqual
(
t
.
strftime
(
'x'
*
1000
),
'x'
*
1000
)
# SF bug #1556784
self
.
assertRaises
(
TypeError
,
t
.
strftime
)
# needs an arg
self
.
assertRaises
(
TypeError
,
t
.
strftime
,
"one"
,
"two"
)
# too many args
...
...
Misc/NEWS
View file @
4ddfcd3b
...
...
@@ -106,6 +106,9 @@ Library
Extension
Modules
-----------------
-
Bug
#
1556784
:
allow
format
strings
longer
than
127
characters
in
datetime
's strftime function.
- Fix itertools.count(n) to work with negative numbers again.
- RLIMIT_SBSIZE was added to the resource module where available.
...
...
Modules/datetimemodule.c
View file @
4ddfcd3b
...
...
@@ -1149,9 +1149,9 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple,
PyObject
*
newfmt
=
NULL
;
/* py string, the output format */
char
*
pnew
;
/* pointer to available byte in output format */
char
totalnew
;
/* number bytes total in output format buffer,
int
totalnew
;
/* number bytes total in output format buffer,
exclusive of trailing \0 */
char
usednew
;
/* number bytes used so far in output format buffer */
int
usednew
;
/* number bytes used so far in output format buffer */
char
*
ptoappend
;
/* pointer to string to append to output buffer */
int
ntoappend
;
/* # of bytes to append to output buffer */
...
...
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