IronLanguages / main

Work for this repo has moved to https://github.com/IronLanguages/ironpython2
1.16k stars 347 forks source link

socket.recv(1024) didnot raise socket.timeout exception after method socket.settimeout(1.0) in test_socket.py #554

Open ironpythonbot opened 9 years ago

ironpythonbot commented 9 years ago

import socket
sock = socket.socket()
sock.settimeout(1.0)
sock.recv(1024)
In Python2.5: it would raise an exception of "socket.timeout"
But in ip2.0aA4: it would raise a "socket.error" which is the parent of socket.timeout. So this causes the testing method
"def raise_timeout(_args, *_kwargs):
self.serv.settimeout(1.0)
self.serv.recv(1024)
self.failUnlessRaises(socket.timeout, raise_timeout,
"Error generating a timeout exception (UDP)")" failed in Line 866, test_socket.py.

Work Item Details

Original CodePlex Issue: Issue 23753 Status: Active Reason Closed: Unassigned Assigned to: Unassigned Reported on: Jul 27, 2009 at 11:48 PM Reported by: dfugate Updated on: Feb 22, 2013 at 2:12 AM Updated by: jdhardy Custom value: Reported internally at Microsoft. Test: test_socket.py CreatedDate: 9/25/2007 NewInternalID: 409545 OldInternalID: 305771 AreaPath: IronPython\Python25

Plaintext Attachments

CodePlex Issue #23753 Plain Text Attachments

ironpythonbot commented 9 years ago

On 2011-02-09 06:02:12 UTC, rjnienaber commented:

Following behaviour is shown in 2.6.2 and 2.7b2 on .NET Version: 4.0.30319.1: python27 testcase-23753.py

Traceback (most recent call last): File "C:\ipy\testcase-23753.py", line 4, in sock.recv(1024) socket.timeout: timed out ipy26 testcase-23753.py

Traceback (most recent call last): File "C:\ipy\testcase-23753.py", line 4, in socket.timeout: [Errno 10057] A request to send or receive data was disallowed b ecause the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied ipy27 testcase-23753.py

Traceback (most recent call last): File "C:\ipy\testcase-23753.py", line 4, in socket.timeout: [Errno 10057] A request to send or receive data was disallowed b ecause the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied ipy testcase-23753.py

Traceback (most recent call last): File "C:\ipy\testcase-23753.py", line 4, in socket.timeout: [Errno 10057] A request to send or receive data was disallowed b ecause the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied