[issue15276] unicode format does not really work in Python 2.x

2020-05-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Python 2.7 is no longer supported. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue15276] unicode format does not really work in Python 2.x

2020-05-31 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue15276] unicode format does not really work in Python 2.x

2014-04-17 Thread Petr Dlouhý
Petr Dlouhý added the comment: For anyone stuck on Python 2.x, here is an workaround (maybe it could find it's way to documentation also): def fix_grouping(bytestring): try: return unicode(bytestring) except UnicodeDecodeError: return bytestring.decode(utf-8)

[issue15276] unicode format does not really work in Python 2.x

2012-11-04 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: -berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15276 ___ ___

[issue15276] unicode format does not really work in Python 2.x

2012-11-04 Thread STINNER Victor
STINNER Victor added the comment: If we don't fix this (I'm leaning that way myself), I think we should somehow document the limitation. There are ways to acknowledge the limitation without getting into the specifics of this particular issue. I agree to documentation the limitation and close

[issue15276] unicode format does not really work in Python 2.x

2012-09-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: I have a brief documentation patch in mind for this, but it relies on documentation issue 15952 being addressed first (e.g. to say that format(value) returns Unicode when format_spec is Unicode and that value.__format__() can return a string of type str). So

[issue15276] unicode format does not really work in Python 2.x

2012-09-20 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15276 ___ ___ Python-bugs-list

[issue15276] unicode format does not really work in Python 2.x

2012-09-20 Thread STINNER Victor
STINNER Victor added the comment: I fixed a similar bug in Python 3.3: issue #13706. changeset: 75231:f89e2f4cda88 user:Victor Stinner victor.stin...@haypocalc.com date:Fri Feb 24 00:37:51 2012 +0100 files: Include/unicodeobject.h Lib/test/test_format.py

[issue15276] unicode format does not really work in Python 2.x

2012-09-20 Thread STINNER Victor
STINNER Victor added the comment: I can't reproduce this with Python 2.7.3. locale.setlocale(locale.LC_NUMERIC, 'fr_FR') 'fr_FR' u'{:n}'.format(1) u'10 000' I don't understand why, but the all french locales are the same. Some french locale uses the standard ASCII space (U+0020) as

[issue15276] unicode format does not really work in Python 2.x

2012-09-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: What do you think? [Even though I wasn't asked] I think we may need to close the issue as won't fix. Depending on the exact change propsosed, it may be that the return type for existing operations might change, which shouldn't be done in a bug fix release.

[issue15276] unicode format does not really work in Python 2.x

2012-09-19 Thread Chris Jerdonek
Chris Jerdonek added the comment: If we don't fix this (I'm leaning that way myself), I think we should somehow document the limitation. There are ways to acknowledge the limitation without getting into the specifics of this particular issue. --

[issue15276] unicode format does not really work in Python 2.x

2012-09-17 Thread Chris Jerdonek
Chris Jerdonek added the comment: Eric, it looks like you wrote this comment: /* don't define FORMAT_LONG, FORMAT_FLOAT, and FORMAT_COMPLEX, since we can live with only the string versions of those. The builtin format() will convert them to unicode. */ in

[issue15276] unicode format does not really work in Python 2.x

2012-09-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: I can't yet reproduce on my system, but after looking at the code, I believe the following are closer to the cause: format(1, u'n') int.__format__(1, u'n') Incidentally, on my system, the following note in the docs is wrong: Note: format(value,

[issue15276] unicode format does not really work in Python 2.x

2012-09-16 Thread Eric V. Smith
Eric V. Smith added the comment: The case with 1.__format__ is confusing the parser. It sees: floating point number 1. __format__ which is indeed a syntax error. Try: 1 .__format__(u'n') '1' or: (1).__format__(u'n') '1' --

[issue15276] unicode format does not really work in Python 2.x

2012-09-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: The case with 1.__format__ is confusing the parser. Interesting, good catch! That error did seem unusual. The two modified forms do give the same result as int.__format__() (though the type still differs). --

[issue15276] unicode format does not really work in Python 2.x

2012-09-16 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15276 ___

[issue15276] unicode format does not really work in Python 2.x

2012-09-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: I did some analysis of this issue. For starters, I could not reproduce this on Mac OS X 10.7.4. I iterated through all available locales, and the separator was ASCII in all cases. Instead, I was able to fake the issue by changing , to \xa0 in the following

[issue15276] unicode format does not really work in Python 2.x

2012-07-08 Thread Berker Peksag
Berker Peksag berker.pek...@gmail.com added the comment: I can't reproduce this with Python 2.7.3. berker@wakefield ~[master*]$ python Python 2.7.3 (default, Apr 20 2012, 22:39:59) [GCC 4.6.3] on linux2 Type help, copyright, credits or license for more information. import locale

[issue15276] unicode format does not really work in Python 2.x

2012-07-08 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: I confirm the bug on 2.7. $ ./python Python 2.7.3+ (2.7:ab9d6c4907e7+, Apr 25 2012, 20:02:36) [GCC 4.4.3] on linux2 Type help, copyright, credits or license for more information. import locale locale.setlocale(locale.LC_NUMERIC,

[issue15276] unicode format does not really work in Python 2.x

2012-07-07 Thread Ariel Ben-Yehuda
New submission from Ariel Ben-Yehuda arie...@mail.tau.ac.il: unicode formats (u'{:n}'.format) in python 2.x assume that the thousands seperator is in ascii, so this fails: import locale locale.setlocale(locale.LC_NUMERIC, 'fra') # or fr_FR on UNIX u'{:n}'.format(1) Traceback (most

[issue15276] unicode format does not really work in Python 2.x

2012-07-07 Thread Chris Jerdonek
Chris Jerdonek chris.jerdo...@gmail.com added the comment: Cf. the related issue 7300: Unicode arguments in str.format(). -- nosy: +cjerdonek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15276

[issue15276] unicode format does not really work in Python 2.x

2012-07-07 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Ariel: would you like to provide a patch? -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15276 ___

[issue15276] unicode format does not really work in Python 2.x

2012-07-07 Thread Ariel Ben-Yehuda
Ariel Ben-Yehuda arie...@mail.tau.ac.il added the comment: I don't work on CPython On Sat, Jul 7, 2012 at 6:57 PM, Martin v. Löwis rep...@bugs.python.orgwrote: Martin v. Löwis mar...@v.loewis.de added the comment: Ariel: would you like to provide a patch? -- nosy: +loewis

[issue15276] unicode format does not really work in Python 2.x

2012-07-07 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15276 ___ ___ Python-bugs-list