Author nemunaire
Recipients abarry, alex, christian.heimes, dstufft, giampaolo.rodola, janssen, nemunaire, pitrou, vstinner
Date 2016-07-28.17:34:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1469727263.3.0.760638749708.issue27629@psf.upfronthosting.co.za>
In-reply-to
Content
Here is a new patch with tests on constructor.

The patch on the feature is quite different: instead of testing for None socket, I choose to delay the != SOCK_STREAM check in the later condition, when we know we treat a socket.

Tests include different constructor forms: with a given socket, with a fileno (didn't work either, before this patch) and without socket nor file descriptor (as in my original test).

I don't have sufficient background to judge if tests will work on all platform (eg. fileno and windows, ...).

Here is the interesting diff of the tests on SSL (before/after applying the patch on the feature):

32c32
< test_constructor (__main__.BasicSocketTests) ... ERROR
---
> test_constructor (__main__.BasicSocketTests) ... ok
519,528d518
< ERROR: test_constructor (__main__.BasicSocketTests)
< ----------------------------------------------------------------------
< Traceback (most recent call last):
<   File "test_ssl.py", line 149, in test_constructor
<     ss = ssl.SSLSocket()
<   File "/usr/lib/python3.4/ssl.py", line 545, in __init__
<     if sock.getsockopt(SOL_SOCKET, SO_TYPE) != SOCK_STREAM:
< AttributeError: 'NoneType' object has no attribute 'getsockopt'
< 
< ======================================================================
History
Date User Action Args
2016-07-28 17:34:23nemunairesetrecipients: + nemunaire, janssen, pitrou, vstinner, giampaolo.rodola, christian.heimes, alex, dstufft, abarry
2016-07-28 17:34:23nemunairesetmessageid: <1469727263.3.0.760638749708.issue27629@psf.upfronthosting.co.za>
2016-07-28 17:34:23nemunairelinkissue27629 messages
2016-07-28 17:34:23nemunairecreate