Changes between Initial Version and Version 2 of Ticket #20812
- Timestamp:
- Aug 19, 2013, 11:29:53 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #20812 – Description
initial v2 1 Unlike the unicode() builtin function, the method __unicode__() does not.1 Unlike the `unicode()` builtin function, the method `__unicode__()` does not validate its return type. 2 2 3 If people wrote a buggy __unicode__ which does not return str or unicode, this can lead to a situation where force_text()will return non-text, and so the bug may only appear much, much later when other parts of the application assumes they were getting text and often it will become very difficult to find how the non-string object came from.3 If people wrote a buggy `__unicode__` which does not return `str` or `unicode`, this can lead to a situation where `force_text()` will return non-text, and so the bug may only appear much, much later when other parts of the application assumes they were getting text and often it will become very difficult to find how the non-string object came from. 4 4 5 5 Expected result: 6 6 7 force_text() should be switched to use unicode() so returning non-text from __unicode__()will immediately raise an error at the point where the error would have been obvious.7 `force_text()` should be switched to use `unicode()` so returning non-text from `__unicode__()` will immediately raise an error at the point where the error would have been obvious.