Django

Code

Ticket #1785 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

debug.py assumes _get_lines_from_file() doesn't return None

Reported by: django@binaryfeed.org Assigned to: adrian
Milestone: Component: Core framework
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

if an error occurs during view processing, debug.py has a bug such that, on occasion, debug traceback printing fails and you cannot see what your error was. Here's the debug.py traceback. Also see the attached patch for a fix that works in my development environment.

Development server is running at http://127.0.0.1:8000/ Quit the server with CONTROL-C. [06/May/2006 13:39:57] "GET /rate/1/3?dojo.transport=xmlhttp& HTTP/1.1" 301 0 Traceback (most recent call last):

File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/servers/basehttp.py", line 272, in run

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

File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/servers/basehttp.py", line 615, in call

return self.application(environ, start_response)

File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/handlers/wsgi.py", line 145, in call

response = self.get_response(request.path, request)

File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/handlers/base.py", line 100, in get_response

return self.get_technical_error_response(request)

File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/handlers/base.py", line 133, in get_technical_error_response

return debug.technical_500_response(request, *sys.exc_info())

File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/views/debug.py", line 100, in technical_500_response

frames.append({

TypeError?: unsupported operand type(s) for +: 'NoneType?' and 'int' [06/May/2006 13:39:57] "GET /rate/1/3/?dojo.transport=xmlhttp HTTP/1.1" 500 1349

Attachments

debug.py.patch (1.3 kB) - added by django@binaryfeed.org on 05/06/06 15:43:31.
patch for debug.py

Change History

05/06/06 15:43:31 changed by django@binaryfeed.org

  • attachment debug.py.patch added.

patch for debug.py

05/06/06 18:18:23 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(In [2864]) Fixed #1785 -- debug view no longer assumes _get_lines_from_file returns None. Thanks, django@binaryfeed.org

06/12/06 06:00:38 changed by Main

  • type deleted.

Add/Change #1785 (debug.py assumes _get_lines_from_file() doesn't return None)




Change Properties
Action