Errata

Think Python

Errata for Think Python, Third Edition

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page Page 110 Reading of file error
Bottom of page

I downloaded the Dracula book (PG.345.txt) from Gutenberg.org. I ran the program using the Python IDLE editor I call the program test2. Python says there a decoding error reading a byte in the file. The error message is below.

Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>
==== RESTART: C:\Users\EDLit\AppData\Local\Programs\Python\Python39\test2.py ===
Traceback (most recent call last):
File "C:\Users\EDLit\AppData\Local\Programs\Python\Python39\test2.py", line 7, in <module>
for line in reader:
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\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 0x9d in position 1956: character maps to <undefined>

Edward Litfin  Sep 20, 2025 
Printed Page Page 110
Bottom of page see my above errata.

The only way I can read this file using the python IDLE editor is with the following line. This is an update from the above errata I wrote.

reader = open('pg345.txt', encoding = ' uft-8' )

Edward Litfin  Oct 10, 2025 
Printed Page 226
5th paragraph of text

The method int_to_time() is incorrectly referred to as “Time.from_seconds”, but it should be “Time.int_to_time”.

Symeon Waseen  Dec 08, 2025