Skip to content

Omit warning prefix in "Bad git executable" message #1816

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

Merged
merged 5 commits into from
Feb 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use same code style for all logging without placeholders
When logging with only a msg argument, it is a full literal message
rather than a format string (as it is when there are placeholders).
Thus both `...("%s", text)` and `...(text)`, where `...` is a
logging method or function, are equally good code styles, provided
`text` really is known to behave the same as `str(text)`.

The latter style, `...(text)`, was used in all logging calls, both
in the git module and in the test suite, except one. This changes
the one outlier from `...("%s", text)` to `...(text)` for stylistic
consistency and to avoid giving the false impression that there is
something special about that call.
  • Loading branch information
EliahKagan committed Feb 6, 2024
commit 4b86993e029acf0bb7b36a4b5e40a588bdab6658
2 changes: 1 addition & 1 deletion test/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def _decode(stdout):
except UnicodeDecodeError:
pass
except LookupError as error:
_logger.warning("%s", str(error)) # Message already says "Unknown encoding:".
_logger.warning(str(error)) # Message already says "Unknown encoding:".

# Assume UTF-8. If invalid, substitute Unicode replacement characters.
return stdout.decode("utf-8", errors="replace")
Expand Down