The community forums are in BETA and closed to the public.

TCP_KEEPINTVL Error on Mac Osx 10.9.5 and Python 3.4.x

here my python mod : cmd2==0.6.8 pubnub==3.7.1 pubnub-console==3.5.2 pycrypto==2.6.1 Pygments==2.0.2 pyparsing==2.0.3 requests==2.5.3

and the error :

python3 Traceback (most recent call last): File "", line 2, in from Pubnub import Pubnub File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/", line 88, in (socket.IPPROTOTCP, socket.TCPKEEPINTVL, 1), AttributeError: 'module' object has no attribute 'TCP_KEEPINTVL'

Any Idea ?

Are you running a sample app? The TCP_* attributes are not available on osx

How did you think i can set this parameter if i try to run the sample app ? Is any parameter i can disable or set somewhere ?

Hi Alessio, works correctly on OS X 10.10 with Python 2.7.9 and Python 3.4.3.

Here are the definitions in tcp.h (from the xnu source code) used in OS X 10.9.5:

#define TCP_KEEPINTVL    0x101    /* interval between keepalives */
#define TCP_KEEPCNT      0x102    /* number of keepalives before close */

Therefore, it is possible to workaround the issue by defining these two constants the same way socket.TCP_KEEPALIVE is on line 82:

Here's a patch:

Comments to this discussion are now closed!