Yes, I have just tried to return app_iter as str(app_iter[0]) and it worked.
Thanks!
Now I see that my "200 OK" responses return a list of str() and they worked
perfectly, but...

According to Pylons documentation (
http://docs.pylonsproject.org/projects/webhelpers/dev/modules/html/builder.html
)

"literal is a subclass of unicode, so it works with all string methods and
expressions. The only thing special about it is the .__html__ method, which
returns the string itself. The escape() function follows a simple protocol:
if the object has an .__html__ method, it calls that rather than .__str__ to
get the HTML representation. Third-party libraries that do not want to
import literal (and this create a dependency on WebHelpers) can put an
.__html__ method in their own classes returning the desired HTML
representation."

I thought the "literal" object had to be transparent to third-party
components that expect a string in their input interfaces. And
CherryPyWSGIServer did the implicit casting pretty well. Is this a
vendor-specific behaviour not related to pep333 or all wsgi web servers
should try to implicitly cast incoming iterable to str()?

Anyway, I really appreciate for your clarifying questions and for your help!


On Mon, May 23, 2011 at 11:27 AM, Roberto De Ioris <[email protected]> wrote:

>
> >>Does the zero-size is reported by uWSGI logs or nginx one ?
> >
> > Yes, it is. Here is the uWSGI log entry:
> >
> > {address space usage: 185155584 bytes/176MB} {rss usage: 42397696
> > bytes/40MB} [pid: 2581|app: 0|req: 14/14] 127.0.0.1 () {44 vars in 782
> > bytes} [Mon May 23 10:56:11 2011] GET /NotExistedPageTest => generated 0
> > bytes in 28 msecs (HTTP/1.1 404) 4 headers in 130 bytes (1 switches on
> > core
> > 0)
> >
> > Also, I have checked my app_iter return value (it's actually a list with
> a
> > single element - an instance of <class
> 'webhelpers.html.builder.literal'>)
>
>
> Hmm no, wait, the WSGI standard expect a string (or bytestring in Python
> 3.x) not a 'generic' class instance.
>
> I suppose adding a str() cast to the object will solve your problem.
> --
> Roberto De Ioris
> http://unbit.it
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to