New submission from inefab:
The function HTMLCalendar.formatyearpage in module calendar takes at
most 5 arguments (year, month, css, encoding) whereas documentation
(http://docs.python.org/lib/module-calendar.html) says it takes at most
6 (theyear, themonth[, width[, css[, encoding]]]).
Also, the title tag in the head of the produced document with (year,
month, css) as arguments isn't properly closed ; the line is
<title>Calendar for 2008</title
when it should be
<title>Calendar for 2008</title>
This happend with linux (debian sid), with Python 2.5.1
Note: I haven't tested if the encoding did what it should
Joined files :
- HTMLyearbug.py: reproduces the bug
- 2008cal.html: the output produced by this file
----------
components: Extension Modules
files: cal.py
messages: 55376
nosy: inefab
severity: normal
status: open
title: HTMLCalendar.formatyearpage not behaving as documented
type: behavior
versions: Python 2.5
__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1046>
__________________________________
#requires python 2.5
from calendar import HTMLCalendar as Cal
## head = open('head','r')
## foot = open('foot','r')
firstmonth = 1
lastmonth = 12
year = 2008
a = Cal(0)
## for month in xrange(firstmonth, lastmonth+1):
## if month < 10:
## out = open(str(year) + ' - 0' + str(month), 'w') #add a leading 0
## else:
## out = open(str(year) + ' - ' + str(month), 'w')
## out.write(a.formatmonth(year, month, 1))
## out.close()
out = open(str(year), 'w')
out.write(a.formatyearpage(year, 1, 3, 'cal.css'))
out.close()
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com