[pull] main from ipython:main#127
Merged
Merged
Conversation
sqlite3.Connection used as a context manager only commits or rolls back, it does not close the connection. `ipython history trim/clear` therefore still had open handles on history.sqlite when unlinking and renaming it, which fails with PermissionError on Windows and leaves history.sqlite.new* files behind. Wrap both connections in contextlib.closing so they are closed before any file shuffling, and add a regression test running the trim and clear subcommands in a subprocess. Fixes #15241 https://claude.ai/code/session_01AtmUVnQwZfjDBuUzF7TdGh
The test created a HistoryManager backed by a real file but never stopped its HistorySavingThread. The thread briefly holds a strong reference to the manager inside its polling loop, so the instance could survive the gc.collect() in the hmmax fixture teardown, making the instance-leak assertion fail intermittently. Stop the saving thread and close the database like the other tests in this file do, and drop the unreachable `HistoryManager.__max_inst` assignment that name-mangling never applied anyway. Fixes #15161 https://claude.ai/code/session_01AtmUVnQwZfjDBuUzF7TdGh
Honor PEP 263 coding cookies when reading module sources for the autoreload diffing logic, the way the import system does, instead of assuming utf-8. Sources that declare another encoding were read as empty (the UnicodeDecodeError is caught and logged), disabling hot-patching for those modules, and the logged traceback was noisy on the first %load_ext autoreload. The regression test fails with the previous explicit utf-8 reading. Closes #15193 (the original cp1252 crash reported there was already fixed by reading with an explicit encoding, this handles the remaining non-utf-8 sources). https://claude.ai/code/session_01AtmUVnQwZfjDBuUzF7TdGh
inspect_object is not called anywhere in IPython anymore, so registering handlers on it has no effect, and a search of public repositories found no external users (unlike complete_object, which pyflyby, riptable and maiev register completers on, and which is unchanged). Emit a DeprecationWarning through a module __getattr__ so that simply importing the name warns, which also covers consumers that only call .register(). First step towards #15068. https://claude.ai/code/session_01AtmUVnQwZfjDBuUzF7TdGh
xml.etree.ElementTree.ParseError is a SyntaxError subclass that leaves .text set to None; IPython 9.6.0 raised an AssertionError in ListTB._format_exception_only when rendering it. The guard was added as part of #15012, but without a test; this locks the behavior in. The test fails if the None check in _format_exception_only is removed. Closes #15024 https://claude.ai/code/session_01AtmUVnQwZfjDBuUzF7TdGh
…h quoting oinspect: guard __custom_documentations__ lookup with isinstance(dict) so objects like polars Expr (which return self for any attribute access via __getattr__) no longer raise TypeError when inspected with ?. Fixes #15072. oinspect: fix inspect.Parameter.empty comparison in MIME-hook path; the previous code accidentally compared against the property descriptor object rather than the sentinel, making the required-parameter filter a no-op. test_interactiveshell: wrap sys.executable and self.fname in shlex.quote() so test_exit_code_signal survives when the source path contains spaces. Fixes #15100. https://claude.ai/code/session_01VPnGTgifZ8HMAfiqEVftjj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )