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

Documentation for load() is wrong #15

Open
cirodrig opened this issue Oct 15, 2021 · 3 comments
Open

Documentation for load() is wrong #15

cirodrig opened this issue Oct 15, 2021 · 3 comments

Comments

@cirodrig
Copy link

The documentation has many instances of load being called with one argument, which is invalid usage since release 6.0. For instance, one example looks like this:

>>> stream = file('document.yaml', 'r')    # 'document.yaml' contains a single YAML document.
>>> yaml.load(stream)

This call of load does not work in release 6.0.

Also, the signature in the Reference section is incorrect. The signature is given as load(stream, Loader=Loader) but the correct signature is load(stream, Loader).

@Rosuav
Copy link

Rosuav commented Jul 18, 2022

Replacing all examples of yaml.load with yaml.safe_load would make them functional again. Please can this be fixed?

@mattalxndr
Copy link

mattalxndr commented Feb 13, 2024

Is this project dead or something?

I had assumed it was the unofficial default yaml plugin for Python, but poking around in these issues, it seems like most of the examples in your docs (anything that calls yaml.load(input) with only a single argument) have been spitting errors for four years.

    out = yaml.load("""
          ^^^^^^^^^^^^^
TypeError: load() missing 1 required positional argument: 'Loader'
python-BaseException

Process finished with exit code 1

yaml/pyyaml#576

@ChrisBarker-NOAA
Copy link

What is up with the documentation?

Looks like this change occured almost three years ago, adn the docs are still completely out of date.

And they are also not helpful in deciding what Loader to use -- if there isn't going to be a default, there really should be guidance up front! Maybe something in the error message even.

Is there a new source of the docs?

https://github.com/yaml/pyyaml.org

looks like it hasn't been updated in 4 years -- which would explain things ...

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

4 participants