Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
satella
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
satella
Commits
ef877190
Commit
ef877190
authored
1 year ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
write_json_to_file will warn upon setting its kwargs (which never did anything)
parent
0b6135b3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
satella/__init__.py
+1
-1
1 addition, 1 deletion
satella/__init__.py
satella/json.py
+4
-1
4 additions, 1 deletion
satella/json.py
with
6 additions
and
2 deletions
CHANGELOG.md
+
1
−
0
View file @
ef877190
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
*
fixed a bug occurring in Python 3.10 with whereis
*
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
*
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__)
*
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
Build system
============
============
...
...
This diff is collapsed.
Click to expand it.
satella/__init__.py
+
1
−
1
View file @
ef877190
__version__
=
'
2.25.0a
4
'
__version__
=
'
2.25.0a
5
'
This diff is collapsed.
Click to expand it.
satella/json.py
+
4
−
1
View file @
ef877190
import
enum
import
enum
import
json
import
json
import
typing
as
tp
import
typing
as
tp
import
warnings
from
abc
import
ABCMeta
,
abstractmethod
from
abc
import
ABCMeta
,
abstractmethod
from
satella.coding.typing
import
NoneType
from
satella.coding.typing
import
NoneType
...
@@ -73,8 +74,10 @@ def write_json_to_file(path: str, value: JSONAble, **kwargs) -> None:
...
@@ -73,8 +74,10 @@ def write_json_to_file(path: str, value: JSONAble, **kwargs) -> None:
:param path: path to the file
:param path: path to the file
:param value: JSON-able content
: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
:
with
open
(
path
,
'
w
'
)
as
f_out
:
f_out
.
write
(
JSONEncoder
().
encode
(
value
))
f_out
.
write
(
JSONEncoder
().
encode
(
value
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment