Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsafe load() call disabled by Gentoo. See bug #659348 #55

Open
guitmz opened this issue Apr 27, 2019 · 1 comment
Open

Unsafe load() call disabled by Gentoo. See bug #659348 #55

guitmz opened this issue Apr 27, 2019 · 1 comment

Comments

@guitmz
Copy link

guitmz commented Apr 27, 2019

I have installed clay just now in my Gentoo system and upon the first run I got the error message. Full error:

λ ~/ clay
Traceback (most recent call last):
  File "/home/guitmz/.local/bin/clay", line 11, in <module>
    load_entry_point('clay-player==1.1.0', 'console_scripts', 'clay')()
  File "/usr/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 2843, in load_entry_point
    return ep.load()
  File "/usr/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 2434, in load
    return self.resolve()
  File "/usr/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 2440, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/guitmz/.local/lib64/python3.6/site-packages/clay/app.py", line 16, in <module>
    from clay.player import player
  File "/home/guitmz/.local/lib64/python3.6/site-packages/clay/player.py", line 20, in <module>
    from clay.settings import settings
  File "/home/guitmz/.local/lib64/python3.6/site-packages/clay/settings.py", line 198, in <module>
    settings = _Settings()  # pylint: disable=invalid-name
  File "/home/guitmz/.local/lib64/python3.6/site-packages/clay/settings.py", line 53, in __init__
    self._load_config()
  File "/home/guitmz/.local/lib64/python3.6/site-packages/clay/settings.py", line 86, in _load_config
    self._config = yaml.load(settings_file.read())
  File "/usr/lib64/python3.6/site-packages/yaml/__init__.py", line 109, in load
    raise RuntimeError("Unsafe load() call disabled by Gentoo. See bug #659348")
RuntimeError: Unsafe load() call disabled by Gentoo. See bug #659348

Relevant Gentoo bug report https://bugs.gentoo.org/659348

It looks trivial to fix this issue (but I haven't really tried yet). Replacing yaml.load() calls with yaml.safe_load() should do it. Let me know your thoughts on this one.

I also recommend replacing yaml.dump() with yaml.safe_dump()

Thanks

@ValentijnvdBeek
Copy link
Collaborator

ValentijnvdBeek commented Apr 27, 2019

Hi Guilherme,

I just took a look and you seem to be right. Following your recommended fix works fine and didn't break anything. I included a patch file at the end including the fix but I am afraid you'll have to apply the patch yourself. I am not the owner of Clay so I can't release the new version and I am afraid that it will take another 99 years for him to appear underneath an Inuit village frozen in ice so he can team up with two teenagers to take down a fascist regime.

Good luck,

Valentijn

ValentijnvdBeek pushed a commit that referenced this issue Apr 27, 2019
Signed-off-by: Valentijn <valentijn@posteo.net>
ValentijnvdBeek pushed a commit that referenced this issue Apr 27, 2019
Signed-off-by: Valentijn <valentijn@posteo.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants