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.
Created on 2008年06月08日 08:44 by georg.brandl, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| wcsftime.diff | loewis, 2009年05月29日 17:29 | |||
| Messages (11) | |||
|---|---|---|---|
| msg67828 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2008年06月08日 08:44 | |
It decodes the system strftime's result using TZNAME_ENCODING which is also used to decode timezone names. This may be correct for timezone names themselves (I don't know), but the strftime result is encoded in the LC_TIME encoding - at least on my Linux system. |
|||
| msg86949 - (view) | Author: Jeroen Ruigrok van der Werven (asmodai) * (Python committer) | Date: 2009年05月02日 14:53 | |
As C99 section 7.23.3.5 states: "Each conversion specifier is replaced by appropriate characters as described in the following list. The appropriate characters are determined using the LC_TIME category of the current locale and by the values of zero or more members of the broken-down time structure pointed to by timeptr, as specified in brackets in the description." |
|||
| msg87295 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2009年05月05日 22:31 | |
Is it possible to find out what specific encoding is being used? In most cases, nl_langinfo(CODESET) would be the right choice, but that depends on the LC_CTYPE category. If available, wcsftime should be used. In any case, I think issue5903 and issue5562 are related. We should close some of them as duplicates. |
|||
| msg88518 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2009年05月29日 17:29 | |
Here is a patch that resolves this issue for systems supporting wcsftime, which should be the majority of systems on which the problem can occur. |
|||
| msg88521 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2009年05月29日 18:44 | |
The patch looks good. (Can this be tested?) |
|||
| msg88524 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2009年05月29日 19:29 | |
It's difficult to test. The only test I can think of is one that gets skipped if the fr_FR (say) locale is not configured. The test would then try to find out what the name of February is, which should return a string (see issue5562). |
|||
| msg88532 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2009年05月29日 20:31 | |
Can you use test_support.run_with_locale? |
|||
| msg88547 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2009年05月29日 22:52 | |
Benjamin Peterson wrote: > Benjamin Peterson <benjamin@python.org> added the comment: > > Can you use test_support.run_with_locale? I don't think so. IIUC, run_with_locale will fallback to not setting the locale if none of the listed locales actually works on the system. This would be undesirable for this issue - it would be a proper test only if you have a locale for which strftime currently fails (i.e. returns non-ASCII characters, and doesn't use UTF-8). |
|||
| msg88548 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2009年05月29日 22:55 | |
2009年5月29日 Martin v. Löwis <report@bugs.python.org>: > > Martin v. Löwis <martin@v.loewis.de> added the comment: > > Benjamin Peterson wrote: >> Benjamin Peterson <benjamin@python.org> added the comment: >> >> Can you use test_support.run_with_locale? > > I don't think so. IIUC, run_with_locale will fallback to not > setting the locale if none of the listed locales actually works > on the system. This would be undesirable for this issue - it > would be a proper test only if you have a locale for which > strftime currently fails (i.e. returns non-ASCII characters, > and doesn't use UTF-8). Well, I think you should just apply the patch then. |
|||
| msg88564 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2009年05月30日 06:16 | |
Committed as r73043, r73044 |
|||
| msg99981 - (view) | Author: tejas (tejas81) | Date: 2010年02月24日 00:34 | |
I came onto this ticket via #5562, does anyone know of a similar ticket/bugfix for Python 2.6? |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:35 | admin | set | github: 47311 |
| 2010年11月24日 01:29:04 | jcea | set | nosy:
+ jcea |
| 2010年02月24日 00:34:39 | tejas81 | set | nosy:
+ tejas81 messages: + msg99981 |
| 2009年05月30日 06:16:15 | loewis | set | status: open -> closed resolution: fixed messages: + msg88564 |
| 2009年05月29日 22:55:24 | benjamin.peterson | set | messages: + msg88548 |
| 2009年05月29日 22:52:33 | loewis | set | messages: + msg88547 |
| 2009年05月29日 20:31:56 | benjamin.peterson | set | messages: + msg88532 |
| 2009年05月29日 20:20:05 | r.david.murray | set | versions: + Python 3.1 |
| 2009年05月29日 19:29:58 | loewis | set | messages: + msg88524 |
| 2009年05月29日 18:44:59 | benjamin.peterson | set | nosy:
+ benjamin.peterson messages: + msg88521 |
| 2009年05月29日 17:29:05 | loewis | set | priority: high -> release blocker files: + wcsftime.diff messages: + msg88518 keywords: + patch |
| 2009年05月29日 16:37:51 | loewis | link | issue5562 superseder |
| 2009年05月29日 16:37:20 | loewis | link | issue5903 superseder |
| 2009年05月12日 14:15:44 | ezio.melotti | set | nosy:
+ ezio.melotti |
| 2009年05月05日 22:31:18 | loewis | set | messages: + msg87295 |
| 2009年05月02日 14:53:08 | asmodai | set | nosy:
+ asmodai messages: + msg86949 |
| 2008年06月08日 08:44:29 | georg.brandl | create | |