[issue2931] optparse: various problems with unicode and gettext

2020-11-09 Thread STINNER Victor
STINNER Victor added the comment: This issue was reported in 2008 on Python 2.5. The latest comment is about Python 2. The latest Python version is now Python 3.9 and uses Unicode by default. I close the issue since there is no activity for 4 years. More tests are always welcomed, so

[issue2931] optparse: various problems with unicode and gettext

2020-11-06 Thread Irit Katriel
Irit Katriel added the comment: The tests have not been merged yet. -- nosy: +iritkatriel versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.1, Python 3.2 ___ Python tracker

[issue2931] optparse: various problems with unicode and gettext

2016-01-21 Thread Sean Wang
Sean Wang added the comment: This bug still exists in Python 2.7.10 with optparse version 1.5.3. When the default_value is not ASCII encoded, it would raise `UnicodeEncodeError: 'ascii' codec can't encode characters` this error is due to the `str` usage in `expand_default` method: def

[issue2931] optparse: various problems with unicode and gettext

2016-01-21 Thread Sean Wang
Sean Wang added the comment: Sorry, missed one condition: I used `unicode_literals` in Python 2.7.10, example below: >>> from __future__ import unicode_literals >>> str('api名称') Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode characters

[issue2931] optparse: various problems with unicode and gettext

2016-01-21 Thread Sean Wang
Sean Wang added the comment: when an unicode option.default_value could not be ascii encoded, it would throw exception, detailed logs below: File "/Users/seanwang/Documents/dev/foo/bar.py", line 119, in main parser.print_help() File

[issue2931] optparse: various problems with unicode and gettext

2015-04-15 Thread Greg Ward
Greg Ward added the comment: I've turned ash's test program into a bunch of test cases against Python 3.5 trunk. Is it worth committing them? Yeah, probably. Review comments... +try: +self.parser.error(RUSSIAN_TEXT) +except InterceptedError: +pass

[issue2931] optparse: various problems with unicode and gettext

2015-04-13 Thread A.M. Kuchling
A.M. Kuchling added the comment: I've turned ash's test program into a bunch of test cases against Python 3.5 trunk. Is it worth committing them? -- nosy: +akuchling Added file: http://bugs.python.org/file38940/issue2931.txt ___ Python tracker

[issue2931] optparse: various problems with unicode and gettext

2014-02-03 Thread Mark Lawrence
Changes by Mark Lawrence breamore...@yahoo.co.uk: -- nosy: -BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2931 ___ ___

[issue2931] optparse: various problems with unicode and gettext

2011-03-13 Thread Ivan Vilata i Balaguer
Ivan Vilata i Balaguer ivil...@users.sourceforge.net added the comment: After so much time I've checked again with the little script I sent and I see that it doesn't happen under Python 2.7 (2.7.1+), but it does under 2.6 (2.6.6) and 2.5 (2.5.5). --

[issue2931] optparse: various problems with unicode and gettext

2011-03-13 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: I’m afraid 2.5 and 2.6 don’t get bug fixes any more, only security fixes. For 2.7 and 3.x, even if your bug can’t be reproduced, I think it would be useful to add the test to prevent a regression. --

[issue2931] optparse: various problems with unicode and gettext

2011-03-13 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: +1 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2931 ___ ___ Python-bugs-list mailing

[issue2931] optparse: various problems with unicode and gettext

2010-11-06 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: Yep, argparse almost certainly has the same kind of problems - I basically copied the optparse gettext behavior into argparse because I don't really know how that stuff works but figured people must have wanted what was in there. ;-)

[issue2931] optparse: various problems with unicode and gettext

2010-11-05 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: It would be nice to test argparse for the same behavior. -- nosy: +bethard, eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2931

[issue2931] optparse: various problems with unicode and gettext

2010-07-18 Thread Mark Lawrence
Mark Lawrence breamore...@yahoo.co.uk added the comment: Alexy, there would be a much better chance of getting this accepted if you could supply a patch file that also included unit tests. -- nosy: +BreamoreBoy, aronacher versions: +Python 3.1, Python 3.2 -Python 2.6

[issue2931] optparse: various problems with unicode and gettext

2009-07-09 Thread Alexey Shamrin
Changes by Alexey Shamrin sham...@gmail.com: -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2931 ___ ___ Python-bugs-list

[issue2931] optparse: various problems with unicode and gettext

2009-07-08 Thread Alexey Shamrin
Alexey Shamrin sham...@gmail.com added the comment: More than a year passed since I reported this... Could someone suggest how to move this forward? If needed, I can try to improve patch, test or description of this issue. Should I, for example, split this into separate issues? --

[issue2931] optparse: various problems with unicode and gettext

2009-05-16 Thread Daniel Diniz
Changes by Daniel Diniz aja...@gmail.com: -- nosy: +ezio.melotti, haypo, loewis priority: - normal stage: - patch review type: - behavior versions: +Python 2.6 -Python 2.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2931

[issue2931] optparse: various problems with unicode and gettext

2008-06-18 Thread Ivan Vilata i Balaguer
Ivan Vilata i Balaguer [EMAIL PROTECTED] added the comment: The attached version of ``optparse_unicode.py`` doensn't depend on a UTF-8 locale, sorry. Added file: http://bugs.python.org/file10650/optparse_unicode2.py ___ Python tracker [EMAIL PROTECTED]

[issue2931] optparse: various problems with unicode and gettext

2008-06-17 Thread Sam Pablo Kuper
Sam Pablo Kuper [EMAIL PROTECTED] added the comment: Using non-ASCII characters in an optparse help string also causes UnicodeDecodeErrors. Here's the relevant part of the traceback: File /home/spk30/opt/ActivePython-2.5/lib/python2.5/optparse.py, line 1655, in print_help

[issue2931] optparse: various problems with unicode and gettext

2008-06-17 Thread Alexey Shamrin
Alexey Shamrin [EMAIL PROTECTED] added the comment: sampablokuper, I don't think your problem is relevant to this issue. In addition to encoding declaration you should use unicode strings: uyour non-ASCII text. Or wait for Python 3.0, where strings will be unicode by default.

[issue2931] optparse: various problems with unicode and gettext

2008-06-17 Thread Sam Pablo Kuper
Sam Pablo Kuper [EMAIL PROTECTED] added the comment: ash, you are correct; my bad. Thanks for the heads-up. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2931 ___

[issue2931] optparse: various problems with unicode and gettext

2008-05-20 Thread Alexey Shamrin
Alexey Shamrin [EMAIL PROTECTED] added the comment: I've also attached a patch that fixes all these issues and also allows the word error to be translated with gettext. Regarding the use of `locale.getpreferredencoding` instead of `sys.getdefaultencoding`. On my system (Windows XP, Russian) I