Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #21204
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <scavanau@cisco.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.003 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.05; 'prints': 0.07; 'subject:Apache': 0.07; 'python': 0.08; 'scripts': 0.09; 'problem:': 0.09; 'subject:Problem': 0.09; 'output': 0.10; 'message-----': 0.12; 'chris,': 0.16; 'chugging': 0.16; 'deadlock': 0.16; 'email name:chris': 0.16; 'err': 0.16; 'fires': 0.16; 'proc': 0.16; 'timeout': 0.16; 'timeout.': 0.16; 'cc:addr :python-list': 0.16; 'wrote:': 0.18; 'loading': 0.18; 'seems': 0.20; 'cheers,': 0.20; 'apache': 0.21; 'cc:no real name:2**0': 0.21; 'header:In-Reply-To:1': 0.22; 'interface': 0.23; 'command': 0.24; 'fine': 0.24; 'suspect': 0.24; 'cc:2**0': 0.26; 'code': 0.26; 'testing': 0.26; 'function': 0.27; 'import': 0.27; 'script': 0.28; 'sean': 0.29; 'problem': 0.29; 'print': 0.29; 'cc:addr:python.org': 0.29; 'pm,': 0.29; 'keeps': 0.30; 'fedora': 0.30; 'chris': 0.30; 'error': 0.30; 'cc:': 0.31; 'url:library': 0.31; 'thanks': 0.32; 'fri,': 0.34; 'problem.': 0.35; 'list.': 0.35; 'subject:': 0.35; 'url:python': 0.35; 'executing': 0.37; 'friday,': 0.37; 'but': 0.37; 'using': 0.37; 'some': 0.38; 'sent:': 0.38; 'open': 0.38; 'correctly': 0.39; 'url:org': 0.39; 'mailing': 0.39; 'from:': 0.40; 'called': 0.40; 'point': 0.40; 'skip:s 40': 0.40; 'march': 0.61; '8bit%:23': 0.62; 'friends:': 0.67; 'received:171': 0.67; 'webpage': 0.67; '8bit%:100': 0.69; 'skip:\xc2 10': 0.74; '12:09': 0.84; 'advise,': 0.84; 'hanging': 0.84; 'isolated': 0.84; 'replicate': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=scavanau@cisco.com; l=3072; q=dns/txt; s=iport; t=1330884436; x=1332094036; h=mime-version:content-transfer-encoding:subject:date: message-id:in-reply-to:references:from:to:cc; bh=yaM/G59LpFzbyG/KOPnsgNyr7dTRaiYvOKCRYd6SxoQ=; b=EUA0iO2mAJ741qwftBPig8QqpbOmkGIeybS+LrA7baWWU4tbYDFCHjmE DrKUZlk1WF8WjrRvNeMk4cQhLoU0tgigIF3m+v4gqfMFrOO2gdoXs2Qjg Uw8uoNeTkrdmLn6Uy70n9ALBu47BuXTjYPjOrkVE5e0tARjMOZZEuTsrO I=; |
| X-IronPort-Anti-Spam-Filtered | true |
| X-IronPort-Anti-Spam-Result | AgIFAEKuU0+rRDoG/2dsb2JhbABDhTSuFXiBB4F9AQEBAwESARAECQQ6CwUHBAIBBgIOAwQBAQMCBgYXAQICAgEBRAkIAQEEEwgah2AEDJl3AYxlkRiBL44YM2MEiFCdAIMEgTs |
| X-IronPort-AV | E=Sophos;i="4.73,530,1325462400"; d="scan'208";a="34285861" |
| X-MimeOLE | Produced By Microsoft Exchange V6.5 |
| Content-class | urn:content-classes:message |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset="utf-8" |
| Content-Transfer-Encoding | base64 |
| Subject | RE: Python - CGI-BIN - Apache Timeout Problem |
| Date | Sun, 4 Mar 2012 10:07:57 -0800 |
| In-Reply-To | <CAMZYqRTXSHD9DnjVVj87vVVi21ePQyOaqjTYH6h=iQGDN2XULA@mail.gmail.com> |
| X-MS-Has-Attach | |
| X-MS-TNEF-Correlator | |
| Thread-Topic | Python - CGI-BIN - Apache Timeout Problem |
| Thread-Index | Acz4sj3DSw719Y2tSoyEJQggsDzPVwBfwK8w |
| References | <6FC169072CBFF3409B6E74F50175A4650497A3F9@xmb-sjc-215.amer.cisco.com> <CAMZYqRTXSHD9DnjVVj87vVVi21ePQyOaqjTYH6h=iQGDN2XULA@mail.gmail.com> |
| From | "Sean Cavanaugh (scavanau)" <scavanau@cisco.com> |
| To | "Chris Rebert" <clp2@rebertia.com> |
| X-OriginalArrivalTime | 04 Mar 2012 18:06:04.0386 (UTC) FILETIME=[7701F420:01CCFA31] |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.385.1330884438.3037.python-list@python.org> (permalink) |
| Lines | 40 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1330884438 news.xs4all.nl 6889 [2001:888:2000:d::a6]:51617 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:21204 |
Show key headers only | View raw
Thanks Chris,
I isolated it using logging
import logging
logging.basicConfig(filename="test3.log", level=logging.INFO)
then logging.info('sniffer got to point A')
and going through my code until I isolated the problem to a function with scapy called sniff. For some reason this function operates very weirdly on FreeBSD9. I have already submitted an email to the scapy mailing list. Going to try to replicate this on Fedora but I doubt I will see this problem. Even from the command line the sniff() function is not working correctly on FreeBSD 9.
-S
-----Original Message-----
From: chris@rebertia.com [mailto:chris@rebertia.com] On Behalf Of Chris Rebert
Sent: Friday, March 02, 2012 3:23 PM
To: Sean Cavanaugh (scavanau)
Cc: python-list@python.org
Subject: Re: Python - CGI-BIN - Apache Timeout Problem
On Fri, Mar 2, 2012 at 12:09 PM, Sean Cavanaugh (scavanau)
<scavanau@cisco.com> wrote:
<snip>
> THE PROBLEM:
>
> When I execute the scripts from the command line (#python main.py) it
> generates it fine (albeit slowly), it prints all the html code out including
> the script. The ‘core’ part of the script dumbed down to the lowest level
> is->
>
> proc = subprocess.Popen(['/usr/local/bin/python', 'tests.py'],
> stdout=subprocess.PIPE)
> output = proc.stdout.read()
Note the red warning box about possible deadlock with .stdout.read()
and friends:
http://docs.python.org/library/subprocess.html#popen-objects
> print output
> proc.stdout.close()
As the docs advise, try using .communicate()
[http://docs.python.org/library/subprocess.html#subprocess.Popen.communicate
] instead:
proc = subprocess.Popen(…)
out, err = proc.communicate()
print out
> When I open main.py and execute the script it just hangs… it seems to
> execute the script (I see pcap fires on the interface that I am testing on
> the firewall) but its not executing correctly… or loading the entire
> webpage…the webpage keeps chugging along and eventually gives me an error
> timeout.
The hanging makes me suspect that the aforementioned deadlock is occurring.
Cheers,
Chris
--
http://chrisrebert.com
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
RE: Python - CGI-BIN - Apache Timeout Problem "Sean Cavanaugh (scavanau)" <scavanau@cisco.com> - 2012-03-04 10:07 -0800
csiph-web