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

Python 3 compatibility issues #16

Closed
cclauss opened this issue Aug 10, 2019 · 4 comments
Closed

Python 3 compatibility issues #16

cclauss opened this issue Aug 10, 2019 · 4 comments

Comments

@cclauss
Copy link
Contributor

cclauss commented Aug 10, 2019

flake8 testing of https://github.com/hash3liZer/WiFiBroot on Python 3.7.1

$ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

./wifibroot.py:197:12: E999 SyntaxError: invalid syntax
		print "\n"+tabulate(tabulator__, headers=__HEADERS)+"\n"
           ^
./pull.py:161:20: E999 SyntaxError: invalid syntax
		print "%s[*]%s %s" % (self.BOLD+self.YELLOW, self.END, statement)
                   ^
./wireless/shifter.py:153:59: E999 SyntaxError: invalid syntax
		if pkt.haslayer(Dot11) and pkt.getlayer(Dot11).type == 2L and not pkt.haslayer(EAPOL):
                                                          ^
./wireless/cracker.py:167:12: F821 undefined name 'xrange'
		for c in xrange(0, len(src), length):
           ^
./wireless/captures.py:176:41: E999 SyntaxError: invalid syntax
				self.pull.right("PMK =>"); print self.hexdump(_pmk)
                                        ^
./wireless/sniper.py:63:59: E999 SyntaxError: invalid syntax
		if pkt.haslayer(Dot11) and pkt.getlayer(Dot11).type == 2L and not pkt.haslayer(EAPOL):
                                                          ^
./wireless/connector.py:51:21: E999 SyntaxError: invalid syntax
		except ImportError, e:
                    ^
./wireless/pmkid.py:162:19: E999 SyntaxError: invalid syntax
		except Exception, e:
                  ^
./utils/tabulater__.py:19:18: F821 undefined name 'long'
    _long_type = long
                 ^
./utils/tabulater__.py:21:18: F821 undefined name 'unicode'
    _text_type = unicode
                 ^
./utils/tabulater__.py:25:30: F821 undefined name 'file'
        return isinstance(f, file)
                             ^
7     E999 SyntaxError: invalid syntax
4     F821 undefined name 'long'
11

E901,E999,F821,F822,F823 are the "showstopper" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. These 5 are different from most other flake8 issues which are merely "style violations" -- useful for readability but they do not effect runtime safety.

  • F821: undefined name name
  • F822: undefined name name in __all__
  • F823: local variable name referenced before assignment
  • E901: SyntaxError or IndentationError
  • E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree
@hash3liZer
Copy link
Owner

Just merged your pull request. Yes, it is built with Python 2. So, only python 2 is supported.

@cclauss
Copy link
Contributor Author

cclauss commented Aug 10, 2019

144 days until Python 2 end of life.

@hash3liZer
Copy link
Owner

Yes, i started this project before that. And eventually, had to left this out after scapy release 2.4.2. Recently, after some support tickets and questions for improvements, I am already working for the newer version, supporting the latest scapy release and Python 3.

@hash3liZer
Copy link
Owner

Closing it now.

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