Skip to content

Commit

Permalink
Indicate that Shelve.sync() is not thread-safe.
Browse files Browse the repository at this point in the history
  • Loading branch information
picnixz committed Dec 2, 2024
1 parent bf21e21 commit 85bf7c3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Doc/library/shelve.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ Two additional methods are supported:
dictionary on disk, if feasible. This is called automatically when the shelf
is closed with :meth:`close`.

.. warning::

During the call to :meth:`!sync`, the *writeback* attribute is set to
:const:`False` and other threads will stop updating the cache. As such,
this method is **not** thread-safe.


.. method:: Shelf.close()

Synchronize and close the persistent *dict* object. Operations on a closed
Expand Down

0 comments on commit 85bf7c3

Please sign in to comment.