Bug 1834183 - wad fails to build with Python 3.9: encoding parameter of json.loads() has been removed
Summary: wad fails to build with Python 3.9: encoding parameter of json.loads() has be...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: wad
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fabian Affolter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON39 F33FTBFS
TreeView+ depends on / blocked
 
Reported: 2020-05-11 09:22 UTC by Miro Hrončok
Modified: 2020-06-11 11:48 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-06-11 11:48:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2020-05-11 09:22:06 UTC
wad fails to build with Python 3.9.0a6.

=================================== FAILURES ===================================
______________________________ test_clues_correct ______________________________

    def test_clues_correct():
        #
        # If there's an error, run py.test with -l option to see which field has failed.
        #
        clues = _Clues()
>       clues.load_clues(CLUES_FILE)

wad/tests/test_clues.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
wad/clues.py:91: in load_clues
    self.apps, self.categories = self.read_clues_from_file(filename)
wad/clues.py:52: in read_clues_from_file
    clues = json.load(json_data, encoding='utf-8')
/usr/lib64/python3.9/json/__init__.py:293: in load
    return loads(fp.read(),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = '{\n  "$schema": "../schema.json",\n  "apps": {\n    "1C-Bitrix": {\n      "cats": [\n        1\n      ],\n      "head...lancer",\n      "priority": 7\n    },\n    "66": {\n      "name": "UI Frameworks",\n      "priority": 7\n    }\n  }\n}'
cls = <class 'json.decoder.JSONDecoder'>, object_hook = None, parse_float = None
parse_int = None, parse_constant = None, object_pairs_hook = None
kw = {'encoding': 'utf-8'}

    def loads(s, *, cls=None, object_hook=None, parse_float=None,
            parse_int=None, parse_constant=None, object_pairs_hook=None, **kw):
        """Deserialize ``s`` (a ``str``, ``bytes`` or ``bytearray`` instance
        ...
        """
        if isinstance(s, str):
            if s.startswith('\ufeff'):
                raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
                                      s, 0)
        else:
            if not isinstance(s, (bytes, bytearray)):
                raise TypeError(f'the JSON object must be str, bytes or bytearray, '
                                f'not {s.__class__.__name__}')
            s = s.decode(detect_encoding(s), 'surrogatepass')
    
        if (cls is None and object_hook is None and
                parse_int is None and parse_float is None and
                parse_constant is None and object_pairs_hook is None and not kw):
            return _default_decoder.decode(s)
        if cls is None:
            cls = JSONDecoder
        if object_hook is not None:
            kw['object_hook'] = object_hook
        if object_pairs_hook is not None:
            kw['object_pairs_hook'] = object_pairs_hook
        if parse_float is not None:
            kw['parse_float'] = parse_float
        if parse_int is not None:
            kw['parse_int'] = parse_int
        if parse_constant is not None:
            kw['parse_constant'] = parse_constant
>       return cls(**kw).decode(s)
E       TypeError: __init__() got an unexpected keyword argument 'encoding'

/usr/lib64/python3.9/json/__init__.py:359: TypeError
...


See https://docs.python.org/3.9/whatsnew/3.9.html#removed

"The encoding parameter of json.loads() has been removed. As of Python 3.1, it was deprecated and ignored; using it has emitted a DeprecationWarning since Python 3.8."



For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01377024-wad/

For all our attempts to build wad with Python 3.9, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/wad/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.9:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Let us know here if you have any questions.

Python 3.9 will be included in Fedora 33. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.9.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Fabian Affolter 2020-05-14 20:00:52 UTC
Was fixed upstream, see https://github.com/CERN-CERT/WAD/commit/4831fd4d0c8a1e4d5465e8992e1c8236b0aa38d4

Comment 2 Miro Hrončok 2020-05-25 13:02:14 UTC
This comment is mass posted to all bugs blocking the Python 3.9 tracker, sorry if it is not 100 % relevant. When in doubt, please ask.


The Python 3.9 rebuild is in progress in a Koji side tag.

If you fix this bug, please don't rebuild the package in regular rawhide, but do it in the side tag with:

    $ fedpkg build --target=f33-python

The rebuild is progressing slowly and it is possible this package won't have all the required build dependencies yet. If that's the case, please just leave the fix committed and pushed and we will eventually rebuild it for you.

You are not asked to go and try rebuild all the missing dependencies yourself. If you know there is a bootstrap loop in the dependencies, let me know and we can untangle it together.

If you want to test your fix or reproduce the failure, you can still use the Copr repo mentioned in the initial comment of this bug: https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Comment 3 Miro Hrončok 2020-05-29 07:12:03 UTC
Python 3.9 update: The f33-python side tag is currently being merged.

New builds in f33-python are no longer possible, but python3 is not yet updated to Python 3.9 in rawhide. You can check when Python is Python 3.9 with:

    $ koji wait-repo f33-build --build python3.9-3.9.0~b1-3.fc3

And build the packages normally after that.

Comment 4 Miro Hrončok 2020-06-11 11:48:31 UTC
This is a bulk close of Python 3.9 bugzillas of packages that successfully built.
If this remained open for a reason, I am sorry and feel free to reopen.


Note You need to log in before you can comment on or make changes to this bug.