execution provider errors encountered while loading configuration in interactive mode generate secondary exception #2343
Labels
kind/bug
Categorizes issue or PR as related to a bug.
lifecycle/stale
Denotes an issue or PR has remained open with no activity and has become stale.
What happened (please include outputs or screenshots):
Due to already-reported issues with ExecProvider in 32.0.0, loading my EKS-based kube config failed. i was doing my testing in an interactive shell, however, so what I saw is this:
What you expected to happen:
I did not expect the
'NoneType' object has no attribute 'strip'
exception.How to reproduce it (as minimally and precisely as possible):
The following only works with python-kubernetes version 31 or older, due to the bug introduced in ExecProvider in 32.0.0 that causes it to lose the exec arguments, but the bug in question still exists in version 32 from visual inspection of the code.
Anything else we need to know?:
Error is caused when run with stdout pointing to a tty: in
ExecProvider.run()
, ifis_interactive
gets set toTrue
, then the subprocess is opened withstderr
pointing tosys.stderr
rather thansubprocess.PIPE
. In the later error handling code, there is no check to see ifis_interactive
isTrue
or ifstderr
is notNone
, so the code blindly callsstderr.strip()
and raises the secondary exception.Environment:
kubectl version
):MacOS 15.3
python --version
)Python 3.11.7
pip list | grep kubernetes
)The text was updated successfully, but these errors were encountered: