Title: Assertion failure in datetime.strftime()
Type: behavior Stage:
Components: Extension Modules Versions: Python 2.5
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, genepi, georg.brandl
Priority: normal Keywords:

Created on 2008-03-26 01:52 by genepi, last changed 2008-03-26 18:03 by georg.brandl. This issue is now closed.

File name Uploaded Description Edit genepi, 2008-03-26 01:52 Sample code broken in Python 2.5 but working in 2.4
Messages (6)
msg64536 - (view) Author: Pierre Metras (genepi) Date: 2008-03-26 01:52
datetime.strftime(pattern) fails in assertion if pattern is big enough (> 
100 chars) while time.strftime(pattern) gives the expected result.

This occurs on Python 2.5 (tested on OLPC XO laptop, Fedora 9). Python 2.4 
(Debian Etch) does not exhibit this bug.
msg64539 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-03-26 02:34
Can you give us an example of the data that caused the failure?
msg64549 - (view) Author: Pierre Metras (genepi) Date: 2008-03-26 11:40
There is an example of a long strftime pattern in the file 
attached to that issue. Just change the length of the pattern to see 
that it works for smaller patterns in Python 2.5.

The pattern where it occured in my application is a Pango markup 
string used for localization:
"<markup><span lang=\"en\" font_desc=\"Sans,Monospace Bold 130\"><span 
msg64553 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-03-26 12:25
I cannot reproduce this with with Python 2.5.1 on x86 Linux.
msg64559 - (view) Author: Pierre Metras (genepi) Date: 2008-03-26 14:47
I did a mistake: OLPC XO is based on Fedora 7 and not 9. They plan to 
upgrade to 9 later this year (, so 
this bug will disappear by itself if it's confirmed that runs 
correctly on Python 2.5.x and Fedora 9 ships with the latest version.
msg64563 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-03-26 18:03
Okay, closing as out of date.
Date User Action Args
2008-03-26 18:03:28georg.brandlsetstatus: open -> closed
resolution: out of date
messages: + msg64563
2008-03-26 14:47:42genepisetmessages: + msg64559
2008-03-26 12:25:00georg.brandlsetnosy: + georg.brandl
messages: + msg64553
2008-03-26 11:40:33genepisetmessages: + msg64549
2008-03-26 02:34:14benjamin.petersonsettype: behavior
messages: + msg64539
nosy: + benjamin.peterson
2008-03-26 01:52:02genepicreate