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.

Title: Error in standard module calendar
Type: behavior Stage:
Components: Extension Modules Versions: Python 3.0, Python 2.6, Python 2.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: doerwalter Nosy List: christian.heimes, doerwalter, gdamjan
Priority: normal Keywords: patch

Created on 2007-11-11 23:16 by gdamjan, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
calendar.diff gdamjan, 2007-11-11 23:16
calendar_fix.patch christian.heimes, 2007-11-11 23:48
Messages (5)
msg57384 - (view) Author: Damjan Georgievski (gdamjan) Date: 2007-11-11 23:16
This is LocaleTextCalendar.__init__

    def __init__(self, firstweekday=0, locale=None):
        TextCalendar.__init__(self, firstweekday)
        if locale is None:
            locale = locale.getdefaultlocale()
        self.locale = locale

Which can not work, obviosly ... let me hilight the important part
        if locale is None:
            locale = locale.getdefaultlocale()

Attached is a patch that corrects this and keeps the signature of the
method with the locale=None keyword.
msg57386 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-11 23:48
My patch uses "import locale as _locale" to avoid ambiguous variables.
It also fixes some additional bugs. I still don't understand how
prweek() should work. self.week is missing.
msg57387 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-11 23:48
wrong file
msg57390 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-12 01:28
I've applied my patch in r58936 (trunk) and r58937 (2.5 branch).

I'm assigning the bug to Walter. Maybe he is able to shed some light on
the prweek() issue.

$ svn ann Lib/ | grep self\.week
 43483 walter.doerwald         print self.week(theweek, width),
msg57394 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2007-11-12 10:05
Fixed in r58942 (trunk) and r58943 (2.5). Closing the issue.
Date User Action Args
2022-04-11 14:56:28adminsetgithub: 45768
2007-11-12 10:05:17doerwaltersetstatus: open -> closed
resolution: fixed
messages: + msg57394
2007-11-12 01:28:24christian.heimessetassignee: doerwalter
messages: + msg57390
nosy: + doerwalter
2007-11-11 23:48:44christian.heimessetfiles: + calendar_fix.patch
messages: + msg57387
2007-11-11 23:48:28christian.heimessetfiles: - calendar.diff
2007-11-11 23:48:11christian.heimessetfiles: + calendar.diff
versions: + Python 2.6, Python 3.0
nosy: + christian.heimes
messages: + msg57386
priority: normal
keywords: + patch
2007-11-11 23:16:40gdamjancreate