Skip to content

Conversation

@oxygen-dioxide
Copy link

GitHub codespace is an online Linux environment with a vscode web UI. It is useful for developers who don't have a Linux device but want to test and debug their code on Linux.

krassowski and others added 30 commits July 3, 2024 11:12
While trying to implement custom magic I stumbled upon error while
trying to import decorators. I found that wrong module is mentioned and
decided to fix that.
Server is notworking anymore.
Server is not working anymore.

And cleanup the full release steps.
Co-authored-by: James Beith <james@beith.co.uk>
Allows this test to pass on Python 3.13
Random little odds and ends that have changed in 3.13 break the tests. I
think this should get the CI working again. 🤞

Closes ipython#14457
Closes ipython#14458
…#14503)

Doing something like this:

```python
try:
    5 / 0
except Exception as e:
    raise SystemExit
```

was hitting an error inside UltraTB, creating a long traceback of its
internals (which, ironically, UltraTB itself then displays correctly
:-).

`ListTB.get_exception_only()` calls the `ListTB.structured_traceback()`
method *specifically* - even if `self` is a subclass, it won't use the
subclass's method. However, the exception chaining in that method uses
recursion by calling `self.structured_traceback()`, which will use a
subclass's method. Tuples were added as an option there to support
exception chaining, but not all of the machinery in connected classes
expects a tuple.

This just skips the exception chaining logic for the `etb=None` case,
when we're showing the exception only. I'm not sure this is necessarily
the best fix, but I didn't want to spend too much time following code
around a module that's old enough to vote.

Closes ipython#12104
This is something I missed as part of moving the backend resolution to
Matplotlib. Since version 3.9.0 Matplotlib handles the case-sensitivity
of backend names, making them all lowercase for internal use. But since
matplotlib/matplotlib#28473 uppercase letters are allowed in backend
names of the form `module://soMe_moDule.sOmE_NAme`. Hence we need to not
force backend names to be lowercase in IPython when passing them to
Matplotlib. It is just a one line change that happens to make the code
simpler, plus a new test.

The Matplotlib change will be released in 3.9.1 which is due shortly,
possibly today. The new test checks the Matplotlib version to know
whether uppercase backend module names are allowed or not.
In some (unknown) situation, it is possible that the `_xterm_term_title_saved` is unset,
but the code would make a call to `_restore_term_title_xterm`, resulting in `AssertionError`.

At least on replicatable reproduction is
returning from `ipython` to `pudb` via `^D^D` on an empty cell.

See more details in ipython#14480

Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
)

`AssertionError`: `assert _xterm_term_title_saved`

In some (unknown) situation, it is possible that the
`_xterm_term_title_saved` is unset,
but the code would make a call to `_restore_term_title_xterm`, resulting
in `AssertionError`.

At least on replicatable reproduction is
returning from `ipython` to `pudb` via `^D^D` on an empty cell.

See more details in ipython#14480

Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>

<details>
<summary><em>was:</em></summary>

In some (unknown) situation, it is possible that the
`_xterm_term_title_saved` is unset, but the code would make a call to
`_restore_term_title_xterm`, resulting in `AssertionError`.

As title stacking does not seem to be getting traction
(microsoft/terminal#14575), do not set the
`xterm` variants of `_set_term_title` / `_restore_term_title`.

WSL detection: https://superuser.com/a/1749811/533196

Additionally, almost-`black` the file.

</details>
Fixes ipython#14463.

Using `pyside6 >= 6.7.0` as the `qt6` gui loop gives the following
error:
```
In [1]: %gui qt6

In [2]: Traceback (most recent call last):
  File "/Users/iant/micromamba/envs/temp/bin/ipython", line 8, in <module>
    sys.exit(start_ipython())
             ^^^^^^^^^^^^^^^
  File "/Users/iant/github/ipython/IPython/__init__.py", line 130, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/iant/micromamba/envs/temp/lib/python3.12/site-packages/traitlets/config/application.py", line 1075, in launch_instance
    app.start()
  File "/Users/iant/github/ipython/IPython/terminal/ipapp.py", line 317, in start
    self.shell.mainloop()
  File "/Users/iant/github/ipython/IPython/terminal/interactiveshell.py", line 917, in mainloop
    self.interact()
  File "/Users/iant/github/ipython/IPython/terminal/interactiveshell.py", line 902, in interact
    code = self.prompt_for_code()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/iant/github/ipython/IPython/terminal/interactiveshell.py", line 845, in prompt_for_code
    text = self.pt_app.prompt(
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/iant/micromamba/envs/temp/lib/python3.12/site-packages/prompt_toolkit/shortcuts/prompt.py", line 1035, in prompt
    return self.app.run(
           ^^^^^^^^^^^^^
  File "/Users/iant/micromamba/envs/temp/lib/python3.12/site-packages/prompt_toolkit/application/application.py", line 978, in run
    result = loop.run_until_complete(coro)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/iant/micromamba/envs/temp/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/Users/iant/micromamba/envs/temp/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/Users/iant/micromamba/envs/temp/lib/python3.12/asyncio/base_events.py", line 1948, in _run_once
    event_list = self._selector.select(timeout)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/iant/micromamba/envs/temp/lib/python3.12/site-packages/prompt_toolkit/eventloop/inputhook.py", line 150, in select
    self.inputhook(InputHookContext(self._r, input_is_ready))
  File "/Users/iant/github/ipython/IPython/terminal/pt_inputhooks/qt.py", line 50, in inputhook
    _appref = app = QtGui.QApplication([" "])
                    ^^^^^^^^^^^^^^^^^^
AttributeError: module 'PySide6.QtPrintSupport' has no attribute 'QApplication'

If you suspect this is an IPython 8.28.0.dev bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@python.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True
```

This is because we use the imported module's `__dict__` to get the
classes and functions available in the module here:

https://github.com/ipython/ipython/blob/9b8cd4a397e5894ffeadad52477bb53e0fb664fc/IPython/external/qt_loaders.py#L309-L311

This no longer works as not all the classes and functions are in the
`__dict__`. The solution in this PR is to use `dir(module)` instead.

I have tested this locally using `pyside6` 6.6.3.1, 6.7.0, 6.7.1 and
6.7.2 and it works for me. It also successfully creates Matplotlib plots
using for example
```
In [1]: %matplotlib qt6
In [2]: import matplotlib.pyplot as plt
In [3]: plt.plot([1,3,2])
```

It would be good to get independent confirmation that this fixes other
downstream libraries as I tend to work directly with IPython and
IPyKernel.
krassowski and others added 28 commits April 7, 2025 11:57
HTML `<a>` tag used for `Rich Output` link
…ain-core` release `0.3.52`) (ipython#14881)

Backport PR ipython#14879: Mask issue caused by `langchain-core` release
`0.3.52`
… new lines which are used as spaces) (ipython#14880)

Backport PR ipython#14877 on branch 8.x
(Fix LLM prefix including the new lines which are used as spaces)
…hat 0.3.54 fixed `__getattr__` issue) (ipython#14886)

Backport PR ipython#14885: Unpin `langchain-core` now that 0.3.54 fixed
`__getattr__` issue
… and `%%debug` magics) (ipython#14891)

Backport PR ipython#14890: Fix interruption of `%%time` and `%%debug` magics
… expressions with comparison operators) (ipython#14905)

Backport PR ipython#14898: Fix attribute completion for expressions with
comparison operators
… slow-starting LLM completion provider is configured) (ipython#14912)

Backport PR ipython#14910: Eliminate startup delay when slow-starting LLM
completion provider is configured
@oxygen-dioxide oxygen-dioxide changed the base branch from 8.x to 8.22.x December 24, 2025 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.