strptime: unpleasant surprise (py 1.5.2 on Linux)

Scott Cotton scott at chronis.pobox.com
Tue Jul 27 10:42:57 EDT 1999


It shouldn't segfault, however, the function does work if
you reverse the arguments:

Python 1.5.2 (#8, May 28 1999, 21:09:50)  [GCC 2.7.2.3] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import time
>>> time.strptime('%x', '31/7/99')
Traceback (innermost last):
  File "<stdin>", line 1, in ?
ValueError: format mismatch
>>>

I'm not sure, their may be patches to fix the strptime
segfault on linux problem - check www.python.org.

scott


On Sun, Jul 25, 1999 at 09:16:55AM +0900, Matt Gushee wrote:
| Hi, Folks--
| 
| I'm working on some date-related functions, and wanted to see what
| kind of exception 'strptime' would raise if I fed it a European-style
| date string with a US format. But instead of an exception, I get:
| 
| >>> import time
| >>> time.strptime('31/7/99', '%x')  # US locale, wants D/M/Y
| Segmentation fault (core import)
| 
| >>> dumped DateTime                 # mxDateTime version
| >>> DateTime.strptime('31/7/99', '%x')
| Segmentation fault (core dumped)
| 
| Surely this isn't what we want, is it? Has anyone else noticed this
| behavior?
| 
| I'm running Python 1.5.2 on RedHat Linux 5.1 (2.0.34 kernel with glibc 
| 2.0.7).
| 
| Matt Gushee
| Portland, Maine, USA
| mgushee at havenrock.com
| 
| 
| -- 
| http://www.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list