GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing github.com — bpo-43316: gzip: CLI uses non-zero return code on error. by rhpvorderman · Pull Request #24647 · python/cpython Conversation
|
|
Thanks @rhpvorderman for the PR, and @methane for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
) Exit code is now 1 instead of 0. A message is printed to stderr instead of stdout. This is the proper behaviour for a tool that can be used in scripts. (cherry picked from commit cc3df63) Co-authored-by: Ruben Vorderman <[email protected]>
|
GH-24648 is a backport of this pull request to the 3.9 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
) Exit code is now 1 instead of 0. A message is printed to stderr instead of stdout. This is the proper behaviour for a tool that can be used in scripts. (cherry picked from commit cc3df63) Co-authored-by: Ruben Vorderman <[email protected]>
|
GH-24649 is a backport of this pull request to the 3.8 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Exit code is now 1 instead of 0. A message is printed to stderr instead of stdout. This is the proper behaviour for a tool that can be used in scripts. (cherry picked from commit cc3df63) Co-authored-by: Ruben Vorderman <[email protected]>
|
Thanks @methane ! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if arg[-3:] != ".gz": | ||
| print("filename doesn't end in .gz:", repr(arg)) | ||
| continue | ||
| sys.exit("filename doesn't end in .gz:", repr(arg)) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Shouldn’t this use string concatenation or f-string to pass one argument to sys.exit?
Signature is sys.exit(status=None)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You are right! We can not pass two strings to sys.exit().
I don't know why this passed the test.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Now I got it. The stderr is:
Traceback (most recent call last):
(snip)
File "/Users/inada-n/work/python/cpython/Lib/gzip.py", line 586, in main
sys.exit("filename doesn't end in .gz:", repr(arg))
TypeError: exit expected at most 1 argument, got 2
And it passes the test self.assertIn(b"filename doesn't end in .gz:", err).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #24652
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Exit code is now 1 instead of 0. A message is printed to stderr instead of stdout. This is the proper behaviour for a tool that can be used in scripts. (cherry picked from commit cc3df63) Co-authored-by: Ruben Vorderman <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.