Skip to content

PyYAML > 3.13 introduces breakages in metabot.util.yamlutil #40

@nmlorg

Description

@nmlorg
metabot/test_botconf.py::test_save_load FAILED
metabot/test_multibot.py::test_save_load FAILED
metabot/util/test_yamlutil.py::test_dump_simple FAILED
metabot/util/test_yamlutil.py::test_dump_load FAILED
 ...
tmpdir = local('/tmp/pytest-of-n/pytest-1/test_dump_load2')

    def test_dump_load(tmpdir):
        """Verify the dumper and loader work as expected."""
    
        tmpfile = tmpdir.join('test.yaml')
        obj = {'key': ['value', 'value']}
>       assert yamlutil.dump(tmpfile.strpath, obj) == obj

metabot/util/test_yamlutil.py:45: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
metabot/util/yamlutil.py:29: in dump
    Dumper=_SimplifyingDumper).encode('ascii')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

documents = [{'key': ['value', 'value']}], stream = <_io.StringIO object at 0x7f4ee64bcca8>, Dumper = <class 'metabot.util.yamlutil._SimplifyingDumper'>, default_style = None, default_flow_style = False, canonical = None, indent = 4, width = 200, allow_unicode = None
line_break = None, encoding = None, explicit_start = None, explicit_end = None, version = None, tags = None, sort_keys = True

    def dump_all(documents, stream=None, Dumper=Dumper,
            default_style=None, default_flow_style=False,
            canonical=None, indent=None, width=None,
            allow_unicode=None, line_break=None,
            encoding=None, explicit_start=None, explicit_end=None,
            version=None, tags=None, sort_keys=True):
        """
        Serialize a sequence of Python objects into a YAML stream.
        If stream is None, return the produced string instead.
        """
        getvalue = None
        if stream is None:
            if encoding is None:
                stream = io.StringIO()
            else:
                stream = io.BytesIO()
            getvalue = stream.getvalue
        dumper = Dumper(stream, default_style=default_style,
                default_flow_style=default_flow_style,
                canonical=canonical, indent=indent, width=width,
                allow_unicode=allow_unicode, line_break=line_break,
                encoding=encoding, version=version, tags=tags,
>               explicit_start=explicit_start, explicit_end=explicit_end, sort_keys=sort_keys)
E       TypeError: __init__() got an unexpected keyword argument 'sort_keys'

lib/python3.7/site-packages/yaml/__init__.py:274: TypeError

See also yaml/pyyaml#265.

Metadata

Metadata

Assignees

Labels

cleanupCode changes that improve maintainability without changing behavior

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions