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

Stuart Forsyth stuartf at the-i-junction.com
Thu Nov 13 07:41:17 EST 2003


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 !






More information about the Python-list mailing list