Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#5712 closed (fixed)

debug.py fails if python source contains wrong encoded strings

Reported by: Thomas Güttler <hv@…> Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 -*-)
  1. 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 (2)

unicode-exception.txt (2.9 KB) - added by Thomas Güttler <hv@…> 8 years ago.
views_debug_replace_invalid_chars.diff (834 bytes) - added by Thomas Güttler <hv@…> 8 years ago.

Download all attachments as: .zip

Change History (5)

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

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

comment:1 Changed 8 years ago by Thomas Güttler <hv@…>

  • Cc hv@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(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.

comment:3 Changed 8 years ago by Thomas Güttler <hv@…>

  • Cc hv@… removed
Note: See TracTickets for help on using tickets.
Back to Top