question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is tab supposed to work in the ultratb prompt ?

See original GitHub issue

I really love ultratb and I probably overuse it (instead of logging and running I often raise)

When I press tab I get a tab char inserted into the ipdb REPL.

Is tab supposed to work in ultratb or does tab completion require prompt_toolkit? Maybe it is not working on my machine or maybe it is working as it is supposed to–not sure.

If it is not supposed to work would it make sense to supply TerminalPdb instead of debugger.Pdb ? Maybe that could be exposed as a kwargs option…

Python 3.9.10 (main, Jan 17 2022, 00:00:00) 
import IPython
@>>> IPython.version_info
(8, 0, 1, '')

kitty 0.21.2 created by Kovid Goyal
fish, version 3.3.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Carreaucommented, Jan 29, 2022

It’s a bug. You can patch locally:

class TBTools(colorable.Colorable):
    """Basic tools used by all traceback printer classes."""

    # Number of frames to skip when reporting tracebacks
    tb_offset = 0

    def __init__(self, color_scheme='NoColor', call_pdb=False, ostream=None, parent=None, config=None):
        # Whether to call the interactive pdb debugger after printing
        ...
-        if call_pdb:
-            self.pdb = debugger.Pdb()
-        else:
-            self.pdb = None
+        self.pdb = None

And then using

sys.excepthook = ultratb.AutoFormattedTB(
    mode="Verbose",
    color_scheme="Neutral",
    call_pdb=1,
    debugger_cls=TerminalPdb,
)

Works for me.

I need to look into a proper fix, and see if it has other effects, or you can try to send a PR.

0reactions
chapmanjacobdcommented, Feb 13, 2022

Here is a quick way to test it out

python -c "import sys;from IPython.core import ultratb;from IPython.terminal.debugger import TerminalPdb;sys.excepthook=ultratb.FormattedTB(mode='Context',color_scheme='Neutral',call_pdb=1,debugger_cls=TerminalPdb);raise"
Read more comments on GitHub >

github_iconTop Results From Across the Web

BENADRYL® Allergy ULTRATABS® Tablets with ...
Use BENADRYL ® Allergy ULTRATABS ® Tablets with 25 mg of diphenhydramine HCI, antihistamine, for effective relief from symptoms related to hay fever,...
Read more >
Product Safety and Recalls - Campmor
ULTRAtab's Recall of [Electrolyte Tablet, 4-Component Cold Tabs, or Coated Acetaminophen 500 mg Tablet]. Impacting [Adventure Medical Kits, Easy Care Kits, ...
Read more >
8.x Series — IPython 8.7.0 documentation
If you are looking for an IPython version compatible with Python 2.7, please use the IPython 5.x LTS release and refer to its...
Read more >
IPython 3.2.1 documentation
IPython is meant to work as a drop-in replacement for the standard interactive interpreter. As such, any code which is valid python should...
Read more >
Benadryl Allergy Ultratab Tablets - 48 ct - Optum Store
Benadryl Allergy Ultratab Tablets - 48 ct, Buy with HSA/FSA on the Optum Store. ... The promo code is for one-time use only...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found