This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Assertion failure in datetime.strftime()
Type: behavior Stage:
Components: Extension Modules Versions: Python 2.5
process
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 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test.py 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 test.py 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 
foreground=\"#0000FF\">%H</span>:<span 
foreground=\"#00FF00\">%M</span>:<span 
foreground=\"#FF0000\">%S</span></span></markup>"
msg64553 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-03-26 12:25
I cannot reproduce this with test.py 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 (http://wiki.laptop.org/go/Fedora), so 
this bug will disappear by itself if it's confirmed that test.py 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.
History
Date User Action Args
2022-04-11 14:56:32adminsetgithub: 46742
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