ebu / ebu_adm_renderer

The EBU ADM Renderer, written in Python, is the reference implementation of EBU Tech 3388
https://ear.readthedocs.io
BSD 3-Clause Clear License
79 stars 13 forks source link

BUG: `ruamel.yaml`'s `safe_load()` has been removed #68

Closed npinto closed 8 months ago

npinto commented 8 months ago

I just stumbled on this bug which seems to be coming from ear's use of ruamel.yaml when using nga-binaural.

Here is the trace:

╰─$ nga-binaural ./bwf.wav bwf_binaural.wav
Traceback (most recent call last):
  File "/opt/homebrew/bin/nga-binaural", line 5, in <module>
    from nga_binaural.cmdline import render_file
  File "/opt/homebrew/lib/python3.11/site-packages/nga_binaural/cmdline.py", line 2, in <module>
    from .ear_cmdline_render_file import OfflineRenderDriver, handle_strict
  File "/opt/homebrew/lib/python3.11/site-packages/nga_binaural/ear_cmdline_render_file.py", line 11, in <module>
    from ear.core import bs2051, layout, Renderer
  File "/opt/homebrew/lib/python3.11/site-packages/ear/core/__init__.py", line 1, in <module>
    from .renderer import Renderer  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/ear/core/renderer.py", line 2, in <module>
    from .objectbased.renderer import ObjectRenderer
  File "/opt/homebrew/lib/python3.11/site-packages/ear/core/objectbased/renderer.py", line 7, in <module>
    from .gain_calc import GainCalc
  File "/opt/homebrew/lib/python3.11/site-packages/ear/core/objectbased/gain_calc.py", line 5, in <module>
    from .. import point_source
  File "/opt/homebrew/lib/python3.11/site-packages/ear/core/point_source.py", line 8, in <module>
    from . import bs2051
  File "/opt/homebrew/lib/python3.11/site-packages/ear/core/bs2051.py", line 47, in <module>
    layout_names, layouts = _load_layouts()
                            ^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/ear/core/bs2051.py", line 32, in _load_layouts
    layouts_data = yaml.safe_load(layouts_file)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/ruamel/yaml/main.py", line 1105, in safe_load
    error_deprecation('safe_load', 'load', arg="typ='safe', pure=True")
  File "/opt/homebrew/lib/python3.11/site-packages/ruamel/yaml/main.py", line 1039, in error_deprecation
    raise AttributeError(s, name=None)
AttributeError:
"safe_load()" has been removed, use

  yaml = YAML(typ='safe', pure=True)
  yaml.load(...)

instead of file "/opt/homebrew/lib/python3.11/site-packages/ear/core/bs2051.py", line 32

        layouts_data = yaml.safe_load(layouts_file)
npinto commented 8 months ago

Note that this 2.0.0 bug has been fixed in 2.1.0. Closing this issue.