Opened 9 years ago

Closed 9 years ago

#4249 closed (fixed)

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

Reported by: Thomas Güttler <hv@…> Owned by: Malcolm Tredinnick
Component: Uncategorized Version: other branch
Severity: Keywords: unicode PEP0263
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 (1)

views_debug_py.diff (757 bytes) - added by Thomas Güttler <hv@…> 9 years ago.

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by Thomas Güttler <hv@…>

Attachment: views_debug_py.diff added

comment:1 Changed 9 years ago by Malcolm Tredinnick

Needs documentation: unset
Needs tests: unset
Owner: changed from Jacob to Malcolm Tredinnick
Patch needs improvement: unset
Summary: Unicode branch: views/debug.py did not read encoding (# -*- coding: iso-8859-1 -*-)[unicode] views/debug.py did not read encoding (# -*- coding: iso-8859-1 -*-)
Triage Stage: UnreviewedAccepted

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.

comment:2 Changed 9 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

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

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