Author mnewman
Recipients mnewman
Date 2009-01-17.17:56:54
SpamBayes Score 0.000351107
Marked as misclassified No
Message-id <1232215074.9.0.340477624129.issue4973@psf.upfronthosting.co.za>
In-reply-to
Content
formatyearpage is returning "bytes", not "str"

Python 3.0 (r30:67507, Dec  3 2008, 20:14:27) [MSC v.1500 32 bit
(Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import calendar
>>> calendar.HTMLCalendar().formatyearpage(2009)[0:50]
b'<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE h'
>>> type(calendar.HTMLCalendar().formatyearpage(2009)[0:50])
<class 'bytes'>

# For the time being, to fix it I can use "decode"...
>>> calendar.HTMLCalendar().formatyearpage(2009).decode("utf-8")[0:50]
'<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE h'
>>> type(calendar.HTMLCalendar().formatyearpage(2009).decode("utf-8")[0:50])
<class 'str'>
History
Date User Action Args
2009-01-17 17:57:55mnewmansetrecipients: + mnewman
2009-01-17 17:57:54mnewmansetmessageid: <1232215074.9.0.340477624129.issue4973@psf.upfronthosting.co.za>
2009-01-17 17:56:54mnewmanlinkissue4973 messages
2009-01-17 17:56:54mnewmancreate