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 2011年12月06日 13:07 by psam, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (6) | |||
|---|---|---|---|
| msg148915 - (view) | Author: (psam) | Date: 2011年12月06日 13:07 | |
The v2.6 of __enter__() of TimeEncoding has been fixed in v2.7 in relation with the return of setlocale(), but for no apparent reason, its necessary returned value is no more there. Patch: def __enter__(self): self.oldlocale = _locale.getlocale(_locale.LC_TIME) _locale.setlocale(_locale.LC_TIME, self.locale) + return _locale.getlocale(_locale.LC_TIME)[1] |
|||
| msg149165 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年12月10日 16:16 | |
Good catch. The code doesn’t break because there is a check for None later on (certainly because getlocale may return None, but here __enter__ always returns None). How did you find this? If you have a code snippet that reproduces the bug we’ll be able to add it to the test suite before fixing the bug. |
|||
| msg149298 - (view) | Author: (psam) | Date: 2011年12月12日 13:13 | |
The problem was detected in a Django project, as the template engine was not able to support the original encoding. I don't have a real test code snippet, but you may try something like: isinstance(calendar.LocaleTextCalendar(locale='').formatmonth(2011,12),unicode) Note: for Windows, locale='' or locale='fra_FRA' are ok, not locale='fr_FR' or no specified locale. |
|||
| msg149323 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年12月12日 16:06 | |
I don’t know this module well, so I’m adding Georg, who last changed that method, and other people from #10092 to the nosy list. |
|||
| msg180794 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2013年01月27日 20:54 | |
See also issue17049. This is not a theoretical bug. |
|||
| msg180796 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2013年01月27日 21:00 | |
Then you can close one bug as duplicate and commit a fix for the other :) |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:24 | admin | set | github: 57748 |
| 2013年01月28日 17:10:14 | serhiy.storchaka | set | status: open -> closed superseder: calendar throws UnicodeEncodeError when locale is specified resolution: duplicate stage: test needed -> resolved |
| 2013年01月27日 21:00:33 | eric.araujo | set | messages: + msg180796 |
| 2013年01月27日 20:54:39 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg180794 versions: - Python 3.2, Python 3.3 |
| 2011年12月12日 16:06:34 | eric.araujo | set | nosy:
+ twouters, georg.brandl, ixokai, christian.heimes, tim.golden, Retro, r.david.murray, JJeffries messages: + msg149323 |
| 2011年12月12日 13:14:04 | vstinner | set | nosy:
+ vstinner |
| 2011年12月12日 13:13:36 | psam | set | messages: + msg149298 |
| 2011年12月10日 16:16:41 | eric.araujo | set | nosy:
+ eric.araujo title: A return is missing in TimeEncoding of calendar.py -> Return value missing in calendar.TimeEncoding.__enter__ messages: + msg149165 versions: + Python 3.2, Python 3.3 stage: test needed |
| 2011年12月06日 13:07:51 | psam | create | |