Message170551
| Author |
Aleksey.Sivokon |
| Recipients |
Aleksey.Sivokon |
| Date |
2012年09月16日.11:55:55 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1347796556.49.0.9624827569.issue15951@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Expected behavior of string.Formatter() is to return unicode strings for unicode templates, and "byte" strings for str templates. Which is exactly what it does, with one frustrating exception: for empty unicode string it returns byte str. Test follows:
import string
template = u""
result = string.Formatter().format(template)
assert isinstance(result, unicode)
# AssertionError |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年09月16日 11:55:56 | Aleksey.Sivokon | set | recipients:
+ Aleksey.Sivokon |
| 2012年09月16日 11:55:56 | Aleksey.Sivokon | set | messageid: <1347796556.49.0.9624827569.issue15951@psf.upfronthosting.co.za> |
| 2012年09月16日 11:55:56 | Aleksey.Sivokon | link | issue15951 messages |
| 2012年09月16日 11:55:55 | Aleksey.Sivokon | create |
|