cloudnativelabs / kube-shell

Kubernetes shell: An integrated shell for working with the Kubernetes
Apache License 2.0
2.38k stars 175 forks source link

Python 3.7 support (fix deprecated yaml call) #71

Open oscarlofwenhamn opened 5 years ago

oscarlofwenhamn commented 5 years ago

When starting kube-shell i get the following warnings:

c:\python37\lib\site-packages\kubernetes\config\kube_config.py:280: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  config_dict=yaml.load(f),
c:\python37\lib\site-packages\kubeshell\kubeshell.py:43: YAMLLoadWarning: calling yaml.load_all() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  for doc in docs:

Since they reference YAMLLoadWarning: calling yaml.load_all() without Loader being deprecated I am guessing this is a question of updating to new 3.7 standards.

However, I am noticing the last commit was sept 19 2018, so I understand if this is a dead project.

Langvann commented 4 years ago

Add the following to kubeshell.py and kube_config.py to suppress warnings: yaml.warnings({'YAMLLoadWarning': False})

oscarlofwenhamn commented 4 years ago

Thanks for the tip!

oscarlofwenhamn commented 4 years ago

However, is this something that can be done after installing the script or does it require cloning and rebuildning? Would it be worth adding to the source repo?