-
Notifications
You must be signed in to change notification settings - Fork 106
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
AttributeError when running in the context of an HTTP request #110
Comments
Which version of the library and Python are you using? Also, what library are you using for the HTTP results -- Requests? or ??? |
Python 2.7.6 I receive a POST from Twilio containing a text message that I then run through the |
You may be picking up some very experimental code that just landed - I would suggest trying the tagged v1.5 release at https://github.com/bear/parsedatetime/tree/v1.5 until we have a chance to test and debug this code -- which your issue is the first! |
Andrew: Can you post the traceback information here so we can take a deep look Mike Taylor notifications@github.com于2015年7月30日星期四写道:
发自移动版 Gmail |
ERROR 2015-07-30 14:21:20,390 base 16657 140359787828992 Internal Server Error: ...
Traceback (most recent call last):
File "/opt/envs/sitterfied/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/envs/sitterfied/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in view
return self.dispatch(request, *args, **kwargs)
File "/opt/envs/sitterfied/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 57, in wrapped_view
return view_func(*args, **kwargs)
File "/opt/envs/sitterfied/local/lib/python2.7/site-packages/rest_framework/views.py", line 401, in dispatch
response = self.handle_exception(exc)
File "/opt/envs/sitterfied/local/lib/python2.7/site-packages/rest_framework/views.py", line 398, in dispatch
response = handler(request, *args, **kwargs)
File "/opt/envs/sitterfied/local/lib/python2.7/site-packages/rest_framework/decorators.py", line 50, in handler
return func(*args, **kwargs)
File "/opt/sitterfied/sitterfied/flows/views.py", line 50, in booking_requests
start, end, type = calendar.evalRanges(text, get_today().timetuple())
File "/opt/envs/sitterfied/local/lib/python2.7/site-packages/parsedatetime/__init__.py", line 603, in evalRanges
VERSION_CONTEXT_STYLE)
File "/opt/envs/sitterfied/local/lib/python2.7/site-packages/parsedatetime/__init__.py", line 1817, in parse
with self.context() as ctx:
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/opt/envs/sitterfied/local/lib/python2.7/site-packages/parsedatetime/__init__.py", line 293, in context
self._ctxStack.push(ctx)
File "/opt/envs/sitterfied/local/lib/python2.7/site-packages/parsedatetime/context.py", line 24, in push
self.__local.stack.append(ctx)
AttributeError: 'thread._local' object has no attribute 'stack' |
@alewisohn have a try? I think be602b5 fixed this issue. It works for me. |
👍What's the goal behind the code changes? Are you just optimizing or are you adding new features? |
Related pull-request here: #106 TL;DR: use new |
Cool, thanks. |
yes, this is very cool stuff IMO - thanks @philiptzou for fixing this! |
I get random occurrences of the following error:
I'm using the library in the process of an HTTP request and I think that might be interfering with the use of thread locals.
The text was updated successfully, but these errors were encountered: