Repository navigation
Conversation
The ConnectionError branch of check_common_error_codes_and_explain called the site builtin exit(1), which does not exist in a PyInstaller build, so the packaged executable raised NameError and printed a stray line before exiting. The fallback prints also passed sys.stderr as the first argument to print instead of using file=sys.stderr. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
When the server cannot be reached,
Errors.check_common_error_codes_and_explainprints the connection error and callsexit(1).exitis a builtin added by thesitemodule, and PyInstaller builds do not have it. In the packaged executable the call raisesNameError, whichexit_with_errorcatches and reports as a garbled line before exiting:Running from source does not show this. The exit status is 1 either way.
ConnectionErrorbranch now callssys.exit(1).exit_with_errorusedprint(sys.stderr, ...), which prints the stream object to stdout. They now usefile=sys.stderr.tests/commands/test_errors.pycover both. They fail without the change.I found this by running the executable built from
developmentagainst an unreachable server.🤖 Generated with Claude Code