Conversation
sys.exit(1) was called unconditionally after the try/except block in both the download and upload paths, returning failure even when the operation succeeded. Move sys.exit(1) inside the except block and add sys.exit(0) on success.
eflowkram
force-pushed
the
fix/chirpc-exit-codes
branch
from
May 3, 2026 01:11
ffcd6b0 to
cde8745
Compare
kk7ds
reviewed
May 5, 2026
| radio.sync_in() | ||
| radio.save_mmap(options.mmap) | ||
| LOG.info("Download successful: %s", options.mmap) | ||
| sys.exit(0) |
Owner
There was a problem hiding this comment.
It would be better to not exit(0) anywhere and take that default if we fall out the bottom with nothing failing. Just moving the exit(1) into the exception handler would take care of that. That would solve the problem right?
Really, sys.exit() anywhere in the middle of something is a bad pattern (this code is super old) but especially forcing exit success in the middle is pretty weird.
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
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
sys.exit(1)was called unconditionally after the try/except block in both the--download-mmapand--upload-mmappaths, returning failure even when the operation succeeded. Any script checking the exit code would treat a successful clone as an error.Fix: move
sys.exit(1)inside theexceptblock and addsys.exit(0)on success.Steps to reproduce
Test plan
--download-mmapexits with code 0--upload-mmapexits with code 0