ArduPilot / ArduPilot/SiK

Hacktoberfest: Python 3 compatibility issues

Open
#55 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
343
Forks
245
PR merge metrics
No merged PRs in 30d

Description

[flake8](http://flake8.pycqa.org) testing of https://github.com/ArduPilot/SiK on Python 3.7.1

$ __flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics__
```
./Firmware/tools/check_code.py:17:13: E999 SyntaxError: invalid syntax
print sys.argv
^
./Firmware/tools/bank-alloc.py:143:31: E999 SyntaxError: invalid syntax
print "Failed to allocate", module[0], "with size", module[1], \
^
./Firmware/tools/update_mode.py:35:12: F821 undefined name 'pexpect'
except pexpect.TIMEOUT:
^
./Firmware/tools/atcommander.py:269:81: E999 SyntaxError: invalid syntax
print "Please specify a --list-* or --set-* operation (try -h if unsure)"
^
./Firmware/tools/rssi.py:51:31: E999 TabError: inconsistent use of tabs and spaces in indentation
sys.stdout.flush()
^
./Firmware/tools/uploader.py:100:31: E999 TabError: inconsistent use of tabs and spaces in indentation
if use_mavlink:
^
5 E999 SyntaxError: invalid syntax
1 F821 undefined name 'pexpect'
6
```
__E901,E999,F821,F822,F823__ are the "_showstopper_" [flake8](http://flake8.pycqa.org) 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

Contributor guide

No contributing guide indexed for this repository

Research direction

Run the flake8 command from the issue with Python 3.7.1 and inspect Firmware/tools/check_code.py, bank-alloc.py, update_mode.py, atcommander.py, rssi.py, and uploader.py. Resolve the listed Python 3 syntax, indentation, and undefined-name errors, then rerun the same showstopper checks and confirm they report no E901, E999, or F821 issues.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.