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

[BUG] Undefined names in Python code #364

Closed
cclauss opened this issue Oct 23, 2019 · 0 comments
Closed

[BUG] Undefined names in Python code #364

cclauss opened this issue Oct 23, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@cclauss
Copy link

cclauss commented Oct 23, 2019

Describe the bug
A clear and concise description of what the bug is.

flake8 testing of https://github.com/evilsocket/pwnagotchi on Python 3.8.0

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

./pwnagotchi/ui/hw/libs/waveshare/lcdhat/config.py:34:23: F821 undefined name 'BUSY_PIN'
    return GPIO.input(BUSY_PIN)
                      ^
./pwnagotchi/ui/hw/libs/waveshare/lcdhat/config.py:44:5: F821 undefined name 'bus'
    bus.write_byte_data(address, reg, value)
    ^
./pwnagotchi/ui/hw/libs/waveshare/lcdhat/config.py:44:25: F821 undefined name 'address'
    bus.write_byte_data(address, reg, value)
                        ^
3     F821 undefined name 'BUSY_PIN'
3

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

To Reproduce
Steps to reproduce the behavior:

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

Expected behavior
A clear and concise description of what you expected to happen.

No undefined names in Python code.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Pwnagotchi version
  • OS version
  • Type of hardware
  • Any additional hardware used

Additional context
Add any other context about the problem here.

These instance have the potential to raise NameError at runtime.

@cclauss cclauss added the bug Something isn't working label Oct 23, 2019
dadav pushed a commit to dadav/pwnagotchi that referenced this issue Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant