Message82120
The following code fails on the print command (see error message bellow
the code). I use windows and run the code under command prompt env.
import urllib.request
if __name__ == "__main__":
sock =
urllib.request.urlopen("http://docs.python.org/3.0/library/html.parser.html#html.parser.HTMLParser.handle_startendtag")
htmlSource = sock.read()
sock.close()
htmlSource = htmlSource.decode("utf-8", "strict")
print(htmlSource)
Error message:
Traceback (most recent call last):
File "parsehomeless.py", line 68, in <module>
print(htmlSource[0:281])
File "C:\Python30\lib\io.py", line 1494, in write
b = encoder.encode(s)
File "C:\Python30\lib\encodings\cp862.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2014' in
position 280: character maps to <undefined> |
|
Date |
User |
Action |
Args |
2009-02-14 21:33:35 | grace | set | recipients:
+ grace |
2009-02-14 21:33:35 | grace | set | messageid: <1234647215.76.0.528170813842.issue5263@psf.upfronthosting.co.za> |
2009-02-14 21:33:34 | grace | link | issue5263 messages |
2009-02-14 21:33:33 | grace | create | |
|