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

Update CLI to support PyYAML 5.1 #806

Merged
merged 1 commit into from Mar 14, 2019
Merged

Conversation

waylan
Copy link
Member

@waylan waylan commented Mar 14, 2019

This should avoid any warnings. We use unsafe_load because users may
need to pass in actual Python objects. As this is only available from
the CLI, the user has much worse problems if an attacker can use this
as an attach vector.

See yaml/pyyaml#265 for an explanation of the changes in 5.1.

This should avoid any warnings. We use `unsafe_load` because users may
need to pass in actual Python objects. As this is only available from
the CLI, the user has much worse problems if an attacker can use this
as an attach vector.
except ImportError: # pragma: no cover
import json as yaml
try:
# Fall back to PyYAML <5.1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should point out that we don't list PyYAML as a dependency, so we can't force a required version. The way it works is that we support both YAML and JSON. If the PyYAML lib is installed, the user may use a either a JSON or YAML config file, either of which is parsed by PyYAML. But if PyYAML is not installed, then the user may only use a JSON config file which is parsed by the json lib in the Python Standard Library.

@waylan waylan merged commit 0861bb0 into Python-Markdown:master Mar 14, 2019
@waylan waylan deleted the yaml branch March 14, 2019 13:33
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 this pull request may close these issues.

None yet

1 participant