Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nginx + uwsgi + python33 doesn't work
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
LucianoBarcaro
n00b
n00b


Joined: 16 Mar 2011
Posts: 5
Location: Cascavel

PostPosted: Sat Jun 07, 2014 11:44 am    Post subject: nginx + uwsgi + python33 doesn't work Reply with quote

Hi all,

I'm configuring nginx+uwsgi with python33 plugin, but this combination does no produce any output.

If I use python27 plugin, it works as expected.

With python33 plugin does not give me nothing (nor any error message).
In uwsgi log, it shows me that python33 is loaded.

My init script is just as simple:
Code:
from sys import version

def application(env, start_response):
    body = repr(version)

    headers = []
    headers.append(('Content-type', 'text/plain'))
    headers.append(('Content-Length', str(len(body))))

    start_response('200 OK', headers)

    print('passed here')

    return [body]

and, when I fire lynx -dump http://test.net it gives me nothing (zero size response), but, the print works (appears in uwsgi logs)

This same init script works as expected if I change plugin from python33 to 27.

Any ideas?
Back to top
View user's profile Send private message
LucianoBarcaro
n00b
n00b


Joined: 16 Mar 2011
Posts: 5
Location: Cascavel

PostPosted: Tue Jun 17, 2014 1:38 pm    Post subject: [SOLVED] Re: nginx + uwsgi + python33 doesn't work Reply with quote

LucianoBarcaro wrote:
Hi all,

I'm configuring nginx+uwsgi with python33 plugin, but this combination does no produce any output.

If I use python27 plugin, it works as expected.

With python33 plugin does not give me nothing (nor any error message).
In uwsgi log, it shows me that python33 is loaded.

My init script is just as simple:
Code:
from sys import version

def application(env, start_response):
    body = repr(version)

    headers = []
    headers.append(('Content-type', 'text/plain'))
    headers.append(('Content-Length', str(len(body))))

    start_response('200 OK', headers)

    print('passed here')

    return [body]

and, when I fire lynx -dump http://test.net it gives me nothing (zero size response), but, the print works (appears in uwsgi logs)

This same init script works as expected if I change plugin from python33 to 27.

Any ideas?


Seems that uwsgi doesn't like unicode return.
Needed to convert the output to bytes.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum