James G. Sack (jim) wrote:
> boblq wrote:
>> On Friday 13 October 2006 10:06 am, boblq wrote:
>>> If this is a bug in Python and not in BobLQ's usage then
>>> one would think it well known. I guess it is time to hunt
>>> up the Python bug base and see.
>>>
>>> Any further suggestions?
>>>
>>> BobLQ
>> A quick search of the Python Bug database
>> does not reveal any examples of this. I note
>> that the Python Cookbook has essentially
>> this code in it together with a short program
>> by Guido von Russum called wget.py
>> (See p487 of the Python Cookbook 2nd Edition)
>>
>> I will try to test WVR's code for this behavior
>> later today.
>>
>> BobLQ
>>
>> PS. I am using Python ver 2.3.4
>> Does anyone have a favorite version? Why?
>>
>
> My simple-minded approach is to use whatever comes with my distro, but
> keep up with the updates. I am using FC5 and python-2.4.3-8.FC5.
>
> 2.5 is recently out but I'll probably wait (eg for FC6 or whatever).
>
> The page http://www.python.org/download/releases/ leads to nice "What's
> New.." articles, (authoritatively and well-) written by Andrew Kuchling.
>
> = = =
>
> Re diagnosing/debugging your problem:
>
> - When client 1 "hangs" -- does that mean it eventually succeeds after a
> delay (your 90 sec reference?)?
>
> - What is your clients' & server environments?
>
> - Does the behavior change if you reverse the client roles? If you do
> both client steps from the same host?
>
> - Do you have access to the server to do some poking around, or is it a
> limited-access hosted thingy? eg, can you monitor (via say netstat) the
> server end?
>
> - Can the whole mess be run on another machine or set of machines?
>
> - Can you substitute still another get-prog? perl (perl-libwww-perl) has
> a nice GET. Or lftpget (which has nice -v and -d options).
>
An afterthought: are the clients outside your control?
You didn't mention running netstat to confirm the connections in
time-wait status.
What I see is that using urllib shows a line like
tcp 0 0 ::ffff:127.0.0.1:80 ::ffff:127.0.0.1:34859
TIME_WAIT timewait (59.86/0/0)
whereas no such timewait line shows after the get using urllib2 instead
of urllib.
BTW, this is actually one case where python admits a semi-convenient
one-liner approach:
python -c 'import urllib2 as u;print
u.urlopen("http://localhost/filename")';netstat -anto
(damn, there ought to be a way to override line-wrapping for a
single-line of group of lines in thunderbird compose -- anybody know)
Regards,
..jim
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg