Skip to content

Commit 76cdf8f

Browse files
authored
Merge pull request #10521 from MrMino/debugging_pip_docs
Add a section about debugging to development docs
2 parents a816e44 + 2c75f20 commit 76cdf8f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/html/development/getting-started.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,25 @@ To use linters locally, run:
125125
readability problems.
126126

127127

128+
Running pip under a debugger
129+
============================
130+
131+
In order to debug pip's behavior, you can run it under a debugger like so:
132+
133+
.. code-block:: console
134+
135+
$ python -m pdb -m pip --debug ...
136+
137+
138+
Replace the ``...`` with arguments you'd like to run pip with. Give PDB the
139+
``c`` ("continue") command afterwards, to run the process.
140+
141+
The ``--debug`` flag disables pip's exception handler, which would normally
142+
catch all unhandled exceptions. With this flag, pip will let these exceptions
143+
propagate outside of its main subroutine, letting them get caught by the
144+
debugger. This way you'll be able to debug an exception post-mortem via PDB.
145+
146+
128147
Building Documentation
129148
======================
130149

0 commit comments

Comments
 (0)