[issue6895] locale._parse_localename fails when localename does not contain encoding information
Changes by Terry J. Reedy tjre...@udel.edu: -- resolution: - out of date stage: - resolved status: open - closed versions: -Python 2.6, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Mark Lawrence added the comment: I agree with the sentiment expressed in msg218513 and would close this as out of date. -- nosy: +BreamoreBoy status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Serhiy Storchaka added the comment: For now the output of the code in msg132878 on Ubuntu is empty. May be this issue is outdated. -- nosy: +serhiy.storchaka status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Changes by Stefan Krah stefan-use...@bytereef.org: -- nosy: -skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: Stefan, theoretically this is A valid locale description (as understood by S-SYS) is: language[_TERRITORY[.CODESET[@Modifier]]] where language is indeed a ISO 639 language code (see doc/iso639.txt) and _TERRITORY is indeed a ISO 3166 country code (see doc/iso3166.txt). .. The ISO3166 Maintenance Agency can be found at: # http://www.iso.ch/iso/en/prods-services/iso3166ma/index.html .. http://www.loc.gov/standards/iso639-2/ A good UNIX has copies of the files in /usr/share/misc/{iso639,iso3166}. I may be out-of-date a bit, though. (And: this is not about Python, of course.) -- nosy: +sdaoden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Marc-Andre Lemburg m...@egenix.com added the comment: Stefan Krah wrote: Stefan Krah stefan-use...@bytereef.org added the comment: Is there another (authoritative) source for locale aliases apart from X.org? On Ubuntu Lucid, many aliases for installed locales are missing: f = open(/var/lib/locales/supported.d/local) locale_list = [loc.split()[0] for loc in f.readlines() \ if not loc.startswith('#')] for loc in locale_list: x = locale.setlocale(locale.LC_ALL, loc) try: y = locale.getlocale() except ValueError: print(loc) aa_DJ Hmm, I get: Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python2.6/locale.py, line 513, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting The local file you mention only contains en_US.UTF-8 UTF-8 on our Ubuntu 10.04.1 default installation. Have you installed some other package to get support for all those locales ? -- title: locale._parse_localename fails when localename does not contain encoding information - locale._parse_localename fails when localename does not contain encoding information ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Stefan Krah stefan-use...@bytereef.org added the comment: Marc-Andre Lemburg rep...@bugs.python.org wrote: The local file you mention only contains en_US.UTF-8 UTF-8 on our Ubuntu 10.04.1 default installation. Have you installed some other package to get support for all those locales ? On Ubuntu it is a bit messy: cp /usr/share/i18n/SUPPORTED /var/lib/locales/supported.d/local locale-gen On Debian it should be: # Select 'all' in the dialog dpkg-reconfigure locales Stefan Krah -- title: locale._parse_localename fails when localename does not contain encoding information - locale._parse_localename fails when localename does not contain encoding information ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Changes by Steffen Daode Nurpmeso sdao...@googlemail.com: -- nosy: -sdaoden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Stefan Krah stefan-use...@bytereef.org added the comment: Is there another (authoritative) source for locale aliases apart from X.org? On Ubuntu Lucid, many aliases for installed locales are missing: f = open(/var/lib/locales/supported.d/local) locale_list = [loc.split()[0] for loc in f.readlines() \ if not loc.startswith('#')] for loc in locale_list: x = locale.setlocale(locale.LC_ALL, loc) try: y = locale.getlocale() except ValueError: print(loc) aa_DJ aa_ER aa_ER@saaho aa_ET an_ES ar_IN ast_ES ber_DZ ber_MA bn_BD bo_CN bo_IN byn_ER ca_ES@valencia crh_UA csb_PL dv_MV dz_BT el_CY en_AG en_DK en_NG eu_FR fil_PH fur_IT fy_NL fy_DE gez_ER gez_ER@abegede gez_ET gez_ET@abegede ha_NG hne_IN hsb_DE ht_HT hy_AM ia ig_NG ik_CA kk_KZ kk_KZ ks_IN ks_IN@devanagari ku_TR lg_UG li_BE li_NL mai_IN mg_MG ml_IN mn_MN my_MM nan_TW@latin nds_DE nds_NL ne_NP nl_AW om_ET om_KE or_IN pa_PK pap_AN ps_AF sa_IN sc_IT sd_IN sd_IN@devanagari shs_CA sid_ET so_DJ so_ET so_KE so_SO te_IN ti_ER ti_ET tig_ER tk_TM tr_CY tt...@iqtelif.utf-8 ug_CN wal_ET wo_SN yo_NG zh_SG -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Santhosh Thottingal santhosh.thottin...@gmail.com added the comment: I see that the ml_IN added to locale.alias of X.org. lemburg, Do you think that my patch is still required as a fallback solution in case xx_YY mapping not found in locale.alias? If you can confirm that it is not required, we can close this bug. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Changes by Brian Curtin cur...@acm.org: -- type: crash - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Changes by Barry A. Warsaw ba...@python.org: -- versions: +Python 2.6, Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Martin v. Löwis mar...@v.loewis.de added the comment: Assigning to MAL, as this is his code. -- assignee: loewis - lemburg nosy: +lemburg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Marc-Andre Lemburg m...@egenix.com added the comment: The reason this call fails is that there's no locale alias defined for ml_IN in the local_alias dictionary. While the patch is probably a good idea, it also hides the missing mapping. I think a better approach would be to check the locale name for standards compliance (ie. xx_YY format) and only then use it as fallback solution. I'll update the locale_alias dictionary to the X.org version 2009-12-08 (unless you know an even more recent version). This includes the missing 'ml_IN' mapping (among a few other additions and updates). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Santhosh Thottingal santhosh.thottin...@gmail.com added the comment: Attached the testcases as a patch to Lib/test/test_locale.py -- Added file: http://bugs.python.org/file14915/test_locale.py.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Changes by Georg Brandl ge...@python.org: -- assignee: - loewis nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: If you provide a test case the patch has a greater chance of being accepted. -- nosy: +gagenellina ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6895] locale._parse_localename fails when localename does not contain encoding information
New submission from Santhosh Thottingal santhosh.thottin...@gmail.com: locale._parse_localename fails when the locale name is in xx_YY format. For example when the system locale is Malayalam(India), ml_IN we get the following result locale._parse_localename(ml_IN) Traceback (most recent call last): File stdin, line 1, in module File /opt/python311/lib/python3.1/locale.py, line 424, in _parse_localename raise ValueError('unknown locale: %s' % localename) ValueError: unknown locale: ml_IN The expected result is ('ml_IN', None) For Latin languages, locale.py assumes iso-8859-15 as the encoding type if encoding type is not given in localename. In case of other locales, None can be returned for encoding type. Attached patch fixes this. The result after applying patch to locale.py import locale locale._parse_localename(ml_IN) ('ml_IN', None) -- components: Library (Lib) files: locale.py-parselocale-patch.diff keywords: patch messages: 92546 nosy: santhosh.thottingal severity: normal status: open title: locale._parse_localename fails when localename does not contain encoding information type: crash versions: Python 3.1 Added file: http://bugs.python.org/file14881/locale.py-parselocale-patch.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6895 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com