django-timelog icon indicating copy to clipboard operation
django-timelog copied to clipboard

error

Open alohar opened this issue 12 years ago • 3 comments

File "manage.py", line 14, in execute_manager(settings) File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 438, in execute_manager utility.execute() File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 191, in run_from_argv self.execute(_args, *_options.dict) File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 220, in execute output = self.handle(_args, *_options) File "/usr/local/lib/python2.7/dist-packages/timelog/management/commands/analyze_timelog.py", line 34, in handle data = analyze_log_file(LOGFILE, PATTERN, reverse_paths=options.get('reverse')) File "/usr/local/lib/python2.7/dist-packages/timelog/lib.py", line 75, in analyze_log_file parsed = compiled_pattern.findall(line)[0] IndexError: list index out of range

alohar avatar Apr 13 '12 00:04 alohar

Verify the logfile is being written in the expected format, something like: 2012-07-24 11:59:48,690 GET "/" (200) 1.36

kkumler avatar Aug 24 '12 19:08 kkumler

I get exactly the same error and the format is correct as in @kkumler comment.

jsilva avatar Mar 05 '13 13:03 jsilva

I've got a similar error (IndexError: list index out of range without stacktrace after "pip install").

Resolution I found for my case requires to extend the set of request types with PATCH keyword. So finally I have:

PATTERN = r"""^([0-9]{4}-[0-9]{2}-[0-9]{2} [0-9:]{8},[0-9]{3}) (GET|POST|PUT|DELETE|HEAD|PATCH) "(.*)" \((.*)\) (.*)"""

See original pattern here

acriptis avatar Feb 05 '15 03:02 acriptis