Opened 9 years ago

Closed 9 years ago

#4414 defect closed duplicate (duplicate)

strftime format string in twisted/conch/ triggers ValueError

Reported by: davidsarah Owned by:
Priority: normal Milestone:
Component: conch Keywords:
Cc: Branch:


At line 55 of twisted/conch/, the format string "%b %2d %H:%S " is passed to time.strftime. This triggers a ValueError:

Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.localtime(0)
time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=0)
>>> time.strftime("%b %2d %H:%S ", time.localtime(0))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Invalid format string

This may be a bug in strftime, since "%d %H" and "%2d" work as format strings, but "%2d %H" does not.

Change History (2)

comment:1 Changed 9 years ago by davidsarah

Resolution: duplicate
Status: newclosed

Sorry, duplicate of #3503 (which is fixed; I was looking at an older version).

comment:2 Changed 8 years ago by <automation>

Owner: z3p deleted
Note: See TracTickets for help on using tickets.