diff --git a/CHANGELOG.md b/CHANGELOG.md index 6efb9ace73056e38afc54013a04b9d5a57906d3e..0c70abfbf8cef9c4dfd70b03d30c2c3f58d474e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * fixed a bug occurring in Python 3.10 with whereis * DirectorySource will raise an exception if directory does not exist and on_fail is set to RAISE * JSONEncoder will behave correctly on weird classes (no __slots and no __dict__) +* write_json_to_file will warn upon setting its kwargs (which never did anything) Build system ============ diff --git a/satella/__init__.py b/satella/__init__.py index 2449a86b68a01ae05646eee7a7fe3c4a66a62970..027d27053ec8a5c28a136faed4904eb4877a6634 100644 --- a/satella/__init__.py +++ b/satella/__init__.py @@ -1 +1 @@ -__version__ = '2.25.0a4' +__version__ = '2.25.0a5' diff --git a/satella/json.py b/satella/json.py index 1975a4f4f852f4136d156ac2d96d3dc1080ac6dd..1578b291fd07b4a1a33c2aac6fa4841046f75515 100644 --- a/satella/json.py +++ b/satella/json.py @@ -1,6 +1,7 @@ import enum import json import typing as tp +import warnings from abc import ABCMeta, abstractmethod from satella.coding.typing import NoneType @@ -73,8 +74,10 @@ def write_json_to_file(path: str, value: JSONAble, **kwargs) -> None: :param path: path to the file :param value: JSON-able content - :param kwargs: will be passed to ujson/json's dump + :param kwargs: Legacy argument do not use it, will raise a warning upon non-empty. This never did anything. """ + if kwargs: + warnings.warn('Do not use kwargs, it has no effect', DeprecationWarning) with open(path, 'w') as f_out: f_out.write(JSONEncoder().encode(value))