Opened 14 years ago

Closed 14 years ago

#13959 closed (duplicate)

There is an error, when a source file with backslash-r returns is interpreted by the Python error report page.

Reported by: petrvanblokland Owned by: nobody
Component: Uncategorized Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

There is an error, when a source file with backslash-r returns is interpreted by the Python error report page.

Due to a hard split on backslah-n, the lineno is out of range.
Also it is not clear what the name of the file is where this goes wrong.
Adding source = source.replace('\r', '\n') solves the problem, but maybe not structural enough.

Kind regards,
Petr van Blokland
buro@…

Traceback (most recent call last):

File "/Library/Python/2.5/site-packages/django/core/servers/basehttp.py", line 279, in run

self.result = application(self.environ, self.start_response)

File "/Library/Python/2.5/site-packages/django/core/servers/basehttp.py", line 651, in call

return self.application(environ, start_response)

File "/Library/Python/2.5/site-packages/django/core/handlers/wsgi.py", line 241, in call

response = self.get_response(request)

File "/Library/Python/2.5/site-packages/django/core/handlers/base.py", line 137, in get_response

return self.handle_uncaught_exception(request, resolver, exc_info)

File "/Library/Python/2.5/site-packages/django/core/handlers/base.py", line 157, in handle_uncaught_exception

return debug.technical_500_response(request, *exc_info)

File "/Library/Python/2.5/site-packages/django/views/debug.py", line 58, in technical_500_response

html = reporter.get_traceback_html()

File "/Library/Python/2.5/site-packages/django/views/debug.py", line 109, in get_traceback_html

frames = self.get_traceback_frames()

File "/Library/Python/2.5/site-packages/django/views/debug.py", line 228, in get_traceback_frames

pre_context_lineno, pre_context, context_line, post_context = self._get_lines_from_file(filename, lineno, 7, loader, module_name)

File "/Library/Python/2.5/site-packages/django/views/debug.py", line 209, in _get_lines_from_file

context_line = source[lineno].strip('\n')

IndexError: list index out of range

Change History (1)

comment:1 by Karen Tracey, 14 years ago

Resolution: duplicate
Status: newclosed

Seems to be an inadvertent duplicate report of #13958.

Note: See TracTickets for help on using tickets.
Back to Top