[openlp-dev] Trunk revision 2764 backwards compatibility
Tomas Groth
second at tgc.dk
Thu Sep 7 15:55:49 EDT 2017
Hi,
As Phill has mentioned on IRC, this can be solved by specifying args as
keywords. This patch fixes it: https://bin.snyman.info/mmmm47cx
/Tomas
2017-09-07 7:24 GMT+02:00 Raoul Snyman <raoul at snyman.info>:
> Hey Phil,
>
> We have a problem with Python 3.6 (and apparently 3.5 as well, although
> I'm not seeing it right now):
>
> $ python3.6 openlp.py
> Traceback (most recent call last):
> File "openlp.py", line 44, in <module>
> main()
> File "openlp/core/__init__.py", line 440, in main
> settings.upgrade_settings()
> File "openlp/core/common/settings.py", line 495, in upgrade_settings
> self.setValue(new_key, old_value)
> File "openlp/core/common/settings.py", line 525, in setValue
> value = json.dumps(value, cls=OpenLPJsonEncoder)
> File "/usr/lib/python3.6/json/__init__.py", line 238, in dumps
> **kw).encode(obj)
> File "openlp/core/common/json.py", line 74, in __init__
> super().__init__(skipkeys, ensure_ascii, check_circular, allow_nan,
> sort_keys, indent, separators, default)
> TypeError: __init__() takes 1 positional argument but 9 were given
>
>
> They've removed the __init__() method from the C implementation of the
> json module. Everything is now set up in __new__.
>
> - https://bugs.python.org/issue30243
> - https://github.com/python/cpython/commit/39b73dd5131ce205dce
> e3b9e24ba0fc28934d79c
>
> It looks like you're not supposed to subclass JSONEncoder anymore, you're
> supposed to pass it a default instead:
>
> - https://github.com/python/cpython/blob/3.6/Lib/json/__init__.py#L73
>
>
> Ugh, that's a pain.
>
>
> --
> Raoul Snyman
> +1 (520) 490-9743
> raoul at snyman.info
> _______________________________________________
> openlp-dev mailing list
> openlp-dev at openlp.io
> https://lists.openlp.io/mailman/listinfo/openlp-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openlp.io/pipermail/openlp-dev/attachments/20170907/97d69639/attachment.html>
More information about the openlp-dev
mailing list