From: Martin v. Löwis Date: Wed, 3 Sep 2003 04:53:17 +0000 (+0000) Subject: Use de_DE in example, change message for unknown locale. Fixes #797447. X-Git-Tag: v2.3.1~92 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e24c98a978a72890e4493bb3e1061baed5058865;p=thirdparty%2FPython%2Fcpython.git Use de_DE in example, change message for unknown locale. Fixes #797447. --- diff --git a/Doc/lib/liblocale.tex b/Doc/lib/liblocale.tex index df1f6fd2cbc5..967c75991ea2 100644 --- a/Doc/lib/liblocale.tex +++ b/Doc/lib/liblocale.tex @@ -398,7 +398,7 @@ Example: \begin{verbatim} >>> import locale >>> loc = locale.setlocale(locale.LC_ALL) # get current locale ->>> locale.setlocale(locale.LC_ALL, 'de') # use German locale +>>> locale.setlocale(locale.LC_ALL, 'de_DE') # use German locale; name might vary with platform >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut >>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale >>> locale.setlocale(locale.LC_ALL, 'C') # use default (C) locale diff --git a/Misc/NEWS b/Misc/NEWS index dc76cfe2e5d1..ba9684b6f3c3 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -20,6 +20,8 @@ Core and builtins Extension modules ----------------- +- Bug #797447: Correct confusing error message for unsupported locales. + - Patch #798534: fixed memory leak in os.popen(). - Bug #793826: re-ordered the reference counting code in diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c index 263e88179ef7..980302d4efd7 100644 --- a/Modules/_localemodule.c +++ b/Modules/_localemodule.c @@ -1,5 +1,5 @@ /*********************************************************** -Copyright (C) 1997, 2002 Martin von Loewis +Copyright (C) 1997, 2002, 2003 Martin von Loewis Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, @@ -177,7 +177,7 @@ PyLocale_setlocale(PyObject* self, PyObject* args) result = setlocale(category, locale); if (!result) { /* operation failed, no setting was changed */ - PyErr_SetString(Error, "locale setting not supported"); + PyErr_SetString(Error, "unsupported locale setting"); return NULL; } result_object = PyString_FromString(result);