This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Time module: effect of locale
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: belopolsky, docs@python, python-dev, r.david.murray, terry.reedy, vstinner
Priority: normal Keywords:

Created on 2012-09-13 18:03 by terry.reedy, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg170448 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2012-09-13 18:03
"Module locale 
Internationalization services. The locale settings can affect the return values for some of the functions in the time module."

This is vague and perhaps misleading. The doc also says
"Locale information is not used by asctime()."
"Locale information is not used by ctime()."

Since ctime() = asctime(localtime()), this implies to me that locale is also not used by localtime. Otherwise, locale information would indirectly be used by ctime. (I did not test this directly because I do not know what a legal locale name is on Windows. The doc example 'de_DE' does not work.)

Doc also says
"time.strftime(format[, t]) 
%a Locale’s abbreviated weekday name. 
... <similar for many other format characters>
"

So perhaps the doc should say "The locale setting affects the interpretation of many format specifiers in strftime and strptime".

If is does anything else, what?
msg170452 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-09-13 18:32
Since localtime() returns numbers, it is trivially true that localtime is not affected by locale.

Your more specific phrasing is correct, I think.
msg185937 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-04-03 16:50
New changeset ee5add45bf9d by Terry Jan Reedy in branch '3.3':
Issue #15940: Specify effect of locale on time functions.
http://hg.python.org/cpython/rev/ee5add45bf9d

New changeset 5ffb808683e1 by Terry Jan Reedy in branch '2.7':
Issue #15940: Specify effect of locale on time functions.
http://hg.python.org/cpython/rev/5ffb808683e1

New changeset a6d5fde72843 by Terry Jan Reedy in branch '3.3':
Issue #15940: Replace tab.
http://hg.python.org/cpython/rev/a6d5fde72843

New changeset b7d2cb2214d8 by Terry Jan Reedy in branch '2.7':
Issue #15940: Replace tab.
http://hg.python.org/cpython/rev/b7d2cb2214d8
msg185940 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-04-03 17:25
New changeset 3daa20ce817e by Terry Jan Reedy in branch '3.3':
Issue #15940: NEWS entry
http://hg.python.org/cpython/rev/3daa20ce817e

New changeset be9273375b61 by Terry Jan Reedy in branch '2.7':
Issue #15940: NEWS entry
http://hg.python.org/cpython/rev/be9273375b61
History
Date User Action Args
2022-04-11 14:57:36adminsetgithub: 60144
2013-04-03 17:26:15terry.reedysetstatus: open -> closed
type: behavior
resolution: fixed
stage: needs patch -> resolved
2013-04-03 17:25:13python-devsetmessages: + msg185940
2013-04-03 16:50:46python-devsetnosy: + python-dev
messages: + msg185937
2012-09-13 18:32:28r.david.murraysetnosy: + r.david.murray
messages: + msg170452
2012-09-13 18:03:46terry.reedycreate