Skip to content

Conversation

@MrARM
Copy link

@MrARM MrARM commented Apr 1, 2025

This fixes a small crash I found when I installed auto_rx on my Mac.

If gtimeout is not installed, sys.exit(1) is called from auto_rx/autorx/utils.py, and this file does not import sys. The program does exit, but not gracefully as you can see:

2025-03-31 20:25:57,728 CRITICAL:timeout command-line tool not present in system. try installing gtimeout.
Traceback (most recent call last):
  File "<...>/radiosonde_auto_rx/auto_rx/auto_rx.py", line 1102, in <module>
    main()
  File "<...>/radiosonde_auto_rx/auto_rx/auto_rx.py", line 833, in main
    if not check_rs_utils(config):
           ^^^^^^^^^^^^^^^^^^^^^^
  File "<...>/radiosonde_auto_rx/auto_rx/autorx/utils.py", line 74, in check_rs_utils
    _ = timeout_cmd()
        ^^^^^^^^^^^^^
  File "<...>/radiosonde_auto_rx/auto_rx/autorx/utils.py", line 61, in timeout_cmd
    sys.exit(1)
    ^^^
NameError: name 'sys' is not defined. Did you forget to import 'sys'
Main Loop Error - name 'sys' is not defined

This small PR adds the missing sys import, and lets the program exit gracefully.

darksidelemm and others added 3 commits December 15, 2024 11:17
auto_rx 1.8.0 release - Full ka9q-radio support!
v1.8.1 Release - RS41 Multi-GNSS Support, ka9q-radio updates
@MrARM
Copy link
Author

MrARM commented Apr 1, 2025

A sidenote: On mac, gtimeout can be installed through brew by installing coreutils.

@darksidelemm
Copy link
Member

Please redirect this PR to the testing branch, and I'll merge it.

@MrARM MrARM changed the base branch from master to testing April 1, 2025 11:28
@MrARM
Copy link
Author

MrARM commented Apr 1, 2025

Please redirect this PR to the testing branch, and I'll merge it.

Alright, I've set it to the testing branch.

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

Successfully merging this pull request may close these issues.

2 participants