fix(backups): pass both stdout and stderr to _extract_error_message in _list_timelines#1666
Open
SAY-5 wants to merge 1 commit into
Open
Conversation
…n _list_timelines
`_extract_error_message` is declared as
@staticmethod
def _extract_error_message(stdout: str, stderr: str) -> str:
Every other call site in src/backups.py (lines 214, 457, 531, 747,
811, 1028, 1195) supplies both arguments. The `_list_timelines`
call at line 570 was the lone exception:
extracted_error = self._extract_error_message(stderr)
so whenever `pgbackrest repo-ls` returned a non-zero exit code, the
error path raised
TypeError: _extract_error_message() missing 1 required positional
argument: 'stderr'
instead of the intended ListBackupsError, masking the underlying
backup failure.
Pass the local `output` (stdout) variable as the first argument to
match the surrounding convention.
Closes canonical#1482.
Signed-off-by: SAY-5 <say.apm35@gmail.com>
marceloneppel
approved these changes
May 4, 2026
Member
|
Thanks, @SAY-5! The CI blocked the merge due to an issue regarding your commit signature. Could you check it? |
Contributor
Author
|
Thanks @marceloneppel! Will re-push with a signed commit shortly. |
dragomirp
approved these changes
May 15, 2026
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
Closes #1482.
_extract_error_messageis declared with two positional arguments (stdout,stderr):Every other call site in
src/backups.py(L214, L457, L531, L747, L811, L1028, L1195) supplies both arguments. The_list_timelinescall at L570 was the lone exception:so whenever
pgbackrest repo-lsreturned a non-zero exit code, the error path raisedinstead of the intended
ListBackupsError, masking the underlying backup failure.Fix
Pass the local
outputvariable (the stdout captured from_execute_command) as the first argument, matching the surrounding convention. One-line change.Test plan
python -c 'import ast; ast.parse(open("src/backups.py").read())', syntax OKgrep _extract_error_message src/backups.py, all 8 call sites now pass two argumentspgbackrest repo-ls(e.g. revoked credentials) should now surface the real error insideListBackupsErrorinstead of theTypeError