subprocess.Popen breaks dev server

40 wyświetleń
Przejdź do pierwszej nieodczytanej wiadomości

Tim Sawyer

nieprzeczytany,
18 cze 2010, 13:05:2118.06.2010
do django...@googlegroups.com
Hi Folks,

I have code that does this:

lCommand = ["hg","history", "-r", "%s:%s" % (pFrom, pTo)]
lProcess = subprocess.Popen(lCommand, stdin=subprocess.PIPE,
stdout=subprocess.PIPE)

in a view. When using the dev server, I'm quite often getting a blank
page instead of my HTML, and for each page request the server outputs:

Django version 1.2.1, using settings 'dewsbury.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

This is happening on every request. If I comment out the code that does
the Popen, it works fine.

The Popen command is completing fine, I can print out the output on each
request, it's just that the dev server is returning a blank page back to
the browser. This is on the 1.2.1 release.

I've had a wander around the bugs related to this and the ones I could
find seems to be closed as duplicate, or closed worksforme.

http://code.djangoproject.com/ticket/9286
http://code.djangoproject.com/ticket/4953
http://code.djangoproject.com/ticket/3712

Clues/pointers appreciated!

Cheers,

Tim.

Henrik Genssen

nieprzeczytany,
18 cze 2010, 14:15:3118.06.2010
do django...@googlegroups.com
you may try subprocess.check_call instead of Popen

regards
henrik

>reply to message:
>date: 18.06.2010 19:05:21
>from: "Tim Sawyer" <list....@calidris.co.uk>
>to: django...@googlegroups.com
>subject: subprocess.Popen breaks dev server

>--
>You received this message because you are subscribed to the Google Groups "Django users" group.
>To post to this group, send email to django...@googlegroups.com.
>To unsubscribe from this group, send email to django-users...@googlegroups.com.
>For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>

Odpowiedz wszystkim
Odpowiedz autorowi
Przekaż
Nowe wiadomości: 0