Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error reported when exiting iPython and returning to UI on Mac OS X #601

Open
knoxsp opened this issue Apr 26, 2023 · 3 comments
Open

Error reported when exiting iPython and returning to UI on Mac OS X #601

knoxsp opened this issue Apr 26, 2023 · 3 comments
Labels

Comments

@knoxsp
Copy link

knoxsp commented Apr 26, 2023

Describe the bug
I enter iPython terminal from the debugger UI by pressing !. When I exit (ctrl+d) it returns to the UI.
Upon the second exit from iPython, the following error is shown, which I can then dismiss:

The full traceback and some other information can be found below. Please report this information, along with details on what you were      < OK          
doing at the time the exception occurred, at: https://github.com/inducer/pudb/issues                                                       < Save        
                                                                                                                                             traceback   
python version: 3.11.2 (main, Feb 16 2023, 02:55:59) [Clang 14.0.0 (clang-1400.0.29.202)]                                                                
pudb version: 2022.1.3                                                                                                                                   
urwid version: 2.1.2                                                                                                                                     
Traceback (most recent call last):                                                                                                                       
  File "/Users/stephenknox/venv/lib/python3.11/site-packages/pudb/debugger.py", line 2704, in event_loop                                                 
    toplevel.keypress(self.size, k)                                                                                                                      
  File "/Users/stephenknox/venv/lib/python3.11/site-packages/pudb/ui_tools.py", line 124, in keypress                                                    1
    return handler(self, size, key)                                                                                                                      50
           ^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                      
  File "/Users/stephenknox/venv/lib/python3.11/site-packages/pudb/debugger.py", line 2071, in run_cmdline                                                
    return run_external_cmdline(w, size, key)                                                                                                            
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                            
  File "/Users/stephenknox/venv/lib/python3.11/site-packages/pudb/debugger.py", line 2063, in run_external_cmdline                                       
    runner(curframe.f_globals, curframe.f_locals)                                                                                                        
  File "/Users/stephenknox/venv/lib/python3.11/site-packages/pudb/shell.py", line 244, in run_ipython_shell                                              
    return run_ipython_shell_v11(globals, locals)                                                                                                        
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                        
  File "/Users/stephenknox/venv/lib/python3.11/site-packages/pudb/shell.py", line 232, in run_ipython_shell_v11                                          
    shell.mainloop(*args)                                                                                                                                
  File "/Users/stephenknox/venv/lib/python3.11/site-packages/IPython/terminal/interactiveshell.py", line 900, in mainloop                                
    self.restore_term_title()                                                                                                                            
  File "/Users/stephenknox/venv/lib/python3.11/site-packages/IPython/terminal/interactiveshell.py", line 602, in restore_term_title                      
    restore_term_title()                                                                                                                                 
  File "/Users/stephenknox/venv/lib/python3.11/site-packages/IPython/utils/terminal.py", line 115, in restore_term_title                                 
    _restore_term_title()                                                                                                                                
  File "/Users/stephenknox/venv/lib/python3.11/site-packages/IPython/utils/terminal.py", line 83, in _restore_term_title_xterm                           
    assert _xterm_term_title_saved                                                                                                                       
AssertionError

To Reproduce
Steps to reproduce the behavior:

  1. Go to a breakpoint at any part of the code
  2. Enter the terminal with '!'
  3. exit terminal (ctrl+d)
  4. Re-enter terminal (!)
  5. Exit terminal again (ctrl + d)

Expected behavior
Returns to the debugger without error

Screenshots

Additional context
Add any other context about the problem here.

Versions

What version of pudb? What version of Python?
System: Mac OS X Ventura 13.3.1
python version: 3.11.2
pudb version: 2022.1.3
iPython version: 8.12.0

@knoxsp knoxsp added the Bug label Apr 26, 2023
@inducer
Copy link
Owner

inducer commented Apr 26, 2023

What terminal emulator are you using?

@knoxsp
Copy link
Author

knoxsp commented Apr 26, 2023

I'm using iTerm2

@inducer
Copy link
Owner

inducer commented Apr 26, 2023

I can reproduce this. Unfortunately, I'm not entirely sure what to do. The problem seems to be global state kept in IPython. Maybe someone could talk to them. In the meantime, ptipython may serve as a way to avoid this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants