[issue11108] Intermittent AttributeError when using time.strptime in threads

2011-02-03 Thread Carlos Corbacho

New submission from Carlos Corbacho :

time.strptime() intermittently (and I mean _really_ intermittently) throws an 
AttributeError.

Steps to reproduce:

Run the attached script (you may have to do this quite a lot of times; in an 
evening of trying, I could only trigger this bug once...) - this just starts 
lots of threads so that we have lots of time.strptime()'s running in parallel.

Expected:

It just keeps running every time.

Actual:

On one run, the script bailed out almost immediately -

ccorbacho@valkyrie:~/chroots/trunk/home/ccorbacho/scratch/ccorbacho$ python 
test_time.py
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib64/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
  File "test_time.py", line 13, in run
time.strptime("30 Nov 00", "%d %b %y")
AttributeError: _strptime_time

---
This is with Python 2.6.6. However, at work we have been seeing this very 
intermittently with Python 2.5 in threaded code doing time.strptime() as well 
(though we just get AttributeError: strptime, but I don't have any code I can 
provide to reproduce on 2.5), hence I'm raising the bug.

--
components: None
files: test_time.py
messages: 127822
nosy: ccorbacho
priority: normal
severity: normal
status: open
title: Intermittent AttributeError when using time.strptime in threads
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file20664/test_time.py

___
Python tracker 
<http://bugs.python.org/issue11108>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7980] time.strptime not thread safe

2011-02-04 Thread Carlos Corbacho

Carlos Corbacho  added the comment:

As per my comments on Issue11108 - I suspect that PyImport_ImportModuleNoBlock 
is a bit of a red herring here - in Python 2.5 and earlier versions (well 
before PyImport_ImportModuleNoBlock was added), we have occasionally seen 
'AttributeError: strptime' from threaded code calling time.strptime(), so 
whatever this bug is, I don't believe it's caused by the call now being 
non-blocking from 2.6 onwards.

--
nosy: +ccorbacho

___
Python tracker 
<http://bugs.python.org/issue7980>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com