-
-
Notifications
You must be signed in to change notification settings - Fork 197
Fix exit method to use sys.exit for proper cleanup #842
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
Open
Aareon
wants to merge
11
commits into
markqvist:master
Choose a base branch
from
Aareon:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Change RNS.__init__.py exit method from os._exit to sys.exit to allow proper cleanup and exception handling. Keep panic method using os._exit for immediate termination in unrecoverable scenarios.
Change `RNS.__init__.py` exit method from `os._exit` to `sys.exit` to allow proper cleanup and exception handling. Keep `panic` method using `os._exit` for immediate termination in unrecoverable scenarios. Resolves markqvist#822
- Add .venv/ to ignore Python virtual environment directory - Add __pycache__/ to ignore Python bytecode cache files
- Replace setup.py install with standards-based pyproject.toml configuration - Add explicit Python 3.7-3.13 support in classifiers - Maintain all existing console scripts and dependencies - Use dynamic versioning from RNS._version.__version__ - Add project URLs and improved metadata - Resolve setuptools deprecation warnings for 2025-Oct-31 deadline This addresses the "setup.py install is deprecated" warnings and follows PEP 518/621 standards for modern Python packaging. Fixes: Multiple SetuptoolsDeprecationWarning messages
Resolve Pylance error where "Reticulum" is not defined on line 195. The variable should be referenced as RNS.Reticulum since only the RNS module is imported, not the Reticulum class directly.
Replace exec() call with direct string parsing to read version from RNS/_version.py. This resolves the Pylance "reportUndefinedVariable" error while maintaining single-source-of-truth for version management. - Remove exec(open("RNS/_version.py").read()) pattern - Add simple string parsing: f.read().split('=')[1].strip().strip('"') - Eliminates scope issues with version variable access
Replace invalid list expression syntax `[Callable[[int], None]]` with proper type annotation `list[Callable[[int], None]]` on line 127 of Buffer.py to resolve Pylance reportInvalidTypeForm error.
Add type: ignore comment to suppress Pylance reportInvalidTypeForm error when using NewType with Callable. The code is semantically correct but Pylance/Pyright has known issues recognizing NewType variables as valid type expressions in certain contexts. This preserves the intended type safety of MessageCallbackType while resolving the static analysis warning.
Add missing RNS.Reticulum.get_instance() calls in get_rssi(), get_snr(), and get_q() methods to properly reference the Reticulum instance before calling packet query methods. This resolves the "reticulum is not defined" error on line 372 and follows the established pattern used elsewhere in the codebase.
Replace invalid [MessageBase] list notation with proper typing.List[MessageBase] syntax to resolve Pylance reportInvalidTypeForm error. The bracket notation [T] is not valid for type expressions in Python - must use typing.List[T] or list[T] (Python 3.9+) instead.
Replace `from RNS.Interfaces import *` with explicit imports to resolve Pylance error "PipeInterface is not defined" on line 752. Added direct imports for all interface modules including PipeInterface and AX25KISSInterface to ensure proper module resolution and improve code clarity. This approach eliminates ambiguity in module loading and makes dependencies explicit.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Changes the
exit
method inRNS.__init__.py
to usesys.exit()
instead ofos._exit()
to allow proper cleanup and exception handling.Changes
os._exit()
withsys.exit()
in theexit
methodpanic
method usingos._exit()
for immediate termination in unrecoverable scenariosRationale
The
exit
method should allow for proper cleanup (finally blocks, atexit handlers, buffer flushing) while thepanic
method should remain for immediate termination in catastrophic failures.Resolves #822