TypeError: coercing to Unicode: need string or buffer, instance found

vincent wehren vincent at visualtrans.de
Thu Nov 13 08:34:37 EST 2003


"Stuart Forsyth" <stuartf at the-i-junction.com> schrieb im Newsbeitrag
news:DYOdnR5-6qyz4S6iU-KYkQ at is.co.za...
| What can I do about this error, i am tearing my hair out!
|
| Python ActiveX Scripting Engine (0x80020009)
| Traceback (most recent call last): File "<Script Block >", line 58, in ?
| FileContents =
|
FileContents.replace('Repl_learner',unicode(Request("learner"),'utf-8','igno
| re')) TypeError: coercing to Unicode: need string or buffer, instance
found
|
| FileContents is defined as:
|
| MasterFile = codecs.open(MasterFilePath, "r", "utf-8")
| FileContents = MasterFile.read()
|
| Please help !
|

You should inspect 'Request("learner")' more closely. It propbably doesn't
return an encoded string, but an instance of some sort...
I'm not really on board with ActiveX, but shouldn't you call some sort of a
method on Request to get a collection (e.g. Request.Form("learner")?

Regards,
Vincent Wehren








More information about the Python-list mailing list