[issue5815] locale.getdefaultlocale() missing corner case

2013-12-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3d805bee06e2 by Serhiy Storchaka in branch '2.7': Issue #5815: Fixed support for locales with modifiers. Fixed support for http://hg.python.org/cpython/rev/3d805bee06e2 New changeset 28883e89f335 by Serhiy Storchaka in branch '3.3': Issue #5815:

[issue5815] locale.getdefaultlocale() missing corner case

2013-12-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Committed without devanagari special case and tests. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5815 ___

[issue5815] locale.getdefaultlocale() missing corner case

2013-12-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For devanagari modifier opened new issue20027. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5815

[issue5815] locale.getdefaultlocale() missing corner case

2013-12-19 Thread STINNER Victor
STINNER Victor added the comment: Buildbot failure: http://buildbot.python.org/all/builders/x86%20Gentoo%20Non-Debug%203.3/builds/1314/steps/test/logs/stdio == ERROR: test_locale_alias (test.test_locale.NormalizeTest)

[issue5815] locale.getdefaultlocale() missing corner case

2013-12-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset e0675408f4af by Serhiy Storchaka in branch '2.7': Don't use sebTest() in tests for issue #5815. http://hg.python.org/cpython/rev/e0675408f4af New changeset ed16f6695638 by Serhiy Storchaka in branch '3.3': Don't use sebTest() in tests for issue

[issue5815] locale.getdefaultlocale() missing corner case

2013-12-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, thanks Victor. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5815 ___

[issue5815] locale.getdefaultlocale() missing corner case

2013-12-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Marc-Andre, do you have comments or objections? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5815 ___ ___

[issue5815] locale.getdefaultlocale() missing corner case

2013-12-18 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 18.12.2013 22:57, Serhiy Storchaka wrote: Marc-Andre, do you have comments or objections? Your last patch looks fine, but I don't have time to test it. Regarding the broken *devanagari* entries in the alias table: I think we should remove or correct

[issue5815] locale.getdefaultlocale() missing corner case

2013-11-12 Thread Mike FABIAN
Mike FABIAN added the comment: Serhiy While normalize can return sd...@devanagari.utf-8, _parse_localename() Serhiy should be able correctly parse it. But if normalize returns sd...@devanagari.utf-8, isn’t that quite useless because it is a locale name which does not actually work in glibc?

[issue5815] locale.getdefaultlocale() missing corner case

2013-11-11 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Then I don't understand changes such as: -'chinese-s':'zh_CN.eucCN', +'chinese-s':'zh_CN.gb2312', or -'sp': 'sr_CS.ISO8859-5', -'sp_yu':

[issue5815] locale.getdefaultlocale() missing corner case

2013-11-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: That's not intended. The normalize() function is supposed to prepare the locale for the lookup. It's not supposed to be applied to the looked up value. Last patch doesn't contain this part of tests. -- ___ Python

[issue5815] locale.getdefaultlocale() missing corner case

2013-11-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are no such systems really, in X.org this is just a mistake. glibc doesn’t write it like this and it is agains the specification here: While normalize can return sd...@devanagari.utf-8, _parse_localename() should be able correctly parse it. Removing

[issue5815] locale.getdefaultlocale() missing corner case

2013-11-11 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 11.11.2013 20:21, Serhiy Storchaka wrote: That's not intended. The normalize() function is supposed to prepare the locale for the lookup. It's not supposed to be applied to the looked up value. Last patch doesn't contain this part of tests.

[issue5815] locale.getdefaultlocale() missing corner case

2013-11-10 Thread Mike FABIAN
Mike FABIAN added the comment: Serhiy, in your patch you seem to have special treatment for the devanagari modifier: +# Devanagari modifier placed before encoding. +return code, modifier.split('.')[1] Probably because of 'ks_in@devanagari':

[issue5815] locale.getdefaultlocale() missing corner case

2013-11-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The /usr/share/X11/locale/locale.alias file in Ubuntu 12.04 LTS contains ks...@devanagari.utf-8 and sd...@devanagari.utf-8 entities. While the encoding is expected to be before the modifier, if there are systems with ks...@devanagari.utf-8 or

[issue5815] locale.getdefaultlocale() missing corner case

2013-11-10 Thread Mike FABIAN
Mike FABIAN added the comment: Serhiy The /usr/share/X11/locale/locale.alias file in Ubuntu 12.04 LTS Serhiy contains ks...@devanagari.utf-8 and sd...@devanagari.utf-8 Serhiy entities. Yes, I know, that’s why I wrote that the Python code inherited this mistake from X.org. Serhiy While the

[issue5815] locale.getdefaultlocale() missing corner case

2013-11-10 Thread Mike FABIAN
Mike FABIAN added the comment: In glibc, sd...@devanagari.utf-8 is an invalid locale name, only sd_IN.UTF-8@devanagari is valid: mfabian@ari:~ $ LC_ALL=sd_IN.UTF-8@devanagari locale charmap UTF-8 mfabian@ari:~ $ LC_ALL=sd...@devanagari.utf-8 locale charmap locale: Cannot set LC_CTYPE to default

[issue5815] locale.getdefaultlocale() missing corner case

2013-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping. There are two duplicate issues opened last month. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5815 ___

[issue5815] locale.getdefaultlocale() missing corner case

2013-10-22 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5815 ___ ___ Python-bugs-list

[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Patch updated. Added tests. The locale_alias mapping updated to be self-consistency (i.e. for every name in locale_alias.values() normalize(name) == name). -- assignee: docs@python - serhiy.storchaka keywords: -easy nosy: +lemburg stage: needs

[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread R. David Murray
R. David Murray added the comment: It would be great if this could get a review by MAL, since it looks like a non-trivial change. Also, you have some (commented out) debug prints in there. -- ___ Python tracker rep...@bugs.python.org

[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 13.09.2013 15:30, Serhiy Storchaka wrote: Serhiy Storchaka added the comment: Patch updated. Added tests. The locale_alias mapping updated to be self-consistency (i.e. for every name in locale_alias.values() normalize(name) == name). Could you

[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Also, you have some (commented out) debug prints in there. These debug prints were in old code. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5815

[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread R. David Murray
R. David Murray added the comment: Ah, I see. I only scanned the patch quickly, obviously. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5815 ___

[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you elaborate on the alias changes ? Were those coming from an updated X11 local.alias file ? No, they are not from X11 local.alias file. They are a result of the test_locale_alias self-test, I have fixed all failures. This test can't be backported

[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch without changes to locale_alias. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5815 ___ ___

[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file31742/locale_parse_2a.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5815 ___

[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 13.09.2013 16:34, Serhiy Storchaka wrote: Serhiy Storchaka added the comment: Could you elaborate on the alias changes ? Were those coming from an updated X11 local.alias file ? No, they are not from X11 local.alias file. They are a result of

[issue5815] locale.getdefaultlocale() missing corner case

2013-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Then I don't understand changes such as: -'chinese-s':'zh_CN.eucCN', +'chinese-s':'zh_CN.gb2312', or -'sp': 'sr_CS.ISO8859-5', -'sp_yu':

[issue5815] locale.getdefaultlocale() missing corner case

2013-07-06 Thread Dmitry Jemerov
Dmitry Jemerov added the comment: A related issue (a case which isn't taken into account by Serhiy's patch) is http://bugs.python.org/issue18378 -- nosy: +Dmitry.Jemerov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5815

[issue5815] locale.getdefaultlocale() missing corner case

2012-10-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5815 ___ ___

[issue5815] locale.getdefaultlocale() missing corner case

2012-07-14 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Here is yet some inconsistency: $ LANG=uk_ua.microsoftcp1251 ./python -c import locale; print(locale.getdefaultlocale()) ('uk_UA', 'CP1251') $ LANG=uk_ua.microsoft-cp1251 ./python -c import locale; print(locale.getdefaultlocale())

[issue5815] locale.getdefaultlocale() missing corner case

2012-07-14 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Here is a complex patch for more careful locale parsing. -- Added file: http://bugs.python.org/file26380/locale_parse.patch ___ Python tracker rep...@bugs.python.org

[issue5815] locale.getdefaultlocale() missing corner case

2012-07-11 Thread rg3
rg3 sarbalap+freshm...@gmail.com added the comment: I don't know if the behavior is considered a bug or just undocumented, but under Python 2.7.3 it's still the same. locale.getpreferredencoding() does return UTF-8, but the second element in the tuple locale.getdefaultlocale() is

[issue5815] locale.getdefaultlocale() missing corner case

2012-07-11 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: The patch is not work for ca_ES@valencia locale. And there are issues for such locales: ks_in@devanagari, ks...@devanagari.utf-8, sd, sd...@devanagari.utf-8 (ks_in@devanagari in locale_alias maps to ks...@devanagari.utf-8 and sd to

[issue5815] locale.getdefaultlocale() missing corner case

2012-07-07 Thread Greg Roodt
Greg Roodt gro...@gmail.com added the comment: Bumping this as part of a bug scrub at EuroPython. Is this still an issue? Should we fix in docs or in code? -- nosy: +groodt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5815

[issue5815] locale.getdefaultlocale() missing corner case

2011-11-28 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- keywords: +easy versions: +Python 3.2, Python 3.3 -Python 2.6, Python 3.0, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5815

[issue5815] locale.getdefaultlocale() missing corner case

2009-04-22 Thread rg3
New submission from rg3 sarbalap+freshm...@gmail.com: A recent issue with one of my programs has shown that locale.getdefaultlocale() does not handle correctly a corner case. The issue URL is this one: http://bitbucket.org/rg3/youtube-dl/issue/7/ Essentially, some users have LANG set to

[issue5815] locale.getdefaultlocale() missing corner case

2009-04-22 Thread rg3
rg3 sarbalap+freshm...@gmail.com added the comment: I just realized that the if I introduced is not really needed. encoding = encoding.split('@')[0] works whether the '@' symbol is present or not. -- ___ Python tracker rep...@bugs.python.org

[issue5815] locale.getdefaultlocale() missing corner case

2009-04-22 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I wasn't able to reproduce this by just setting my LC_ALL environment variable to es_ca.ut...@valencia and calling getdefaultlocale. Can you provide more complete steps to reproduce? -- nosy: +r.david.murray priority: - normal

[issue5815] locale.getdefaultlocale() missing corner case

2009-04-22 Thread rg3
rg3 sarbalap+freshm...@gmail.com added the comment: You are right. The issue is not reproduced with es_ca.ut...@valencia but with ca_es.ut...@valencia. The fact that the first case works makes me think maybe there's another way to solve the problem. Can you check that? --

[issue5815] locale.getdefaultlocale() missing corner case

2009-04-22 Thread rg3
rg3 sarbalap+freshm...@gmail.com added the comment: Further investigation: The guy who had this issue may be from Valencia, Spain. According to the manpage for setlocale(3) in my system, the form is usually language[_territory][.codese...@modifier]. So, in this case, it would make sense for the

[issue5815] locale.getdefaultlocale() missing corner case

2009-04-22 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: OK, it turns out that this is one of a class of known bugs of long standing (see issue554676 and issue1080864, for example). The recommended solution is to not use locale.getdefaultlocale, but to use locale.getperferredencoding. I have

[issue5815] locale.getdefaultlocale() missing corner case

2009-04-22 Thread rg3
rg3 sarbalap+freshm...@gmail.com added the comment: Excellent. Thanks for the tip. I'll now proceed to modify my code to use getpreferredencoding. Still, I think getdefaultlocale should work because it could be used in other situations, I suppose. --