Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   TypeError: coercing to Unicode: need string or buffer, instance found (http://www.velocityreviews.com/forums/t324866-typeerror-coercing-to-unicode-need-string-or-buffer-instance-found.html)

Stuart Forsyth 11-13-2003 12:41 PM

TypeError: coercing to Unicode: need string or buffer, instance found
 
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(Reques t("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 !



vincent wehren 11-13-2003 01:34 PM

Re: TypeError: coercing to Unicode: need string or buffer, instance found
 
"Stuart Forsyth" <stuartf@the-i-junction.com> schrieb im Newsbeitrag
news:DYOdnR5-6qyz4S6iU-KYkQ@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(Reques t("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






All times are GMT. The time now is 07:44 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.