Message11496

Author Ivan
Recipients Ivan, jeff.allen
Date 2017-07-23.21:25:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1500845158.83.0.382802743361.issue2609@psf.upfronthosting.co.za>
In-reply-to
Content
Hello, Jeff, thanks for reply!

For some reason your version of script also works on my PC without any errors.

Could you please try this one: 

import thread
import re
import datetime
import time

def printtime(time):
    datetime.datetime.strptime(time, '%Y-%m-%dT%H:%M:%S')

for i in range(10):
    for i in range(10):
         thread.start_new_thread(printtime, ('2017-07-01T11:11:11',))
    time.sleep(0.5)


This reproduces the error on my Windows 8 laptop with 4 core CPU with the following callstack:

Unhandled exception in thread started by <function printtime at 0x2>
Traceback (most recent call last):
  File "d:\temp\deleteme\foo.py", line 7, in printtime
    datetime.datetime.strptime(time, '%Y-%m-%dT%H:%M:%S')
  File "D:\jython2.7.1\Lib\datetime.py", line 1791, in strptime
    struct, micros = _strptime(date_string, format)
  File "D:\jython2.7.1\Lib\_strptime.py", line 326, in _strptime
    if len(data_string) != found.end():
AttributeError: 'org.python.modules.sre.MatchObject' object has no attribute 'end'


Our production environment (where the problem came from) are 2-core DigitalOcean droplets with Ubuntu 16.04
History
Date User Action Args
2017-07-23 21:25:58Ivansetmessageid: <1500845158.83.0.382802743361.issue2609@psf.upfronthosting.co.za>
2017-07-23 21:25:58Ivansetrecipients: + Ivan, jeff.allen
2017-07-23 21:25:58Ivanlinkissue2609 messages
2017-07-23 21:25:58Ivancreate