Receing a form variable as a list instead of as a string

Ulrich Eckhardt ulrich.eckhardt at dominolaser.com
Tue Jun 11 07:51:04 EDT 2013


Am 11.06.2013 12:38, schrieb Νικόλαος Κούρας:
> File "/home/nikos/public_html/cgi-bin/metrites.py", line 28, in <module>, referer: http://xxxredactedxxx/
>    page = page.replace( '/home/nikos/public_html/', '' ), referer: http://xxxredactedxxx/
> AttributeError: 'list' object has no attribute 'replace', referer: http://xxxredactedxxx
>
> but page is a form variable coming from a previous sumbitted form
> why the error says 'page' is a list?

Maybe because it is a list? Try e.g. "print(type(page))" or 
"print(page)" to gain some insight.


> How to receive that form variable as a string?

For that, you'd have to adjust the code that you received it from. If 
that's not possible, convert it to a string yourself. But didn't you 
want a "form variable"?


Uli




More information about the Python-list mailing list