"TypeError: read-only buffer, None" returned from file.write...

Dag Sunde dag at orion.no
Fri Jun 23 04:12:29 EDT 2000


I do that now...

It was a typo in the function that filled the buffer
in the first place. I tested it in the interactive window,
and when I felt that it did what I wanted, I moved it into
my code, introducing a bug in the process... :-(

Dag.

"Jeremy Hylton" <jeremy at beopen.com> wrote in message
news:6E1AD32AF87E515E.2A23DF4E6211A01A.00440780EBC1EDDA at lp.airnews.net..
.
> It would be better, though, to test explicitly for None and not write
> the result to a file when it is None.
>
> sBuffer = m_XMLDoc.transformNode(xslDoc)
>
> if sBudder is None:
> print "Error: transformNode returned None"
> else:
> f = open( outFile, 'w')
> f.write(sBuffer)
> f.close()
>
>
> Jeremy





More information about the Python-list mailing list