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

Compatibility with new PyYAML (version 5.1) #60

Open
sirkonst opened this issue Mar 14, 2019 · 1 comment
Open

Compatibility with new PyYAML (version 5.1) #60

sirkonst opened this issue Mar 14, 2019 · 1 comment

Comments

@sirkonst
Copy link

Recently PyYAML was released new version 5.1 and tests for my application detects new warning yaml.YAMLLoadWarning for aiohttp-swagger:

Traceback (most recent call last):
  File "/home/_/.pyenv/versions/3.7.0/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/home/_/.pyenv/versions/3.7.0/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/home/_/develop/_/_/server.py", line 56, in serve
    web.run_app(app_factory(), port=port)
  File "/home/_/develop/_/.tox/py3.7/lib/python3.7/site-packages/aiohttp/web.py", line 415, in run_app
    reuse_port=reuse_port))
  File "/home/_/.pyenv/versions/3.7.0/lib/python3.7/asyncio/base_events.py", line 568, in run_until_complete
    return future.result()
  File "/home/_/develop/_/.tox/py3.7/lib/python3.7/site-packages/aiohttp/web.py", line 278, in _run_app
    app = await app  # type: ignore
  File "/home/_/develop/_/_/server.py", line 45, in app_factory
    contact='Coffee Team',
  File "/home/_/develop/_/.tox/py3.7/lib/python3.7/site-packages/aiohttp_swagger/__init__.py", line 62, in setup_swagger
    api_version=api_version, title=title, contact=contact
  File "/home/_/develop/_/.tox/py3.7/lib/python3.7/site-packages/aiohttp_swagger/helpers/builders.py", line 71, in generate_doc_from_each_end_point
    swagger = yaml.load(swagger_base)
  File "/home/_/develop/_/.tox/py3.7/lib/python3.7/site-packages/yaml/__init__.py", line 109, in load
    load_warning('load')
  File "/home/_/develop/_/.tox/py3.7/lib/python3.7/site-packages/yaml/__init__.py", line 55, in load_warning
    warnings.warn(message, YAMLLoadWarning, stacklevel=3)
yaml.YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.

Now, I muted that warning in my tests but hope that aiohttp-swagger fix compatibility.

@nikitagashkov
Copy link

For anyone wondering, you can suppress the warning like this:

python -W ignore::yaml.YAMLLoadWarning:aiohttp_swagger.helpers.builders:123
pytest -W ignore::yaml.YAMLLoadWarning:aiohttp_swagger.helpers.builders:123

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

Successfully merging a pull request may close this issue.

2 participants