Opened 17 years ago

Closed 17 years ago

Last modified 7 years ago

#5046 closed Cleanup/optimization (fixed)

views/debug.py: Display string of UnicodeError

Reported by: Thomas Güttler <hv@…> Owned by: Adrian Holovaty
Component: Error reporting Version: dev
Severity: Normal Keywords: unicode
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi,

if you get an UnicodeError in debug.py you don't see
the string, which contains the non utf8 character.

This small patch adds a hint, if the exception is an UnicodeError.
The hint displays some character before and after the wrong
character.

Attachments (2)

views_debug_unicodeerror_hint.diff (1.1 KB ) - added by Thomas Güttler <hv@…> 17 years ago.
views_debug_unicodeerror_hint.2.diff (1.1 KB ) - added by Thomas Güttler <hv@…> 17 years ago.

Download all attachments as: .zip

Change History (9)

by Thomas Güttler <hv@…>, 17 years ago

comment:3 by Thomas Güttler <hv@…>, 17 years ago

Component: UncategorizedMetasystem
Owner: changed from Jacob to Adrian Holovaty

comment:5 by Simon G. <dev@…>, 17 years ago

Triage Stage: UnreviewedReady for checkin

by Thomas Güttler <hv@…>, 17 years ago

comment:6 by Thomas Güttler <hv@…>, 17 years ago

the second diff (views_debug_unicodeerror_hint.2.diff) fixes a typo of
the first diff: smart_unicode(..., errors="replace")

comment:7 by Adrian Holovaty, 17 years ago

Resolution: fixed
Status: newclosed

(In [5862]) Fixed #5046 -- Added 'Unicode error hint' section to debug page in the case of a UnicodeError. Thanks, Thomas Guttler

comment:8 by Tim Graham, 7 years ago

Component: MetasystemError reporting
Easy pickings: unset
Severity: Normal
Type: Cleanup/optimization
UI/UX: unset

10 years later, I noticed these lines aren't tested. I'm not sure if this feature is still needed in a Python 3-only world as I'd think the problematic string would appear in the " Local vars" section of the traceback but there aren't steps to reproduce so perhaps you could give an insight if you remember anything about the original issue, Thomas?

In case the feature in still useful, I made a PR to add a test.

comment:9 by Tim Graham <timograham@…>, 7 years ago

In 74b7a20:

Refs #5046 -- Tested the 'unicode hint' in the technical 500 debug view.

comment:10 by Thomas Güttler, 7 years ago

thank you

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