From ac644ce99b609261feb9675094b1121fbbf0fd0a Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Fri, 17 Jul 2009 11:46:11 -0400 Subject: [PATCH] typo --- files.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files.html b/files.html index 44f6a39..7c2a0d9 100644 --- a/files.html +++ b/files.html @@ -53,7 +53,7 @@ body{counter-reset:h1 12} File "C:\Python31\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 28: character maps to <undefined> ->>> /samp> +>>>

What just happened? You didn’t specify a character encoding, so Python is forced to use the default encoding. What’s the default encoding? If you look closely at the traceback, you can see that it’s dying in cp1252.py, meaning that Python is using CP-1252 as the default encoding here. (CP-1252 is a common encoding on computers running Microsoft Windows.) The CP-1252 character set doesn’t support the characters that are in this file, so the read fails with an ugly UnicodeDecodeError.