[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 ___ ___

[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 ___ ___ Python-bugs-lis

[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 a

[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 de

[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 "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 1: ordinal

[issue7300] Unicode arguments in str.format()

2012-09-26 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +chris.jerdonek versions: -Python 2.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue7300] Unicode arguments in str.format()

2012-06-11 Thread Gökçen Eraslan
Changes by Gökçen Eraslan : -- nosy: +Gökçen.Eraslan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue7300] Unicode arguments in str.format()

2010-09-09 Thread Florent Xicluna
Changes by Florent Xicluna : -- nosy: +flox ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue7300] Unicode arguments in str.format()

2010-03-11 Thread Eric Smith
Eric Smith 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 sure it's worth worry

[issue7300] Unicode arguments in str.format()

2010-03-09 Thread STINNER Victor
STINNER Victor 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 encoding. >>> "\xff%s" % u'\x

[issue7300] Unicode arguments in str.format()

2010-03-09 Thread STINNER Victor
STINNER Victor 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: # self.format() raises an error

[issue7300] Unicode arguments in str.format()

2010-03-09 Thread STINNER Victor
STINNER Victor 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 you can apply the same alg

[issue7300] Unicode arguments in str.format()

2010-03-07 Thread Pablo Mouzo
Changes by Pablo Mouzo : -- nosy: +pablomouzo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue7300] Unicode arguments in str.format()

2010-03-07 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue7300] Unicode arguments in str.format()

2010-01-13 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue7300] Unicode arguments in str.format()

2009-11-13 Thread Ezio Melotti
Changes by Ezio Melotti : -- priority: -> high stage: -> test needed versions: +Python 2.7 ___ Python tracker ___ ___ Python-bugs-lis

[issue7300] Unicode arguments in str.format()

2009-11-10 Thread Walter Dörwald
New submission from Walter Dörwald : 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') Traceback (most r