Errata

Python Programming On Win32

Errata for Python Programming On Win32

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 82
3rd paragraph

Does the module "dates.py" actually exist? I couldn't find it on
www.python.org or the vaults of parnassus. It did come with my Python for
Win32 or Python for Unix.

Anonymous   
Printed Page 82
last paragraph

The excercise does not work with the latest Python release from ActiveState
Tools. It cannot find sec2asc() and requires one argument for mktime().
mktime() should have nine arguments.

Anonymous   
Printed Page 83
2nd example code

The comment '# returned in alpha order' should follow the statement 'sales.items()'
instead of 'sales['South']'

Anonymous   
Printed Page 85
IN the third and tenth line of the example, the following lines


>>> T1.date = asc2sec('1/1/1999')
...
>>> T2.date = asc2sec('5-Jan-1999')

Should read as follows:

>>> T1.date = transac.asc2sec('1/1/1999')
...
>>> T2.date = transac.asc2sec('5-Jan-1999')

If not the following error will occur:

Traceback (innermost last):
File "<stdin>", line 1, in ?
NameError: asc2sec

Anonymous   
Printed Page 88

In the first sentence of the third paragraph, the url given for examples, http://starship.python.net/crew/mhammond/ppw32/, is a
deadlink as of 2/6/2000 7 pm est.

Anonymous   
Printed Page 91
In line 6

"renameAccount(seDates lf, oldAcct..." ???

Anonymous   
Printed Page 118
The fourth sentence in the first paragraph in the section titled "Unpacking Variant Arrays"

it now reads: "VarArrayHighBound(array,
dimension) and VarArrayHighBound(array, dimension) are the eqivalents of
UBound() and LBound()."

Should read;

"VarArrayHighBound(array, dimension) and VarArrayLowBound(array,
dimension) are the eqivalents of UBound() and LBound()."

Anonymous   
Printed Page 144
In the second code example on the page delete the extra

>>> x1App.Workbooks(1).Sheets(1).Cells(1,1).Value = "Python Rules!"

which appears as the second-to-last line in the code listing.

Anonymous   
Printed Page 163
bottom line

self.getStyleDictionary()
should be
self.getStyleList()

Anonymous   
Printed Page 165
2nd code snippet

The last 3 lines are missing from addStyledPara() - it should read

def addStyledPara(self, text, stylename):
if text[-1] <> '
':
text = text + '
'

self.wordSel.InsertAfter(text)
self.wordSel.Style = stylename
self.selectEnd()

as per the code in ppw_samples.zip

Anonymous   
Printed Page 208
Label of table 12-2 (at top)

The label for Table 12-2 is back-to-front. It reads:
"Default Python Object to VARIANT Translation"

it should read:
"Default VARIANT to Python Object Translation"

(cf table 12-1 on previous page)

Anonymous   
Printed Page 210
Sample code, constant definition (line 6)

The declared constant FMTID_UserDefinedProperties should really be named
FMTID_SummaryInformation, in order to agree with ObjIdl.h.

Note that the value corresponds to the correct name, so the code still
works fine. It is only the name that is incorrect.

Anonymous   
Printed Page 244

At the bottom of the page, the SQL statement needs to be enclosed in double quotes, or you will get a syntax error. It now reads:

>>> mycursor.execute('UPDATE Invoices SET InvoiceDate={d '1999-04-15' }
WHERE InvoiceID=199904001')

Should read:

>>> mycursor.execute("UPDATE Invoices SET InvoiceDate={d '1999-04-15' }
WHERE InvoiceID=199904001")

Anonymous   
Printed Page 246

In the second paragraph, 'cursor.commit()' should be 'conn.commit()' because commit() is a method of the connection object, not the cursor object.

Anonymous   
Printed Page 252
The second code sample now reads

>>> for i in range(daoRS.Fields.Count):
... daoField =
daoRS.Fields[i] <=====
... print '%s = %s' % (daoField.Name, daoField.Value)

The index in the first line in the if loop should use parens instead of square
brackets, like in the example above the for loop. So it should read:

>>> for i in range(daoRS.Fields.Count):
... daoField =
daoRS.Fields(i) <=====
... print '%s = %s' % (daoField.Name, daoField.Value)

Anonymous   
Printed Page 277
Line 17 in the first code sample now reads

(server_msg, body, octets) = a.retr(1)

Should read:

(server_msg, body, octets) = a.retr(thisNum)

With the code as written, the program will retrieve the first mail message
NumMsgs times instead of retrieving each mail message.

Anonymous   
Printed Page 314
first code example

A *very minor* typo:

The first line in the function compute_size says:
"uses walker3 to compute the size"

It should read:
"uses walker4 to compute the size"

Anonymous   
Printed Page 350
1st paragraph

The name of the paragraph is "Installing, Debugging and Running a Python Service"
but I can't find the Debugging part.
should read:
"Installing and Running a Python Service"

Anonymous   
Printed Page 356
1st paragraph

In the description of the functions that log messages to the NT Event Log, the
text lists LogInfoMsg(), LogErrorMsg(), and LogWarningMessage()--this last does
*not* abbreviate 'Msg' as the others do, and calling it fails with an Attribute
Error stating that LogWarningMessage is not found. The Appendix does list all
three functions as ending in ...Msg() rather than ...Message().

Anonymous   
Printed Page 374
The fourth line of code from the top of the page now reads

"myport.send('ATI15') # ask modem to identify itself"

I suggest this should read:

"myport.write('ATI15') # ask modem to identify itself"

No send method exists my Serial.py module, but a write method is present.
Subsequent examples (p377, bottom third of the page) do not repeat this
mistake: they demonstrate the use of the write method.

Anonymous   
Printed Page 383
1st code section in page

the code line
clientsock.connect('tahoe',8578)

should read
clientsock.connect( ('tahoe',8578) )

Anonymous   
Printed Page 416

On Line 20 of the code sample, there should be a semicolon after the expression:

"frame = MyFrame(NULL, -1, "Hello from wxPython")

Should read:

"frame = MyFrame(NULL, -1, "Hello from wxPython");

Anonymous   
Printed Page 416
On Line 17 of the code sample, the expression reads

"menu.Append(ID_EXIT, "E&xit", "Termainate the program")"

Should read:

"menu.Append(ID_EXIT, "&Exit","Terminate the program")"

Also, menu.AppendSeparator() gets an AttributeError:
(version problem or placement?) I'm new to wxPython,
and these are somewhat obvious errors unless you are
a newbie.

Anonymous   
Printed Page 434
The second line of code on the page now reads:

"dateOK = (date == dates.testasc(date))"

Should read:

"dateOK = (date == string.split(dates.testasc(date))[0]) #nk"

Anonymous   
Printed Page 569
table in section "Messages"

The last 4 lines in the table say that the values 1-9 can be used for generic
messages (Message Text = "%1").

But in the source-file "PythonServiceMessages.mc" the definition is:
----------
MessageId=0xF000
Severity=Error
SymbolicName=MSG_ER1
Language=English
%1
----------

so I think the right values are 0xF000 - 0xF008.

{online examples} I recently downloaded the examples for this book. I
discovered an error within the module 'dates.py'. In line 53 it reads:

LATE = mktime(2038,1,15,0,0,0,0,0,0)

It should read:

LATE = mktime((2038,1,15,0,0,0,0,0,0))

It is just a minor thing, but the whole dtbrowse won't work with this error.

Anonymous