Bugs item #1556784, was opened at 2006-09-12 02:43
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1556784&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Eric V. Smith (ericvsmith)
Assigned to: Nobody/Anonymous (nobody)
Summary: datetime's strftime limits strings to 127 chars

Initial Comment:
[I'm putting this in category Python Library, because I
assume Extensions Modules is for problems in the
Extensions Module plumbing.]


datetime.date and datetime.time's strftime() methods
call wrap_strftime(), which limits the length of the
format string to 127 chars before calling time.strftime().

This can be seen in the examples below.  Note that in
the third example, time.strftime() does not have a
problem with a 128 character format string.


>>> import datetime
>>> datetime.date.today().strftime('x'*128)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
MemoryError


>>> import datetime
>>> datetime.date.today().strftime('x'*256)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: Objects/stringobject.c:4077: bad argument
to internal function


>>> import time
>>> time.strftime('x'*128)
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'


Reproduced on 2.5c1 Linux, 2.4.3 Linux, and 2.3.3 Windows.


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

>Comment By: Georg Brandl (gbrandl)
Date: 2006-09-30 11:18

Message:
Logged In: YES 
user_id=849994

Thanks for the report, fixed in rev. 52072, 52073 (2.4),
52074 (2.5).

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

Comment By: Eric V. Smith (ericvsmith)
Date: 2006-09-12 22:12

Message:
Logged In: YES 
user_id=411198

See patch http://python.org/sf/1557390


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1556784&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to