#5028 closed Uncategorized (wontfix)
unicode: str(s) can fail if s is an AssertionError
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | Normal | Keywords: | unicode |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Here is a small patch to fall back to repr() if
str() fails. (force_unicode())
str(exc) fails if the assertion message contains latin1.
Attachments (2)
Change History (6)
by , 17 years ago
Attachment: | utils_encoding_repr.diff added |
---|
by , 17 years ago
Attachment: | temporary_force_unicode_patch.patch added |
---|
comment:1 by , 17 years ago
I had the same problem with force_unicode() if s contains latin-1 characters, but in a different case. The patch only works for latin-1 systems, so you probably have to find a cleaner solution.
comment:2 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
It does absolutely make no sense to use repr() instead of str() if latter fails. Please discuss this in the developers' mailing list if you disagree.
comment:3 by , 17 years ago
Cc: | added |
---|
comment:4 by , 13 years ago
Cc: | removed |
---|---|
Easy pickings: | unset |
Severity: | → Normal |
Type: | → Uncategorized |
UI/UX: | unset |
Note:
See TracTickets
for help on using tickets.
patch for 'elif not isinstance(s, unicode):'