Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/cmdline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The following modules have a command-line interface.
* :ref:`json <json-commandline>`
* :mod:`mimetypes`
* :mod:`pdb`
* :mod:`pickle`
* :ref:`pickle <pickle-cli>`
* :ref:`pickletools <pickletools-cli>`
* :mod:`platform`
* :mod:`poplib`
Expand Down
24 changes: 24 additions & 0 deletions Doc/library/pickle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,30 @@ The :mod:`pickle` module exports three classes, :class:`Pickler`,
Release the underlying buffer exposed by the PickleBuffer object.


.. _pickle-cli:

Command-line interface
----------------------

The :mod:`pickle` module can be invoked as a script from the command line,
it will display contents of the pickle files. However, when the pickle file
that you want to examine comes from an untrusted source, ``-m pickletools``
is a safer option because it does not execute pickle bytecode, see
:ref:`pickletools CLI usage <pickletools-cli>`.

.. code-block:: bash

python -m pickle [pickle_file ...]

The following options are accepted:

.. program:: pickle

.. option:: pickle_file

The pickle file(s).


.. _pickle-picklable:

What can be pickled and unpickled?
Expand Down
Loading