New submission from Aleksey Sivokon: 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 ---------- components: Library (Lib) messages: 170551 nosy: Aleksey.Sivokon priority: normal severity: normal status: open title: string.Formatter returns str for empty unicode template type: behavior versions: Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15951> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com