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

Dag Sunde dag at orion.no
Wed Jun 21 07:16:34 EDT 2000


That was absolutely correct!

Thank you...

Dag.

"Adam Ruth" <aruth at intercation.com> wrote in message
news:8ip2q3$2jrk$1 at news.aros.net...
> I get this all the time too, simple error.  Somewhere you assigned
sBuffer
> to None.  It happens to me a lot when I call functions that return
strings
> or return None when there is a problem.  You can confirm this by
writing:
>
> f.write(str(sBuffer))
>
> The file then should contain the word 'None'.
>
> --
> Adam Ruth
> InterCation, Inc.
> www.intercation.com
>
>
> "Dag Sunde" <dag at orion.no> wrote in message
> news:MIS35.664$PQ4.13634 at news1.online.no...
> > I have the following code-snippet that retuns a string:
> >
> >    result = m_XMLDoc.transformNode(xslDoc)
> >
> > ...and the string shows the expected result when printed,
> > but when I try to save the string to a file with the following
> > code:
> >
> >   f = open( outFile, 'w')
> >   f.write(sBuffer)
> >   f.close()
> >
> > I get this error:
> >
> > Traceback (innermost last):
> >   File "f:/apache/cgi-bin/getfinalconfirmation.py", line 142, in
> > saveConfirmedData
> >     f.write(sBuffer)
> > TypeError: read-only buffer, None
> >
> > Can anyone give me a hint?
> >
> > TIA...
> >
> > Dag Sunde
> >
> >
> >
>
>





More information about the Python-list mailing list