You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
>>> kubernetes.config.load_config(context='dev-admin')
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: the following arguments are required: command
ERROR:root:'NoneType' object has no attribute 'strip'
>>>
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.
Error is caused when run with stdout pointing to a tty: in ExecProvider.run(), if is_interactive gets set to True, then the subprocess is opened with stderr pointing to sys.stderr rather than subprocess.PIPE. In the later error handling code, there is no check to see if is_interactive is Trueor if stderr is not None, so the code blindly calls stderr.strip() and raises the secondary exception.
Environment:
Kubernetes version (kubectl version):
Client Version: v1.25.4
Kustomize Version: v4.5.7
OS (e.g., MacOS 10.13.6): MacOS 15.3
Python version (python --version) Python 3.11.7
Python client version (pip list | grep kubernetes)
kubernetes 31.0.0
The text was updated successfully, but these errors were encountered:
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: