Skip to content

Fix bug when using ipy with gnureadline and Python 3.13 #1358

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

Merged
merged 8 commits into from
Nov 2, 2024

Conversation

tleonhardt
Copy link
Member

@tleonhardt tleonhardt commented Nov 2, 2024

Fixes #1357

This PR is a workaround to fix a bizarre bug that happens when the ipy command is executed when using gnureadline with Python 3.13 on Mac or Linux.

We aren't sure if the fundamental underlying bug exists within gnureadline, ipython, or readline; but this workaround does appear to be a solid method for preventing it.

NOTE: This PR is slightly more complicated than need be. Strictly only the try/import at the beginning is necessary. The other code within ipy where we import start_ipython from IPython if it doesn't already exist is to support the rare case that developers have actually used many times in the real world where ipython isn't installed at first and you encounter a bug in a cmd2 application and then install ipython from within the cmd2 app and then execute ipy to help debug the problem.

Also:

  • Added invoke tasks for cleaning up the ruff cache directory

@tleonhardt tleonhardt added the bug label Nov 2, 2024
@tleonhardt tleonhardt self-assigned this Nov 2, 2024
Copy link

codecov bot commented Nov 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.58%. Comparing base (ff46021) to head (4dca320).
Report is 27 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1358      +/-   ##
==========================================
+ Coverage   97.72%   98.58%   +0.86%     
==========================================
  Files          22       22              
  Lines        5753     5796      +43     
==========================================
+ Hits         5622     5714      +92     
+ Misses        131       82      -49     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tleonhardt tleonhardt requested a review from anselor as a code owner November 2, 2024 21:51
@tleonhardt tleonhardt merged commit 153c308 into master Nov 2, 2024
46 checks passed
@tleonhardt tleonhardt deleted the gnureadline_ipython_bug branch November 2, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

After exiting ipy, readline tab-completion is broken when using gnureadline + Python 3.13
2 participants