Django

Code

Ticket #4249 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

[unicode] views/debug.py did not read encoding (# -*- coding: iso-8859-1 -*-)

Reported by: Thomas Güttler <hv@tbz-pariv.de> Assigned to: mtredinnick
Milestone: Component: Uncategorized
Version: other branch Keywords: unicode PEP0263
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Hi,

here is a small patch. views/debug.py failed to display the traceback because the file was encoded in latin1.

I patched _get_lines_from_file() to read the encoding string of the python file.

See: http://www.python.org/dev/peps/pep-0263/

Attachments

views_debug_py.diff (0.7 kB) - added by Thomas Güttler <hv@tbz-pariv.de> on 05/09/07 10:04:04.

Change History

05/09/07 10:04:04 changed by Thomas Güttler <hv@tbz-pariv.de>

  • attachment views_debug_py.diff added.

05/09/07 10:11:40 changed by mtredinnick

  • needs_better_patch changed.
  • needs_tests changed.
  • summary changed from Unicode branch: views/debug.py did not read encoding (# -*- coding: iso-8859-1 -*-) to [unicode] views/debug.py did not read encoding (# -*- coding: iso-8859-1 -*-).
  • owner changed from jacob to mtredinnick.
  • needs_docs changed.
  • stage changed from Unreviewed to Accepted.

Looks like the right idea. I still have to audit that part of the tree for unicode problems, but this patch looks like a fix for the problem you are seeing. I'll apply it when I get to that part.

05/11/07 09:49:43 changed by mtredinnick

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

(In [5193]) unicode: Fixed #4249 -- Decode source files correctly in the debug view. Thanks, Thomas G?\195?\188ttler.


Add/Change #4249 ([unicode] views/debug.py did not read encoding (# -*- coding: iso-8859-1 -*-))




Change Properties
Action