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

dist/tools/usb-serial: Fix handling of None while quoting #19750

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

maribu
Copy link
Member

@maribu maribu commented Jun 21, 2023

Contribution description

This fixes:

Traceback (most recent call last):
  File "/home/maribu/Repos/software/RIOT/master/dist/tools/usb-serial/ttys.py", line 259, in <module>
    print_ttys(sys.argv)
  File "/home/maribu/Repos/software/RIOT/master/dist/tools/usb-serial/ttys.py", line 255, in print_ttys
    print_results(args, ttys)
  File "/home/maribu/Repos/software/RIOT/master/dist/tools/usb-serial/ttys.py", line 189, in print_results
    if item.rfind(args.format_sep) >= 0:
       ^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'rfind'

Which occurs while testing whether a string requires special quoting if an attribute is None.

Testing procedure

make term MOST_RECENT_PORT=1

with a TTL adapter that has no serial should no longer trigger above exception.

Issues/PRs references

None

This fixes:

    Traceback (most recent call last):
      File "/home/maribu/Repos/software/RIOT/master/dist/tools/usb-serial/ttys.py", line 259, in <module>
        print_ttys(sys.argv)
      File "/home/maribu/Repos/software/RIOT/master/dist/tools/usb-serial/ttys.py", line 255, in print_ttys
        print_results(args, ttys)
      File "/home/maribu/Repos/software/RIOT/master/dist/tools/usb-serial/ttys.py", line 189, in print_results
        if item.rfind(args.format_sep) >= 0:
           ^^^^^^^^^^
    AttributeError: 'NoneType' object has no attribute 'rfind'

Which occurs while testing whether a string requires special quoting
if an attribute is None.
@maribu maribu added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: tools Area: Supplementary tools CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs labels Jun 21, 2023
@riot-ci
Copy link

riot-ci commented Jun 21, 2023

Murdock results

✔️ PASSED

6192c62 dist/tools/usb-serial: Fix handling of None while quoting

Success Failures Total Runtime
1 0 1 59s

Artifacts

@aabadie
Copy link
Contributor

aabadie commented Jun 22, 2023

bors merge

@bors
Copy link
Contributor

bors bot commented Jun 22, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 970734e into RIOT-OS:master Jun 22, 2023
@maribu maribu deleted the dist/tools/usb-serial branch June 22, 2023 06:20
@maribu
Copy link
Member Author

maribu commented Jun 22, 2023

Thx :)

@benpicco benpicco added this to the Release 2023.07 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants