Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libearth.codecs throws AttributeError #32

Closed
summerlight opened this issue Dec 25, 2013 · 0 comments
Closed

libearth.codecs throws AttributeError #32

summerlight opened this issue Dec 25, 2013 · 0 comments
Labels
bug

Comments

@summerlight
Copy link

@summerlight summerlight commented Dec 25, 2013

Concurrent, multiple threads that handle rss responses may raise AttritubeError. Below is the stack trace.

Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\flask\app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "C:\Python27\lib\site-packages\earthreader\web\wsgi.py", line 59, in __ca
ll__
    return self.app(environ, start_response)
  File "C:\Python27\lib\site-packages\flask\app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "C:\Python27\lib\site-packages\flask\app.py", line 1403, in handle_except
ion
    reraise(exc_type, exc_value, tb)
  File "C:\Python27\lib\site-packages\flask\app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Python27\lib\site-packages\flask\app.py", line 1477, in full_dispatch
_request
    rv = self.handle_user_exception(e)
  File "C:\Python27\lib\site-packages\flask\app.py", line 1381, in handle_user_e
xception
    reraise(exc_type, exc_value, tb)
  File "C:\Python27\lib\site-packages\flask\app.py", line 1475, in full_dispatch
_request
    rv = self.dispatch_request()
  File "C:\Python27\lib\site-packages\flask\app.py", line 1461, in dispatch_requ
est
    return self.view_functions[rule.endpoint](**req.view_args)
  File "C:\Python27\lib\site-packages\earthreader\web\app.py", line 249, in feed
s
    cursor = Cursor(category_id)
  File "C:\Python27\lib\site-packages\earthreader\web\app.py", line 133, in __in
it__
    self.subscriptionlist = (stage.subscriptions if stage.subscriptions
  File "C:\Python27\lib\site-packages\libearth\stage.py", line 610, in __get__
    return obj.read_merged_document(self.document_type, self.key_spec, key)
  File "C:\Python27\lib\site-packages\libearth\stage.py", line 273, in read_merg
ed_document
    doc = self.read(document_type, k)
  File "C:\Python27\lib\site-packages\libearth\stage.py", line 250, in read
    document = read(document_type, chunks)
  File "C:\Python27\lib\site-packages\libearth\schema.py", line 1667, in read
    if not doc._parse_next():
  File "C:\Python27\lib\site-packages\libearth\schema.py", line 1010, in _parse_
next
    parser.feed(chunk)
  File "C:\Python27\lib\xml\sax\expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "C:\Python27\lib\xml\sax\expatreader.py", line 338, in start_element_ns
    AttributesNSImpl(newattrs, qnames))
  File "C:\Python27\lib\site-packages\libearth\schema.py", line 1385, in startEl
ementNS
    instance
  File "C:\Python27\lib\site-packages\libearth\schema.py", line 659, in decode
    text = decoder.function(text)
  File "C:\Python27\lib\site-packages\libearth\codecs.py", line 230, in decode
    res = datetime.datetime.strptime(timestamp, '%d %b %Y %H:%M:%S')
AttributeError: _strptime

Below link suggests that python implementation on windows has thread-safety bug on strptime initialization. I guess that those issues can also be related to this bug.

http://stackoverflow.com/questions/2427240/thread-safe-equivalent-to-pythons-time-strptime
http://bugs.python.org/issue7980

@dahlia dahlia closed this Dec 25, 2013
dahlia added a commit that referenced this issue Dec 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.