Django

Code

Ticket #5046 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

views/debug.py: Display string of UnicodeError

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

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

views_debug_unicodeerror_hint.diff (1.1 kB) - added by Thomas Güttler <hv@tbz-pariv.de> on 08/01/07 08:29:11.
views_debug_unicodeerror_hint.2.diff (1.1 kB) - added by Thomas Güttler <hv@tbz-pariv.de> on 08/09/07 09:53:36.

Change History

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

  • attachment views_debug_unicodeerror_hint.diff added.

08/01/07 14:40:05 changed by jdetaeye@frepple.com

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

Ticket #5041 also touches on this problem.

08/02/07 08:45:39 changed by Thomas Güttler <hv@tbz-pariv.de>

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.

(follow-up: ↓ 4 ) 08/02/07 08:57:57 changed by Thomas Güttler <hv@tbz-pariv.de>

  • owner changed from jacob to adrian.
  • component changed from Uncategorized to Metasystem.

(in reply to: ↑ 3 ) 08/02/07 10:18:17 changed 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

08/02/07 16:50:34 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Unreviewed to Ready for checkin.

08/09/07 09:53:36 changed by Thomas Güttler <hv@tbz-pariv.de>

  • attachment views_debug_unicodeerror_hint.2.diff added.

08/09/07 09:54:54 changed by Thomas Güttler <hv@tbz-pariv.de>

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

08/11/07 22:23:54 changed by adrian

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

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


Add/Change #5046 (views/debug.py: Display string of UnicodeError)




Change Properties
Action