classification
Title: test_strftime failed on OpenBSD
Type: Stage:
Components: Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: belopolsky, rpointel, vstinner
Priority: normal Keywords:

Created on 2011-11-16 09:45 by rpointel, last changed 2014-02-08 18:10 by rpointel. This issue is now closed.

Files
File name Uploaded Description Edit
test_datetime_python32.log rpointel, 2011-11-16 09:45
test_datetime_python33.log rpointel, 2011-11-16 09:45
test_strftime_python27.log rpointel, 2011-11-16 09:45
test_strftime_python32.log rpointel, 2011-11-16 09:45
test_strftime_python33.log rpointel, 2011-11-16 09:45
strftime.c rpointel, 2011-11-16 09:54
Messages (4)
msg147758 - (view) Author: Remi Pointel (rpointel) * Date: 2011-11-16 09:45
Hello,

I was running test_datetime.py and it failed on OpenBSD.
I have tested with Python 2.7, Python 3.2 and Python 3.3.

Python 2.7:
test_datetime.py: ok
test_srtftime.py: failed (see attached file: test_strftime_python27.log)

Have a lot of:
Conflict for nonstandard '%3y' format (year without century rendered using fieldwidth):
  Expected 011, but got 3y
Strftime test, platform: openbsd5, Python version: 2.7.1
strftime test for Sat Jul 24 21:56:24 2010
Supports nonstandard '%c' format (near-asctime() format)
Supports nonstandard '%x' format (%m/%d/%y %H:%M:%S)
Supports nonstandard '%Z' format (time zone name)
Supports nonstandard '%D' format (mm/dd/yy)
Supports nonstandard '%e' format (day of month as number, blank padded ( 0-31))
Supports nonstandard '%h' format (abbreviated month name)
Supports nonstandard '%k' format (hour, blank padded ( 0-23))
Supports nonstandard '%n' format (newline character)
Supports nonstandard '%r' format (%I:%M:%S %p)
Supports nonstandard '%R' format (%H:%M)
Supports nonstandard '%s' format (seconds since the Epoch in UCT)
Supports nonstandard '%t' format (tab character)
Supports nonstandard '%T' format (%H:%M:%S)


Python 3.2:
test_datetime.py: failed (see attached file: test_datetime_python32.log)
======================================================================
FAIL: test_zones (test.datetimetester.TestTimeTZ_Fast)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/ports/pobj/Python-3.2.2/Python-3.Lib/test/datetimetester.py", line 2506, in test_zones
    "07:47:00 %Z=EST %z=-0500")
AssertionError: '07:47:00 Z=EST z=-0500' != '07:47:00 %Z=EST %z=-0500'
- 07:47:00 Z=EST z=-0500
+ 07:47:00 %Z=EST %z=-0500
?          +      +


======================================================================
FAIL: test_zones (test.datetimetester.TestTimeTZ_Pure)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/ports/pobj/Python-3.2.2/Python-3.Lib/test/datetimetester.py", line 2506, in test_zones
    "07:47:00 %Z=EST %z=-0500")
AssertionError: '07:47:00 Z=EST z=-0500' != '07:47:00 %Z=EST %z=-0500'
- 07:47:00 Z=EST z=-0500
+ 07:47:00 %Z=EST %z=-0500
?          +      +

test_strftime.py: failed (see attached file: test_strftime_python32.log)

======================================================================
FAIL: test_strftime (__main__.StrftimeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_strftime.py", line 67, in test_strftime
    self.strftest1(now)
  File "Lib/test/test_strftime.py", line 124, in strftest1
    % (e[0], e[2]))
AssertionError: strftime does not support standard '%%' format (single percent sign)

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


Python 3.3:
test_datetime.py: failed (see attached file: test_datetime_python33.log)
Same output than Python 3.2.

test_strftime.py: failed (see attached file: test_strftime_python33.log)
Same output than Python 3.2.


I write a small program in C to verify strftime, and it seems to correcly works:
source:
(void)strftime(buf, sizeof(buf) - 1, "%H:%M:%S %%Z=%Z %%z=%z", localtime(&startt));
printf("%s\n", buf);
buf[0] = '\0';
(void)strftime(buf, sizeof(buf) - 1, "07:47:00 %Z=EST %z=-0500", localtime(&startt));
printf("%s\n", buf);

run:
01:00:00 %Z=CET %z=+0100
07:47:00 CET=EST +0100=-0500



Is my test correct ? Don't hesitate if you need more informations.

Thanks for your help, 

Remi.
msg147760 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-11-16 09:52
Can you also please attach your C test program?
msg147761 - (view) Author: Remi Pointel (rpointel) * Date: 2011-11-16 09:54
Sure.
msg210670 - (view) Author: Remi Pointel (rpointel) * Date: 2014-02-08 18:10
I close this bug because it's corrected by the commit (revision 1.2): http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/time/wcsftime.c

It was a bug in our wcsftime.

Thanks.
History
Date User Action Args
2014-02-08 18:10:56rpointelsetstatus: open -> closed
resolution: not a bug
messages: + msg210670
2011-11-16 09:54:28rpointelsetfiles: + strftime.c

messages: + msg147761
2011-11-16 09:52:06vstinnersetnosy: + belopolsky, vstinner
messages: + msg147760
2011-11-16 09:45:44rpointelsetfiles: + test_strftime_python33.log
2011-11-16 09:45:36rpointelsetfiles: + test_strftime_python32.log
2011-11-16 09:45:29rpointelsetfiles: + test_strftime_python27.log
2011-11-16 09:45:21rpointelsetfiles: + test_datetime_python33.log
2011-11-16 09:45:10rpointelcreate