Skip to content
This repository was archived by the owner on Oct 20, 2022. It is now read-only.
This repository was archived by the owner on Oct 20, 2022. It is now read-only.

yamldcop.py incompatible with YAML library? #38

@rpgoldman

Description

@rpgoldman

After tweaking my issue with the version of PuLP (#37), I tried the test case again, and this time I get an error in yamldcop.py:

$ pydcop solve --algo dpop graph-coloring.yaml
Traceback (most recent call last):
  File "/Users/rpg/.virtualenvs/pydcop/bin/dcop.py", line 181, in <module>
    main()
  File "/Users/rpg/.virtualenvs/pydcop/bin/dcop.py", line 112, in main
    args.func(args)
  File "/Users/rpg/.virtualenvs/pydcop/lib/python3.9/site-packages/pydcop/commands/solve.py", line 254, in run_cmd
    dcop = load_dcop_from_file(args.dcop_files)
  File "/Users/rpg/.virtualenvs/pydcop/lib/python3.9/site-packages/pydcop/dcop/yamldcop.py", line 80, in load_dcop_from_file
    return load_dcop(content)
  File "/Users/rpg/.virtualenvs/pydcop/lib/python3.9/site-packages/pydcop/dcop/yamldcop.py", line 84, in load_dcop
    loaded = yaml.load(dcop_str)
TypeError: load() missing 1 required positional argument: 'Loader'

There's no version specification for pyyaml, so that's likely the problem here. Looking at the pyyaml changelog, we see that the load function was changed to require a Loader with version 6.0

Parsing does better when I downgrade to version 5.4.1, so that's probably a good idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions