RIPE-NCC / ripe-atlas-tools

Official command-line client for RIPE Atlas
GNU General Public License v3.0
183 stars 48 forks source link

YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated #213

Closed lamehost closed 4 years ago

lamehost commented 5 years ago

Hello,

Whenever i run ripe-atlas-tools and ~/.config/ripe-atlas-tools/rc the warning below is printed on the screen

/opt/ripe-atlas-tools/lib/python3.7/site-packages/ripe/atlas/tools/settings/init.py:34: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. custom = yaml.load(y)

Apparently you can fix it by changing https://github.com/RIPE-NCC/ripe-atlas-tools/blob/master/ripe/atlas/tools/settings/__init__.py#L34

Original (generates warning): custom = yaml.load(y)

Patched (doesn't generate warning): custom = yaml.load(y, Loader=yaml.FullLoader)

Here's the ouput from $ pip freeze

$ pip freeze asn1crypto==0.24.0 certifi==2019.3.9 cffi==1.12.3 chardet==3.0.4 cryptography==2.6.1 idna==2.8 IPy==1.0 pkg-resources==0.0.0 pycparser==2.19 pyOpenSSL==19.0.0 python-dateutil==2.8.0 pytz==2019.1 PyYAML==5.1 requests==2.22.0 ripe.atlas.cousteau==1.4.2 ripe.atlas.sagan==1.3.0 ripe.atlas.tools==2.3.0 six==1.12.0 socketIO-client==0.7.2 tzlocal==1.5.1 urllib3==1.25.2 websocket-client==0.56.0

Regards

pswapneel commented 5 years ago

OS - Ubuntu 16.04.6 LTS Python - 2.7.12 virtualenv - 15.0.1

Installed ripe.atlas.tools inside a Python virtual environment. Worked without any warning messages.

After setting the API key using the command given below, ripe-atlas configure --set authorisation.create=fbf331fa-b35f-44dd-b4bc-a921650975f4

Seeing the warning as outlined in this issue given below everytime,

/home/swapneel/ripe-atlas/.venv/local/lib/python2.7/site-packages/ripe/atlas/tools/settings/__init__.py:34: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. custom = yaml.load(y)

alias-dmesg commented 5 years ago

Hi, same issue OS: Arch Linux x86_64 (5.3.8-3-MANJARO) Python 3.7.4 Installation using AUR package (https://aur.archlinux.org/packages/ripe-atlas-tools/).

When I run any command based on ripe-atlas, I have this error in the beginning

$ ripe-atlas probe-search  --country nl                                                                                                                               
/usr/lib/python3.7/site-packages/ripe/atlas/tools/settings/__init__.py:34: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  custom = yaml.load(y)

According to https://msg.pyyaml.org/load, seems related to PyYAML version 5.1