Commit Graph

190 Commits

Author SHA1 Message Date
Irit Katriel 1a720c6003
gh-95913: make the new internal classes pdb.ModuleTarget/ScriptTarget private (GH-96053) 2022-08-18 11:16:07 +01:00
Carl Bordum Hansen f481a02e6c
bpo-39278: add docstrings to functions in pdb module (#17924) 2022-05-10 15:59:58 -05:00
Tom Sparrow 60705cff70
bpo-46434: Handle missing docstrings in pdb help (GH-30705) 2022-01-21 17:00:48 +00:00
andrei kulakov 53b9458f2e
bpo-44682: Handle invalid arg to pdb's "commands" directive (#27252) 2021-07-28 18:55:03 +02:00
Jason R. Coombs ee03bad25e
bpo-44461: Check early that a pdb target is valid for execution. (#27227)
* bpo-44461: Fix bug with pdb's handling of import error due to a package which does not have a __main__ module

* 📜🤖 Added by blurb_it.

* remove "else"

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

* If running as a module, first check that it can run as a module. Alternate fix for bpo-44461.

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2021-07-27 21:51:42 -04:00
Jason R. Coombs 2c20558844
bpo-44554: refactor pdb targets (and internal tweaks) (GH-26992)
- Refactor module/script handling to share an interface (check method).
- Import functools and adjust tests for the new line number for find_function.
- Use cached_property for details.
- Add blurb.

Automerge-Triggered-By: GH:jaraco
2021-07-18 18:00:35 -07:00
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) 58248d9437
bpo-41137: Use utf-8 encoding while reading .pdbrc files (GH-21263) 2021-07-08 16:16:08 +09:00
Irit Katriel d968a638fc
bpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656) 2021-07-03 16:33:35 +01:00
huzhaojie 4cb6ba1432
bpo-43318: Fix a bug where pdb does not always echo cleared breakpoints (GH-24646) 2021-06-11 16:17:56 +01:00
Daniel Hahler 6544b2532d
bpo-37022: Fix bug where pdb's do_p/do_pp commands swallow exceptions from repr (GH-18180) 2021-06-10 21:32:04 +01:00
Erlend Egeberg Aasland 8563a7052c
bpo-28528: Fix pdb.checkline() attribute error when 'curframe' is None. (#25438)
Co-authored-by: Thomas Kluyver <takowl@gmail.com>
2021-05-12 00:26:30 +01:00
Irit Katriel 652bfdee94
bpo-26053: Fix args echoed by pdb run command (#22033) 2021-04-01 08:25:59 -07:00
Andrey Bienkowski 8603dfb421
bpo-42384: pdb: correctly populate sys.path[0] (GH-23338)
Automerge-Triggered-By: GH:gvanrossum
2021-01-21 17:19:51 -08:00
Irit Katriel 022bc7572f
bpo-41609: Fix output of pdb's whatis command for instance methods (GH-21935) 2020-08-27 02:51:12 +02:00
Serhiy Storchaka 19fcffa927
bpo-41058: Use source file encoding in pdb.find_function(). (GH-21010) 2020-06-21 11:07:50 +03:00
Serhiy Storchaka 9355868458
bpo-41043: Escape literal part of the path for glob(). (GH-20994) 2020-06-20 11:10:31 +03:00
jsnklln d593881505 bpo-38723: Pdb._runscript should use io.open_code() instead of open() (GH-17127)
Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
2019-11-12 14:42:47 -08:00
Daniel Hahler 855df7f273 closes bpo-37803: pdb: fix handling of options (--help / --version) (GH-15193)
The "--" should not be included with long options passed to
getopt.getopt.

Fixes https://bugs.python.org/issue37803
2019-09-12 16:46:37 +01:00
Daniel Hahler 8d64bfafdf bpo-36250: ignore ValueError from signal in non-main thread (GH-12251)
Authored-By: blueyed <github@thequod.de>
2019-09-09 05:45:58 -05:00
Timothy Hopper 7ea9a85f13 bpo-20523: pdb searches for .pdbrc in ~ instead of $HOME (GH-11847)
Previously pdb checked the $HOME environmental variable
to find the user .pdbrc. If $HOME is not set, the user
.pdbrc would not be found.

Change pdb to use `os.path.expanduser('~')` to determine
the user's home directory. Thus, if $HOME is not set (as
in tox or on Windows), os.path.expanduser('~') falls
back on other techniques for locating the user's home
directory.

This follows pip's implementation for loading .piprc.

Co-authored-by: Dan Lidral-Porter <dlp@aperiodic.org>
2019-08-02 15:20:14 -07:00
Steve Dower 60419a7e96
bpo-37363: Add audit events for a range of modules (GH-14301) 2019-06-24 08:42:54 -07:00
Pablo Galindo cd74e66a8c
bpo-37122: Make co->co_argcount represent the total number of positonal arguments in the code object (GH-13726) 2019-06-01 18:08:04 +01:00
Rémi Lapeyre 458560347f bpo-36969: Make PDB args command display positional only arguments (GH-13459) 2019-05-24 21:44:31 +01:00
Rémi Lapeyre bf457c7d82 bpo-36969: Make PDB args command display keyword only arguments (GH-13452) 2019-05-20 23:17:30 +01:00
Serhiy Storchaka da0847048a
bpo-36431: Use PEP 448 dict unpacking for merging two dicts. (GH-12553) 2019-03-27 08:02:28 +02:00
Daniel Hahler 3e936431e2 bpo-35931: Gracefully handle any exception in pdb debug command (GH-12103)
This is relevant for `debug doesnotexist()`, which would crash with a
NameError otherwise.
2019-03-11 20:29:04 -07:00
Daniel Hahler 4327705cfa bpo-35931: Gracefully handle SyntaxError in pdb debug command (GH-11782)
Previously, `debug print(` would cause the interpreter to exit on a SyntaxError whereas `print(` would properly display the error and return to the pdb prompt.

This patch fixes this by pre-compiling the code before passing it to `Pdb.run`.


https://bugs.python.org/issue35931
2019-02-15 12:52:53 -08:00
Mario Corchero 38bfa8418f bpo-32691: Use mod_spec.parent when running modules with pdb (GH-5474)
Previously the module name was used, which broke relative imports when pdb was run against a plain module or submodule.
2018-02-03 16:40:11 +10:00
Mario Corchero fcf8b4c102 bpo-32206: Update pdb usage to include new module option (GH-5111) 2018-01-28 14:58:47 +10:00
Mario Corchero 9f1e5f1b7f bpo-32206: Pdb can now run modules (GH-4752)
Add a new argument "-m" to the pdb module to allow
users to run `python -m pdb -m my_module_name`.

This relies on private APIs in the runpy module to work,
but we can get away with that since they're both part of
the standard library and can be updated together if
the runpy internals get refactored.
2018-01-06 17:53:05 +10:00
Barry Warsaw 35425d638c bpo-31389 Add an optional `header` argument to pdb.set_trace() (#3438)
* Give pdb.set_trace() an optional `header` argument

* What's new.

* Give pdb.set_trace() an optional `header` argument

* What's new.
2017-09-22 12:29:42 -04:00
Xavier de Gaye 291417da7f Issue #20766: Merge with 3.5. 2016-10-12 20:16:05 +02:00
Xavier de Gaye 10e54aeaa2 Issue #20766: Fix references leaked by pdb in the handling of SIGINT handlers. 2016-10-12 20:13:24 +02:00
Łukasz Langa 2eb6eca3e5 Issue #18401: pdb tests don't read ~/.pdbrc anymore
Patch by Martin Matusiak and Sam Kimbrel.
2016-09-09 22:21:17 -07:00
Martin Panter e26da7c03a Issue #27171: Fix typos in documentation, comments, and test function names 2016-06-02 10:07:09 +00:00
Martin Panter 46f50726a0 Issue #27076: Doc, comment and tests spelling fixes
Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
2016-05-26 05:35:26 +00:00
Terry Jan Reedy e989bf587c merge from 3.4 2015-09-05 19:17:24 -04:00
Terry Jan Reedy ca3f435fe6 Issue #16180: Exit pdb if file has syntax error, instead of trapping user
in an infinite loop.  Patch by Xavier de Gaye.
2015-09-05 19:13:26 -04:00
Berker Peksag 1ed2e69a4a Issue #22186: Fix typos in Lib/.
Patch by Févry Thibault.
2014-10-19 18:07:05 +03:00
Berker Peksag f23530f569 Issue #22186: Fix typos in Lib/.
Patch by Févry Thibault.
2014-10-19 18:04:38 +03:00
Serhiy Storchaka 521e5860a5 Issue #22032: __qualname__ instead of __name__ is now always used to format
fully qualified class names of Python implemented classes.
2014-07-22 15:00:37 +03:00
Berker Peksag ad5ffd4767 Issue #19076: Don't pass the redundant 'file' argument to self.error(). 2014-07-12 18:24:32 +03:00
Guido van Rossum 8820c239f7 Better behavior when stepping over yield[from]. Fixes issue 16596. By Xavier de Gaye. 2013-11-21 11:30:06 -08:00
Georg Brandl 979541935a merge with 3.3 2013-10-14 16:08:25 +02:00
Georg Brandl 0079ffc092 Closes #17154: error out gracefully on "ignore" or "condition" without argument. 2013-10-14 16:08:15 +02:00
Georg Brandl 6e22055ee1 pdb: modernize find_function() and add tests for it.
Closes #18714.
2013-10-13 20:51:47 +02:00
R David Murray 78d692f98e 18764: remove the problematic 'print' alias for the PDB 'p' command.
So that it no longer shadows the print function.

Patch by Connor Osborn, doc and test changes by R. David Murray.
2013-10-10 17:23:26 -04:00
Ezio Melotti 9a3777e525 #18705: merge with 3.3. 2013-08-17 15:53:55 +03:00
Ezio Melotti 30b9d5d3af #18705: fix a number of typos. Patch by Févry Thibault. 2013-08-17 15:50:46 +03:00
Brett Cannon cd171c8e92 Issue #18200: Back out usage of ModuleNotFoundError (8d28d44f3a9a) 2013-07-04 17:43:24 -04:00