mfherbst / down-frab-videos

Download videos and lecture attachments from CCC events
GNU General Public License v3.0
11 stars 3 forks source link

warning `YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated` #19

Closed pseyfert closed 4 years ago

pseyfert commented 4 years ago

Configuration loading issues a deprecation warning for me:

down-frab-videos -i input.txt
/home/pseyfert/.local/lib/python3.8/site-packages/down_frab_videos/config.py:143: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  parsed = yaml.load(f)

As suggested in the warning, the description can be found here. TLDR: parsed = yaml.load(f) should be replaced by parsed = yaml.load(f, Loader=yaml.FullLoader) or similar. I guess one could argue the user can trust user input and go for FullLoader, otoh down-frab-videos doesn't read anything complex from the config and sticking to BaseLoader will equally do the job.

mfherbst commented 4 years ago

Thanks for raising this issue. I now use safe_load in 6c4aa88.