(i)pdb _runscript leads to KeyError: '_oh'
See original GitHub issueWhen I run ipdb
or pdb
in iPython (v7.22.0) using _runscript
(as, e.g. elpy-shell does), after exiting the (i)pdb sub-console, any self-printing command leads to:
ipdb> q
In [23]: x
Out[23]: ---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
~/code/python/scraps/test_edb.py in <module>
----> 1 x
/usr/local/Cellar/ipython/7.22.0/libexec/lib/python3.9/site-packages/IPython/core/displayhook.py in __call__(self, result)
261 self.write_output_prompt()
262 format_dict, md_dict = self.compute_format_data(result)
--> 263 self.update_user_ns(result)
264 self.fill_exec_result(result)
265 if format_dict:
/usr/local/Cellar/ipython/7.22.0/libexec/lib/python3.9/site-packages/IPython/core/displayhook.py in update_user_ns(self, result)
199
200 # Avoid recursive reference when displaying _oh/Out
--> 201 if self.cache_size and result is not self.shell.user_ns['_oh']:
202 if len(self.shell.user_ns['_oh']) >= self.cache_size and self.do_full_cache:
203 self.cull_cache()
KeyError: '_oh'
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Changelog — Python 3.11.1 documentation
The function call performs I/O and CPU intensive work. gh-94607: Fix subclassing complex generics with type variables in typing . Previously an error...
Read more >1Q7O: Determination of f-MLF-OH Peptide Structure with solid ...
The three-dimensional structure of the chemotactic peptide N-formyl-l-Met-l-Leu-l-Phe-OH was determined by using solid-state NMR (SSNMR).
Read more >6IBO: Catalytic deficiency of O-GlcNAc transferase leads to X ...
Catalytic deficiency of O-GlcNAc transferase leads to X-linked intellectual disability.
Read more >6ELC: Crystal Structure of O-linked Glycosylated VSG3
Biological Assembly Evidence: gel filtration ; PDB DOI · 10.2210/pdb6ELC/pdb ; Organism(s): Trypanosoma brucei brucei ; Mutation(s): No ; Membrane ...
Read more >Release 7.23.1 The IPython Development Team
This lead to issues when transformer might have had side effects; or do external queries. Starting with IPython 7.17.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jdtsmith I’ve literally just stumbled upon that too 😃. BTW. you can view the source of a magic (and for that matter, any other function / class, if you substitute
%run
) in IPython by issuingUsing single
?
shows the object’s docstring.Thanks. I have since found that
%run -d
does much of what I want, and does preserve the locals and restore them when ipdb finishes. I’m not sure how%run
accomplishes that, but glad to have discovered.