Skip to content

Commit

Permalink
chore: add warning about data loss/corruption with JSONStorage `acces…
Browse files Browse the repository at this point in the history
…s_mode` options

Closes: #506
  • Loading branch information
msiemens committed Feb 18, 2023
1 parent 5568b13 commit d0416e9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tinydb/storages.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,14 @@ def __init__(self, path: str, create_dirs=False, encoding=None, access_mode='r+'
"""
Create a new instance.
Also creates the storage file, if it doesn't exist and the access mode is appropriate for writing.
Also creates the storage file, if it doesn't exist and the access mode
is appropriate for writing.
Note: Using an access mode other than `r` or `r+` will probably lead to
data loss or data corruption!
:param path: Where to store the JSON data.
:param access_mode: mode in which the file is opened (r, r+, w, a, x, b, t, +, U)
:param access_mode: mode in which the file is opened (r, r+)
:type access_mode: str
"""

Expand Down

0 comments on commit d0416e9

Please sign in to comment.