Opened 9 years ago

Closed 9 years ago

#5046 closed (fixed)

views/debug.py: Display string of UnicodeError

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

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@…> 9 years ago.
views_debug_unicodeerror_hint.2.diff (1.1 KB) - added by Thomas Güttler <hv@…> 9 years ago.

Download all attachments as: .zip

Change History (9)

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

comment:1 Changed 9 years ago by jdetaeye@…

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

Ticket #5041 also touches on this problem.

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

I don't see any relation to it:

Ticket #5041 (new)
Admin pages insufficiently escape special characters in primary keys links

I changed views/debug.py to be able to find the source of a unicode
string better by displaying the characters before and after the broken character.

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

Component: UncategorizedMetasystem
Owner: changed from Jacob to Adrian Holovaty

comment:4 in reply to:  3 Changed 9 years ago by anonymous

Replying to Thomas Güttler <hv@tbz-pariv.de>:

Sorry Thomas,

The comment was intended for ticket 5045, not 5046.
My apologies...

Johan

comment:5 Changed 9 years ago by Simon G. <dev@…>

Triage Stage: UnreviewedReady for checkin

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

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

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

comment:7 Changed 9 years ago by Adrian Holovaty

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

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