Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork937
Description
Warning messages are most often written to standard error. Furthermore, warnings from GitPython, when they are displayed, are in most cases displayed that way unless the caller arranges otherwise, because they are displayed by calling loggers'warning
methods or, forDeprecationWarning
s, by callingwarnings.warn
.
However, the warningGit.refresh
displays when running a test command likegit --version
(with the command being tested used forgit
) fails, andGIT_PYTHON_REFRESH
is set to1
,w
,warn
, orwarning
, is different. It is printed to standard output. It also does not use any logging facility, so attempts to capture it by configuring Python logging will not succeed.
Lines 453 to 454 ind28c20b
ifmodeinwarn: | |
print("WARNING: %s"%err) |
If there is a reason for this behavior, then I think it should be commented or otherwise stated. Otherwise, I am not sure what to do. It may still not be feasible to change, because programs that use GitPython may be relying on the warning being printed to standard output, or on it not being printed to standard error. But if he behavior is going to change in the next major version, then that could be commented and/or this issue could be kept open until then. If the reason is unknown and it is undecided whether the behavior should be changed in the next major release, then a comment could be added just saying that it prints to standard output for backward compatibility.