[issue7300] Unicode arguments in str.format()

2013-03-28 Thread Georg Brandl
Georg Brandl added the comment: Agreed with Eric. -- nosy: +georg.brandl resolution: - wont fix status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7300 ___

[issue7300] Unicode arguments in str.format()

2012-12-30 Thread Pedro Algarvio
Pedro Algarvio added the comment: This is not a 2.7 issue only: import sys sys.version_info (2, 6, 5, 'final', 0 'Foo {0}'.format(u'bár') Traceback (most recent call last): File stdin, line 1, in module UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 1:

[issue7300] Unicode arguments in str.format()

2012-12-30 Thread Ezio Melotti
Ezio Melotti added the comment: 2.6 only gets security fixes. My patch converts the format string to unicode using the default encoding. It's inconsistent with str%args: str%args converts str to unicode using the ASCII charset (if a least one argument is an unicode string), not the

[issue7300] Unicode arguments in str.format()

2012-12-30 Thread STINNER Victor
STINNER Victor added the comment: Another option is to decide that this issue will *not* be fixed in Python 2, and Python 3 *is* the good solution if you have this issue. Doing the work twice can cause new problems, formatting an argument twice may return two different values :-( It may have

[issue7300] Unicode arguments in str.format()

2012-12-30 Thread Eric V. Smith
Eric V. Smith added the comment: I agree that we should close this as won't fix in 2.7. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7300 ___

[issue7300] Unicode arguments in str.format()

2012-09-26 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +chris.jerdonek versions: -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7300 ___

[issue7300] Unicode arguments in str.format()

2012-06-11 Thread Gökçen Eraslan
Changes by Gökçen Eraslan gok...@pardus.org.tr: -- nosy: +Gökçen.Eraslan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7300 ___ ___

[issue7300] Unicode arguments in str.format()

2010-09-09 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7300 ___ ___ Python-bugs-list

[issue7300] Unicode arguments in str.format()

2010-03-11 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: I'm not sure I'm wild about doing the work twice, once as string and once as unicode if need be. But I'll consider it, especially since this is only a 2.7 issue. There could be side effects of evaluating the replacement strings, but I'm not

[issue7300] Unicode arguments in str.format()

2010-03-09 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: PyString_Format() uses a goto unicode; if a '%c' or '%s' argument is unicode. The unicode label converts the partial formatted result (byte string) to unicode, and use PyUnicode_Format() to finish to formatting. I don't think that

[issue7300] Unicode arguments in str.format()

2010-03-09 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: *Draft* patch fixing the issue: render_field() raises an error if the argument is an unicode argument, string_format() catchs this error and converts self to unicode and call unicode.format(*args, **kw). Pseudo-code: try: #

[issue7300] Unicode arguments in str.format()

2010-03-09 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: My patch converts the format string to unicode using the default encoding. It's inconsistent with str%args: str%args converts str to unicode using the ASCII charset (if a least one argument is an unicode string), not the default

[issue7300] Unicode arguments in str.format()

2010-03-07 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7300 ___ ___

[issue7300] Unicode arguments in str.format()

2010-03-07 Thread Pablo Mouzo
Changes by Pablo Mouzo pablomo...@gmail.com: -- nosy: +pablomouzo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7300 ___ ___ Python-bugs-list

[issue7300] Unicode arguments in str.format()

2010-01-13 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7300 ___ ___ Python-bugs-list

[issue7300] Unicode arguments in str.format()

2009-11-13 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- priority: - high stage: - test needed versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7300 ___

[issue7300] Unicode arguments in str.format()

2009-11-10 Thread Walter Dörwald
New submission from Walter Dörwald wal...@livinglogic.de: str.format() doesn't handle unicode arguments: Python 2.6.4 (r264:75706, Oct 27 2009, 15:18:04) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type help, copyright, credits or license for more information. '{0}'.format(u'\u3042')