Django

Code

Ticket #5712 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

debug.py fails if python source contains wrong encoded strings

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

Description

Hi,

views/debug.py fails if the python source file contains broken characters.

1. There is no encoding magic line (-*- coding: iso-8859-1 -*-)

2. or the line is there, but there are nevertheless characeters of a different encoding.

The small patch defaults to ascii encoding, giving the unicode method the "replace" argument.

Attachments

unicode-exception.txt (2.9 kB) - added by Thomas Güttler <hv@tbz-pariv.de> on 10/09/07 02:10:00.
views_debug_replace_invalid_chars.diff (0.8 kB) - added by Thomas Güttler <hv@tbz-pariv.de> on 10/09/07 02:10:24.

Change History

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

  • attachment unicode-exception.txt added.

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

  • attachment views_debug_replace_invalid_chars.diff added.

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

  • cc set to hv@tbz-pariv.de.
  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

10/21/07 13:15:02 changed by mtredinnick

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

(In [6585]) Fixed #5712 -- Added more robustness to source code display in the debug view. Our behaviour is a bit more PEP 263 compliant now, too. Thanks, Thomas Güttler.

01/08/08 10:11:36 changed by Thomas Güttler <hv@tbz-pariv.de>

  • cc deleted.

Add/Change #5712 (debug.py fails if python source contains wrong encoded strings)




Change Properties
Action