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

ValueError: time data does not match format '%Y-%m-%dT%H:%M:%S.%f' #46

Open
kolen opened this issue Jul 14, 2015 · 5 comments
Open

ValueError: time data does not match format '%Y-%m-%dT%H:%M:%S.%f' #46

kolen opened this issue Jul 14, 2015 · 5 comments

Comments

@kolen
Copy link

kolen commented Jul 14, 2015

I didn't figure out when it happens, but it happens sometimes:

Traceback (most recent call last):
  File "/srv/www/someproj/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 90, in get_response
    response = middleware_method(request)
  File "/srv/www/someproj/env/local/lib/python2.7/site-packages/session_security/middleware.py", line 35, in process_request
    self.update_last_activity(request, now)
  File "/srv/www/someproj/env/local/lib/python2.7/site-packages/session_security/middleware.py", line 52, in update_last_activity
    last_activity = get_last_activity(request.session)
  File "/srv/www/someproj/env/local/lib/python2.7/site-packages/session_security/utils.py", line 17, in get_last_activity
    '%Y-%m-%dT%H:%M:%S.%f')
  File "/usr/lib/python2.7/_strptime.py", line 325, in _strptime
    (data_string, format))

ValueError: time data '2015-07-13T23:37:26' does not match format '%Y-%m-%dT%H:%M:%S.%f'

When it happens, I get multiple exceptions for subsequent pages. For some reason, value in session['_session_security'] appears without microseconds.

@jpic
Copy link
Member

jpic commented Jul 14, 2015 via email

@kolen
Copy link
Author

kolen commented Jul 14, 2015

User agents were:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36

So probably Chrome 38 and 43.

@jpic
Copy link
Member

jpic commented Jul 14, 2015

A fix in python would be easier to test for now would you be able to do
that?
Le 14 juil. 2015 11:38, "Konstantin Mochalov" [email protected] a
écrit :

User agents were:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/38.0.2125.111 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/43.0.2357.81 Safari/537.36

So probably Chrome 38 and 43.


Reply to this email directly or view it on GitHub
#46 (comment)
.

@kolen
Copy link
Author

kolen commented Jul 14, 2015

Sorry, I can't reproduce this, it happens randomly and currently doesn't happen.

@jpic
Copy link
Member

jpic commented Jul 15, 2015

Yes but we can expect that microseconds are missing in get_last_activity
can't we ?

On Tue, Jul 14, 2015 at 12:48 PM, Konstantin Mochalov <
[email protected]> wrote:

Sorry, I can't reproduce this, it happens randomly and currently doesn't
happen.


Reply to this email directly or view it on GitHub
#46 (comment)
.

http://yourlabs.org http://blog.yourlabs.org
Customer is king - Le client est roi - El cliente es rey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants