Programming Python, 2nd Edition by Mark Lutz Unconfirmed error reports are from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. This page was updated June 24, 2003. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification UNCONFIRMED errors and comments from readers: {28} 2nd paragraph - 8th line from bottom of page; os.getcwd() shows that the current working directory is: 'C:\\PP2ndEd\\cdrom\\WindowsExt' os.path.abspath(r'..\examples') shows: 'C:\\PP2ndEd\\examples' but should be: 'C:\\PP2ndEd\\cdrom\examp (29) 2nd paragraph; The third line is missing the verb 'is'. It reads: 'in this chapter, but since this a key concept employed...' It should read: 'in this chapter, but since this is a key concept employed...' {32} 2nd code line; The "python" is missing. It should be os.system("start python program.py arg arg") instead of os.system("start program.py arg arg"). {35} last code block; The current directory shown on the command prompt is incorrect in the final section of the example. It shows "C:\PP2ndEd\examples\PP2E\System>" but that's not the directory we were left in from the previous step, and if that really was our directory, the command entered (cd PP2E\System\App) wouldn't work. It should be: C:\PP2ndEd\examples>cd PP2E\System\App C:\PP2ndEd\examples\PP2E\System\App>python ..\whereami.py (42) 3rd paragraph, line -2; Change: To demonstrate this how this works, we need a couple... To: To demonstrate how this works, we need a couple... (remove the first 'this') (47) 2nd code block: reader.py; The program reader.py says: print 'Got this" "%s"' % raw_input() This isn't a bug, but almost surely it was supposed to be: print 'Got this: "%s"' % raw_input() The sample output accurately reflects the program, but if you change the program be sure to change the output: Got this: "Help! Help! I'm being repressed!" instead of: Got this" "Help! Help! I'm being repressed!" (51) 2nd to last paragraph; It should either be "bind a keyboard-press event" or "bind keyboard press events" instead of "bind keyboard-press event to run callbacks". {57} Note at bottom of page; The print-to-file statement is missing a comma. It should be "print >>file, stuff". [60] Example under "Closing" paragraph, just under middle of page; The example currently reads: open('somefile.txt').write("G'day Bruce\n") This raises an exception. The example should read: open("somefile.txt", "w").write("G'day Bruce\n") (382) 1st paragraph, 3rd line; ... ScolledText ... should be ... ScrolledText ... {390} 1st code listing on the page, 2nd string; Wrong comments in the code: ...# two opposite box corner ...# two opposite oval corner should be ...# two opposite oval corner ...# two opposite arc corner (469) 3rd-to-last line; Probably line ('ariel', 10+FontScale, 'normal'), should be: ('arial', 10+FontScale, 'normal'), This typo exist in file PP2E\Gui\TextEditor\textEditor.py on CD too. {575} 1st paragraph after "Using urllib to FTP files" header; There are URL definition in the 4th line of this paragraph: ... a URL, or Universal Resource Locator... It's very common problem with URL. Everyone calls it "Universal", but naturally it is "Uniform". :-) I have seen this typo in many books... There should be: ... a URL, or Uniform Resource Locator... (961) 3rd 'paragraph' from bottom of page; The word "effected" in the sentence "For DML statements, execute returns the number of rows effected." should be "affected". {1098} "else" branch in function "message"; The code contains a possible buffer overflow error Instead of strcpy(result, "Hello, "); strcat(result, fromPython); a better (and shorter) solution might be sprintf(result,"Hello, %.56s",fromPython); {1155} last paragraph of the code example "embed-string.c"; Hi! Reading your Extending / Embedding Chapters I found the following: As described the code 'embed-string.c' shall also show the correct use of the Py_DECREF(obj) usage - to keep the environment clean. But you cast the return value of the last PyRun_String(...) away: (void) Py_RunString(...) like above with the object 'pstr' PyRunString generally returns a new reference that's lost now, or? So we have produced a memory leak with this kind of code. The correct code should be IMHO Py_DECREF( Py_RunString(...) ) INDEX: (1255) "zipfile module": zipfile says it's on 1209, but it's really on 1210. I've seen other index problems like this one.