aboutcode-org/debian-inspector

Some tests fail on Python 3.9 with `TypeError: __init__() got an unexpected keyword argument 'encoding'`

cole-h opened this issue · 0 comments

___________ TestDebian822.test_Debian822_from_file__signed_from_dsc ____________

self = <test_debcon.TestDebian822 testMethod=test_Debian822_from_file__signed_from_dsc>

    def test_Debian822_from_file__signed_from_dsc(self):
        test_file = self.get_test_loc('debcon/deb822/zlib_1.2.11.dfsg-1.dsc')
        expected_loc = 'debcon/deb822/zlib_1.2.11.dfsg-1.dsc-expected-deb822.json'
        results = debcon.Debian822.from_file(test_file).to_dict()
>       self.check_json(results, expected_loc, regen=False)

tests/test_debcon.py:139:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_utils.py:35: in check_json
    expected = json.load(ex, encoding='utf-8')
/nix/store/y1mhcjrx951lbdbf69v2wng33gc7lx1j-python3-3.9.2/lib/python3.9/json/__init__.py:293: in load
    return loads(fp.read(),

[snip]

E       TypeError: __init__() got an unexpected keyword argument 'encoding'

/nix/store/y1mhcjrx951lbdbf69v2wng33gc7lx1j-python3-3.9.2/lib/python3.9/json/__init__.py:359: TypeError

[snip]

FAILED tests/test_contents.py::TestContentsParse::test_parse_contents_debian_no_header_gzipped
FAILED tests/test_contents.py::TestContentsParse::test_parse_contents_ubuntu_with_header_plain
FAILED tests/test_copyright.py::TestDebianCopyright::test_DebianCopyright_from_file__from_copyrights_dep5_1
FAILED tests/test_copyright.py::TestDebianCopyright::test_DebianCopyright_from_file__from_copyrights_dep5_3
FAILED tests/test_copyright.py::TestDebianCopyright::test_DebianCopyright_from_file__from_copyrights_dep5_dropbear
FAILED tests/test_debcon.py::TestGetParagraphData::test_get_paragraph_data_from_file__signed_from_dsc_can_remove_signature
FAILED tests/test_debcon.py::TestGetParagraphData::test_get_paragraph_data_from_file__signed_from_dsc_does_not_crash_if_signature_not_removed
FAILED tests/test_debcon.py::TestGetParagraphData::test_get_paragraph_data_from_file_from_status
FAILED tests/test_debcon.py::TestGetParagraphData::test_get_paragraph_data_from_file_from_status_can_handle_perl_status
FAILED tests/test_debcon.py::TestGetParagraphData::test_get_paragraphs_data_from_file__from_copyrights_dep5_1
FAILED tests/test_debcon.py::TestGetParagraphData::test_get_paragraphs_data_from_file__from_copyrights_dep5_3
FAILED tests/test_debcon.py::TestGetParagraphData::test_get_paragraphs_data_from_file__from_copyrights_dep5_dropbear
FAILED tests/test_debcon.py::TestGetParagraphData::test_get_paragraphs_data_from_file__from_packages
FAILED tests/test_debcon.py::TestGetParagraphData::test_get_paragraphs_data_from_file__from_sources
FAILED tests/test_debcon.py::TestGetParagraphData::test_get_paragraphs_data_from_file__from_status
FAILED tests/test_debcon.py::TestDebian822::test_Debian822_from_file__from_status
FAILED tests/test_debcon.py::TestDebian822::test_Debian822_from_file__signed_from_dsc

All is fine on Python 3.8.