feross / SpoofMAC

:briefcase: Change your MAC address for debugging
https://feross.org/spoofmac/
3.02k stars 271 forks source link

Python 3 support #25

Closed otrebor closed 9 years ago

otrebor commented 10 years ago

On ubuntu 14.04 e 13.10 sudo spoof-mac randomize wlan0

Traceback (most recent call last): File "/usr/local/bin/spoof-mac", line 5, in pkg_resources.run_script('SpoofMAC==1.2.1', 'spoof-mac') File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 528, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1394, in run_script execfile(script_filename, namespace, namespace) File "/usr/local/lib/python2.7/dist-packages/SpoofMAC-1.2.1-py2.7.egg/EGG-INFO/scripts/spoof-mac", line 123, in sys.exit(main(arguments, os.geteuid())) File "/usr/local/lib/python2.7/dist-packages/SpoofMAC-1.2.1-py2.7.egg/EGG-INFO/scripts/spoof-mac", line 108, in main set_interface_mac(device, target_mac, port) File "/usr/local/lib/python2.7/dist-packages/SpoofMAC-1.2.1-py2.7.egg/spoofmac/interface.py", line 437, in set_interface_mac spoofer.set_interface_mac(device, mac, port) File "/usr/local/lib/python2.7/dist-packages/SpoofMAC-1.2.1-py2.7.egg/spoofmac/interface.py", line 108, in set_interface_mac subprocess.call(cmd) File "/usr/lib/python2.7/subprocess.py", line 522, in call return Popen(_popenargs, *_kwargs).wait() File "/usr/lib/python2.7/subprocess.py", line 710, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

feross commented 10 years ago

I believe this bug is because ubuntu 14.04 ships with Python 3 as the default. This script currently only works with Python 2. If someone (maybe you?) wants to port it to Python 3, I would accept such a PR.

feross commented 9 years ago

Fixed in #30