Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect socket.socket __init__ signature #70

Closed
andresriancho opened this issue Jun 14, 2013 · 1 comment
Closed

Incorrect socket.socket __init__ signature #70

andresriancho opened this issue Jun 14, 2013 · 1 comment

Comments

@andresriancho
Copy link
Contributor

When using httpretty in a project that uses scapy I get the following:

  File "/usr/local/lib/python2.7/dist-packages/w3af-1.5-py2.7.egg/w3af/plugins/infrastructure/http_vs_https_dist.py", line 24, in <module>
    from scapy.all import traceroute
  File "/usr/lib/python2.7/dist-packages/scapy/all.py", line 16, in <module>
    from arch import *
  File "/usr/lib/python2.7/dist-packages/scapy/arch/__init__.py", line 71, in <module>
    from linux import *
  File "/usr/lib/python2.7/dist-packages/scapy/arch/linux.py", line 513, in <module>
    conf.iface = get_working_if()
  File "/usr/lib/python2.7/dist-packages/scapy/arch/linux.py", line 103, in get_working_if
    ifflags = struct.unpack("16xH14x",get_if(i,SIOCGIFFLAGS))[0]
  File "/usr/lib/python2.7/dist-packages/scapy/arch/linux.py", line 268, in get_if
    s=socket.socket()
TypeError: __init__() takes at least 3 arguments (1 given)

According to the python documentation scapy is doing something valid, since socket.socket docs say:

socket.socket([family[, type[, proto]]])
Create a new socket using the given address family, socket type and protocol number. The address family should be AF_INET (the default), AF_INET6 or AF_UNIX. The socket type should be SOCK_STREAM (the default), SOCK_DGRAM or perhaps one of the other SOCK_ constants. The protocol number is usually zero and may be omitted in that case.

Basically: All arguments are optional.

The problem seems to be here

gabrielfalcao added a commit that referenced this issue Jun 20, 2013
Fix for Incorrect socket.socket __init__ signature #70
@CyrilRoelandteNovance
Copy link
Collaborator

This has been fixed; closing the bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants