Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #100010
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: urllib2.urlopen() crashes on Windows 2008 Server |
| Date | 2015-12-04 13:16 -0500 |
| Organization | IISS Elusive Unicorn |
| Message-ID | <mailman.203.1449253048.14615.python-list@python.org> (permalink) |
| References | <n3pqq9$6sm$1@news2.informatik.uni-stuttgart.de> <mailman.189.1449191259.14615.python-list@python.org> <n3s2pg$qkp$1@news2.informatik.uni-stuttgart.de> |
On Fri, 4 Dec 2015 13:00:32 +0000 (UTC), Ulli Horlacher
<framstag@rus.uni-stuttgart.de> declaimed the following:
>Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
>>
>> Per MSDN:
>> """
>> WSAECONNRESET
>> 10054
>>
>>
>>
>> Connection reset by peer.
>>
>> An existing connection was forcibly closed by the remote host.
>
>This is not true.
>The server is under my control. Die client has terminated the connection
>(or a router between).
>
http://stackoverflow.com/questions/16888429/how-to-make-a-hard-abortive-close-on-a-tcp-connection
Case 2: linger->l_onoff is non-zero and linger->l_linger is zero:
A close() returns immediately. The underlying stack discards any unsent
data, and, in the case of connection-oriented protocols such as TCP, sends
a RST (reset) to the peer (this is termed a hard or abortive close). All
subsequent attempts by the peer's application to read()/recv() data will
result in an ECONNRESET.
The odds are still good that something on the server is configured to
not make a clean shutdown of TCP connections (a router should not be
involved as the TCP connection is from client IP to server IP, regardless
of intervening MAC Ethernet routing). The RST is coming from the server.
>
>How can I trap this within the python program?
>I see no exception.
It's a socket error
https://docs.python.org/2/library/socket.html
"""
exception socket.error
This exception is raised for socket-related errors. The accompanying
value is either a string telling what went wrong or a pair (errno, string)
representing an error returned by a system call, similar to the value
accompanying os.error. See the module errno, which contains names for the
error codes defined by the underlying operating system.
Changed in version 2.6: socket.error is now a child class of IOError.
"""
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
urllib2.urlopen() crashes on Windows 2008 Server Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2015-12-03 16:32 +0000
Re: urllib2.urlopen() crashes on Windows 2008 Server Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-12-03 20:07 -0500
Re: urllib2.urlopen() crashes on Windows 2008 Server Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2015-12-04 13:00 +0000
Re: urllib2.urlopen() crashes on Windows 2008 Server Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-12-04 13:16 -0500
Re: urllib2.urlopen() crashes on Windows 2008 Server Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2015-12-06 09:38 +0000
csiph-web