Skip to content

Suggesting minor correction to the source code #30

Open
@itlchriss

Description

@itlchriss

As the pyyaml has updated, the load function requires a Loader specified.
In the scripts/semantic_index.py, at line 140, the use of load is simply loading a simple yaml.
As the document suggested, the line

loaded = yaml.load(infile)

can be replaced with

loaded = yaml.safe_load(infile)

to avoid the following error

Traceback (most recent call last):
  File "../scripts/semparse.py", line 197, in <module>
    main()
  File "../scripts/semparse.py", line 82, in main
    SEMANTIC_INDEX = SemanticIndex(ARGS.templates)
  File "ccg2lambda/scripts/semantic_index.py", line 32, in __init__
    self.rules = load_semantic_rules(contents)
  File "ccg2lambda/scripts/semantic_index.py", line 140, in load_semantic_rules
    loaded = yaml.load(infile)
TypeError: load() missing 1 required positional argument: 'Loader'

Tested with successfully running the tool.

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