Repository: spyder-ide/spyder
Pull request: PR: Make `infowidget` a `property` to prevent errors when it's garbage collected (IPython console)
<!--- Make sure to read the Contributing Guidelines:                   --->
<!--- https://github.com/spyder-ide/spyder/blob/master/CONTRIBUTING.md --->
<!--- and follow PEP 8, PEP 257 and Spyder's code style:               --->
<!--- https://github.com/spyder-ide/spyder/wiki/Dev:-Coding-Style      --->

## Description of Changes

<!--- Explain what you've done and why --->




### Issue(s) Resolved

<!--- List the issue(s) below, in the form "Fixes #1234"; one per line --->

Fixes #23529
Fixes #21995


### Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the [Developer Certificate of Origin](https://developercertificate.org)
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

<!--- TYPE YOUR USER/NAME AFTER THE FOLLOWING: --->
I certify the above statement is true and correct:
@jsbautista 
<!--- Thanks for your help making Spyder better for everyone! --->


Problem statement:
RuntimeError when restarting a kernel
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

i downloaded anocanda and used the anocanda cmd to install the seaborn packechs or created an enviroment

### Traceback
```python-traceback
Traceback (most recent call last):
  File "C:\Program Files\Spyder\pkgs\spyder\plugins\ipythonconsole\widgets\main_widget.py", line 2164, in restart_kernel
    client.restart_kernel()
  File "C:\Program Files\Spyder\pkgs\spyder\plugins\ipythonconsole\widgets\client.py", line 730, in restart_kernel
    if self.infowidget.isVisible():
RuntimeError: wrapped C/C++ object of type FrameWebView has been deleted
```

## Versions

* Spyder version: 5.5.4  (standalone)
* Python version: 3.8.10 64-bit
* Qt version: 5.15.2
* PyQt5 version: 5.15.10
* Operating System: Windows-10-10.0.22631-SP0

### Dependencies

```
# Mandatory:
atomicwrites >=1.2.0          :  1.4.1 (OK)
chardet >=2.0.0               :  5.2.0 (OK)
cloudpickle >=0.5.0           :  3.0.0 (OK)
cookiecutter >=1.6.0          :  2.6.0 (OK)
diff_match_patch >=20181111   :  20230430 (OK)
intervaltree                  :  None (OK)
IPython >=8.12.2,<8.13.0      :  8.12.3 (OK)
jedi >=0.17.2,<0.20.0         :  0.19.1 (OK)
jellyfish >=0.7               :  1.0.3 (OK)
jsonschema >=3.2.0            :  4.21.1 (OK)
keyring >=17.0.0              :  25.1.0 (OK)
nbconvert >=4.0               :  7.16.3 (OK)
numpydoc >=0.6.0              :  1.7.0 (OK)
paramiko >=2.4.0              :  3.4.0 (OK)
parso >=0.7.0,<0.9.0          :  0.8.4 (OK)
pexpect >=4.4.0               :  4.9.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.9.8 (OK)
pygments >=2.0                :  2.17.2 (OK)
pylint >=3.1,<4               :  3.1.0 (OK)
pylint_venv >=3.0.2           :  3.0.3 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.11.0,<1.12.0        :  1.11.0 (OK)
pylsp_black >=2.0.0,<3.0.0    :  2.0.0 (OK)
qdarkstyle >=3.2.0,<3.3.0     :  3.2.3 (OK)
qstylizer >=0.2.2             :  0.2.2 (OK)
qtawesome >=1.3.1,<1.4.0      :  1.3.1 (OK)
qtconsole >=5.5.1,<5.6.0      :  5.5.1 (OK)
qtpy >=2.1.0                  :  2.4.1 (OK)
rtree >=0.9.7                 :  1.2.0 (OK)
setuptools >=49.6.0           :  69.2.0 (OK)
sphinx >=0.6.6                :  7.1.2 (OK)
spyder_kernels >=2.5.1,<2.6.0 :  2.5.1 (OK)
textdistance >=4.2.0          :  4.6.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog                      :  4.0.0 (OK)
zmq >=24.0.0                  :  25.1.2 (OK)

# Optional:
cython >=0.21                 :  3.0.10 (OK)
matplotlib >=3.0.0            :  3.7.5 (OK)
numpy >=1.7                   :  1.24.4 (OK)
pandas >=1.1.1                :  2.0.3 (OK)
scipy >=0.17.0                :  1.10.1 (OK)
sympy >=0.7.3                 :  1.12 (OK)
```

### Environment

<details><summary>Environment</summary>

```
# packages in environment at C:\Users\MSI\anaconda3\envs\spyder-env:
#
# Name                    Version                   Build  Channel
alabaster                 0.7.12             pyhd3eb1b0_0  
arrow                     1.2.3           py312haa95532_1  
astroid                   2.14.2          py312haa95532_0  
asttokens                 2.0.5              pyhd3eb1b0_0  
atomicwrites              1.4.0                      py_0  
attrs                     23.1.0          py312haa95532_0  
autopep8                  2.0.4              pyhd3eb1b0_0  
babel                     2.11.0          py312haa95532_0  
bcrypt                    3.2.0           py312h2bbff1b_1  
beautifulsoup4            4.12.2          py312haa95532_0  
binaryornot               0.4.4              pyhd3eb1b0_1  
black                     24.3.0          py312haa95532_0  
bleach                    4.1.0              pyhd3eb1b0_0  
brotli-python             1.0.9           py312hd77b12b_7  
bzip2                     1.0.8                h2bbff1b_5  
ca-certificates           2024.3.11            haa95532_0  
certifi                   2024.2.2        py312haa95532_0  
cffi                      1.16.0          py312h2bbff1b_0  
chardet                   4.0.0           py312haa95532_1003  
charset-normalizer        2.0.4              pyhd3eb1b0_0  
click                     8.1.7           py312haa95532_0  
cloudpickle               2.2.1           py312haa95532_0  
colorama                  0.4.6           py312haa95532_0  
comm                      0.2.1           py312haa95532_0  
cookiecutter              2.6.0           py312haa95532_0  
cryptography              42.0.5          py312h89fc84f_0  
debugpy                   1.6.7           py312hd77b12b_0  
decorator                 5.1.1              pyhd3eb1b0_0  
defusedxml                0.7.1              pyhd3eb1b0_0  
diff-match-patch          20200713           pyhd3eb1b0_0  
dill                      0.3.7           py312haa95532_0  
docstring-to-markdown     0.11            py312haa95532_0  
docutils                  0.18.1          py312haa95532_3  
executing                 0.8.3              pyhd3eb1b0_0  
expat                     2.5.0                hd77b12b_0  
flake8                    7.0.0           py312haa95532_0  
icu                       73.1                 h6c2663c_0  
idna                      3.4             py312haa95532_0  
imagesize                 1.4.1           py312haa95532_0  
importlib-metadata        7.0.1           py312haa95532_0  
inflection                0.5.1           py312haa95532_1  
intervaltree              3.1.0              pyhd3eb1b0_0  
ipykernel                 6.28.0          py312haa95532_0  
ipython                   8.20.0          py312haa95532_0  
isort                     5.9.3              pyhd3eb1b0_0  
jaraco.classes            3.2.1              pyhd3eb1b0_0  
jedi                      0.18.1          py312haa95532_1  
jellyfish                 1.0.1           py312h36a85e1_0  
jinja2                    3.1.3           py312haa95532_0  
jpeg                      9e                   h2bbff1b_1  
jsonschema                4.19.2          py312haa95532_0  
jsonschema-specifications 2023.7.1        py312haa95532_0  
jupyter_client            8.6.0           py312haa95532_0  
jupyter_core              5.5.0           py312haa95532_0  
jupyterlab_pygments       0.2.2           py312haa95532_0  
keyring                   24.3.1          py312haa95532_0  
krb5                      1.20.1               h5b6d351_0  
lazy-object-proxy         1.10.0          py312h2bbff1b_0  
libclang                  14.0.6          default_hb5a9fac_1  
libclang13                14.0.6          default_h8e68704_1  
libffi                    3.4.4                hd77b12b_0  
libpng                    1.6.39               h8cc25b3_0  
libpq                     12.17                h906ac69_0  
libsodium                 1.0.18               h62dcd97_0  
libspatialindex           1.9.3                h6c2663c_0  
lz4-c                     1.9.4                h2bbff1b_0  
markdown-it-py            2.2.0           py312haa95532_1  
markupsafe                2.1.3           py312h2bbff1b_0  
matplotlib-inline         0.1.6           py312haa95532_0  
mccabe                    0.7.0              pyhd3eb1b0_0  
mdurl                     0.1.0           py312haa95532_0  
mistune                   2.0.4           py312haa95532_0  
more-itertools            10.1.0          py312haa95532_0  
mypy_extensions           1.0.0           py312haa95532_0  
nbclient                  0.8.0           py312haa95532_0  
nbconvert                 7.10.0          py312haa95532_0  
nbformat                  5.9.2           py312haa95532_0  
nest-asyncio              1.6.0           py312haa95532_0  
numpydoc                  1.5.0           py312haa95532_0  
openssl                   3.0.13               h2bbff1b_0  
packaging                 23.2            py312haa95532_0  
pandocfilters             1.5.0              pyhd3eb1b0_0  
paramiko                  2.8.1              pyhd3eb1b0_0  
parso                     0.8.3              pyhd3eb1b0_0  
pathspec                  0.10.3          py312haa95532_0  
pexpect                   4.8.0              pyhd3eb1b0_3  
pickleshare               0.7.5           pyhd3eb1b0_1003  
pip                       23.3.1          py312haa95532_0  
platformdirs              3.10.0          py312haa95532_0  
pluggy                    1.0.0           py312haa95532_1  
ply                       3.11            py312haa95532_1  
prompt-toolkit            3.0.43          py312haa95532_0  
prompt_toolkit            3.0.43               hd3eb1b0_0  
psutil                    5.9.0           py312h2bbff1b_0  
ptyprocess                0.7.0              pyhd3eb1b0_2  
pure_eval                 0.2.2              pyhd3eb1b0_0  
pycodestyle               2.11.1          py312haa95532_0  
pycparser                 2.21               pyhd3eb1b0_0  
pydocstyle                6.3.0           py312haa95532_0  
pyflakes                  3.2.0           py312haa95532_0  
pygments                  2.15.1          py312haa95532_1  
pylint                    2.16.2          py312haa95532_0  
pylint-venv               3.0.3           py312haa95532_0  
pyls-spyder               0.4.0              pyhd3eb1b0_0  
pynacl                    1.5.0           py312h8cc25b3_0  
pyqt                      5.15.10         py312hd77b12b_0  
pyqt5-sip                 12.13.0         py312h2bbff1b_0  
pyqtwebengine             5.15.10         py312hd77b12b_0  
pysocks                   1.7.1           py312haa95532_0  
python                    3.12.2               h1d929f7_0  
python-dateutil           2.8.2              pyhd3eb1b0_0  
python-fastjsonschema     2.16.2          py312haa95532_0  
python-lsp-black          2.0.0           py312haa95532_0  
python-lsp-jsonrpc        1.1.2              pyhd3eb1b0_0  
python-lsp-server         1.10.0          py312haa95532_0  
python-slugify            5.0.2              pyhd3eb1b0_0  
pytoolconfig              1.2.6           py312haa95532_0  
pytz                      2023.3.post1    py312haa95532_0  
pywin32                   305             py312h2bbff1b_0  
pywin32-ctypes            0.2.2           py312haa95532_0  
pyyaml                    6.0.1           py312h2bbff1b_0  
pyzmq                     25.1.2          py312hd77b12b_0  
qdarkstyle                3.2.3              pyhd3eb1b0_0  
qstylizer                 0.2.2           py312haa95532_0  
qt-main                   5.15.2              h19c9488_10  
qt-webengine              5.15.9               h5bd16bc_7  
qtawesome                 1.2.2           py312haa95532_0  
qtconsole                 5.5.1           py312haa95532_0  
qtpy                      2.4.1           py312haa95532_0  
referencing               0.30.2          py312haa95532_0  
requests                  2.31.0          py312haa95532_1  
rich                      13.3.5          py312haa95532_1  
rope                      1.12.0          py312haa95532_0  
rpds-py                   0.10.6          py312h062c2fa_0  
rtree                     1.0.1           py312h2eaa2aa_0  
setuptools                68.2.2          py312haa95532_0  
sip                       6.7.12          py312hd77b12b_0  
six                       1.16.0             pyhd3eb1b0_1  
snowballstemmer           2.2.0              pyhd3eb1b0_0  
sortedcontainers          2.4.0              pyhd3eb1b0_0  
soupsieve                 2.5             py312haa95532_0  
sphinx                    5.0.2           py312haa95532_0  
sphinxcontrib-applehelp   1.0.2              pyhd3eb1b0_0  
sphinxcontrib-devhelp     1.0.2              pyhd3eb1b0_0  
sphinxcontrib-htmlhelp    2.0.0              pyhd3eb1b0_0  
sphinxcontrib-jsmath      1.0.1              pyhd3eb1b0_0  
sphinxcontrib-qthelp      1.0.3              pyhd3eb1b0_0  
sphinxcontrib-serializinghtml 1.1.5              pyhd3eb1b0_0  
spyder                    5.5.1           py312haa95532_0  
spyder-kernels            2.5.0           py312haa95532_0  
sqlite                    3.41.2               h2bbff1b_0  
stack_data                0.2.0              pyhd3eb1b0_0  
text-unidecode            1.3                pyhd3eb1b0_0  
textdistance              4.2.1              pyhd3eb1b0_0  
three-merge               0.1.1              pyhd3eb1b0_0  
tinycss2                  1.2.1           py312haa95532_0  
tk                        8.6.12               h2bbff1b_0  
tomli                     2.0.1           py312haa95532_1  
tomlkit                   0.11.1          py312haa95532_0  
tornado                   6.3.3           py312h2bbff1b_0  
traitlets                 5.7.1           py312haa95532_0  
tzdata                    2024a                h04d1e81_0  
ujson                     5.4.0           py312hd77b12b_0  
unidecode                 1.2.0              pyhd3eb1b0_0  
urllib3                   2.1.0           py312haa95532_1  
vc                        14.2                 h21ff451_1  
vs2015_runtime            14.27.29016          h5e58377_2  
watchdog                  2.1.6           py312haa95532_0  
wcwidth                   0.2.5              pyhd3eb1b0_0  
webencodings              0.5.1           py312haa95532_2  
whatthepatch              1.0.2           py312haa95532_0  
wheel                     0.41.2          py312haa95532_0  
win_inet_pton             1.1.0           py312haa95532_0  
wrapt                     1.14.1          py312h2bbff1b_0  
xz                        5.4.6                h8cc25b3_0  
yaml                      0.2.5                he774522_0  
yapf                      0.40.2          py312haa95532_0  
zeromq                    4.3.5                hd77b12b_0  
zipp                      3.17.0          py312haa95532_0  
zlib                      1.2.13               h8cc25b3_0  
zstd                      1.5.5                hd43e919_0  

```
</details>


RuntimeError when opening remote console
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

Start a new remote console using an already established connection.


### Traceback
```python-traceback
Traceback (most recent call last):
  File "C:\Users\graem\AppData\Local\spyder-6\envs\spyder-runtime\Lib\site-packages\spyder\plugins\remoteclient\plugin.py", line 267, in create_ipyclient_for_server
    ipyclient = ipyconsole.create_client_for_kernel(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\graem\AppData\Local\spyder-6\envs\spyder-runtime\Lib\site-packages\spyder\plugins\ipythonconsole\plugin.py", line 749, in create_client_for_kernel
    return self.get_widget().create_client_for_kernel(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\graem\AppData\Local\spyder-6\envs\spyder-runtime\Lib\site-packages\spyder\plugins\ipythonconsole\widgets\main_widget.py", line 1767, in create_client_for_kernel
    client = ClientWidget(
             ^^^^^^^^^^^^^
  File "C:\Users\graem\AppData\Local\spyder-6\envs\spyder-runtime\Lib\site-packages\spyder\plugins\ipythonconsole\widgets\client.py", line 173, in __init__
    self.layout.addWidget(self.infowidget)
RuntimeError: wrapped C/C++ object of type FrameWebView has been deleted
```

## Versions

* Spyder version: 6.0.1  (standalone)
* Python version: 3.11.9 64-bit
* Qt version: 5.15.8
* PyQt5 version: 5.15.9
* Operating System: Windows-10-10.0.26100-SP0

### Dependencies

```
# Mandatory:
aiohttp >=3.9.3                  :  3.10.5 (OK)
asyncssh >=2.14.0,<3.0.0         :  2.17.0 (OK)
atomicwrites >=1.2.0             :  1.4.1 (OK)
chardet >=2.0.0                  :  5.2.0 (OK)
cloudpickle >=0.5.0              :  3.0.0 (OK)
cookiecutter >=1.6.0             :  2.6.0 (OK)
diff_match_patch >=20181111      :  20230430 (OK)
github >=2.3.0                   :  2.4.0 (OK)
importlib_metadata >=4.6.0       :  8.5.0 (OK)
intervaltree >=3.0.2             :  3.1.0 (OK)
IPython >=8.13.0,<9.0.0,!=8.17.1 :  8.27.0 (OK)
jedi >=0.17.2,<0.20.0            :  0.19.1 (OK)
jellyfish >=0.7                  :  1.1.0 (OK)
jsonschema >=3.2.0               :  4.23.0 (OK)
keyring >=17.0.0                 :  25.4.1 (OK)
nbconvert >=4.0                  :  7.16.4 (OK)
numpydoc >=0.6.0                 :  1.8.0 (OK)
parso >=0.7.0,<0.9.0             :  0.8.4 (OK)
pexpect >=4.4.0                  :  4.9.0 (OK)
pickleshare >=0.4                :  0.7.5 (OK)
psutil >=5.3                     :  6.0.0 (OK)
pygments >=2.0                   :  2.18.0 (OK)
pylint >=3.1,<4                  :  3.3.0 (OK)
pylint_venv >=3.0.2              :  3.0.3 (OK)
pyls_spyder >=0.4.0              :  0.4.0 (OK)
pylsp >=1.12.0,<1.13.0           :  1.12.0 (OK)
pylsp_black >=2.0.0,<3.0.0       :  2.0.0 (OK)
pyuca >=1.2                      :  1.2 (OK)
qdarkstyle >=3.2.0,<3.3.0        :  3.2.3 (OK)
qstylizer >=0.2.2                :  0.2.3 (OK)
qtawesome >=1.3.1,<1.4.0         :  1.3.1 (OK)
qtconsole >=5.6.0,<5.7.0         :  5.6.0 (OK)
qtpy >=2.4.0                     :  2.4.1 (OK)
rtree >=0.9.7                    :  1.3.0 (OK)
setuptools >=49.6.0              :  74.1.2 (OK)
sphinx >=0.6.6                   :  8.0.2 (OK)
spyder_kernels >=3.0.0,<3.1.0    :  3.0.0 (OK)
superqt >=0.6.2,<1.0.0           :  0.6.7 (OK)
textdistance >=4.2.0             :  4.6.2 (OK)
three_merge >=0.1.1              :  0.1.1 (OK)
watchdog >=0.10.3                :  5.0.2 (OK)
yarl >=1.9.4                     :  1.9.4 (OK)
zmq >=24.0.0                     :  26.2.0 (OK)

# Optional:
cython >=0.21                    :  3.0.11 (OK)
matplotlib >=3.0.0               :  3.9.2 (OK)
numpy >=1.7                      :  2.1.1 (OK)
pandas >=1.1.1                   :  2.2.3 (OK)
scipy >=0.17.0                   :  1.14.1 (OK)
sympy >=0.7.3                    :  1.13.2 (OK)
```

Hints from issue discussion:
Hey @rosenblood99, thanks for reporting. We'll fix this problem in our next version (5.5.5), to be released shortly.
I'm going to leave this error for Spyder 6 because it turned out to be harder than I thought. Please ignore it in the meantime.
Hey @fishter, thanks for reporting. We'll take a look at this issue in our 6.0.5 version, to be released in a couple of months.

In the meantime, please ignore it because it's harmless.
# What Worked
- Restarting both the remote kernel and local Spyder, restarted the remote console.

# When the issue happens (or some ways to reproduce)
- The remote kernel was non-responsive or busy.
- The issue occurs when the connected Dask cluster is non-responsive. (For Jupyter Notebooks, restarting the kernel usually restarts the remote kernel and automatically closes the Dask cluster.)
-  Try to reconnect to the remote console after manually interrupting from the spyder 


#23710

Commit message: infowidget property

Patch to review:
diff --git a/spyder/plugins/ipythonconsole/widgets/client.py b/spyder/plugins/ipythonconsole/widgets/client.py
index 6aac57e8470..7c9a19a8601 100644
--- a/spyder/plugins/ipythonconsole/widgets/client.py
+++ b/spyder/plugins/ipythonconsole/widgets/client.py
@@ -154,7 +154,7 @@ def __init__(
             special_kernel=special_kernel,
             server_id=server_id,
         )
-        self.infowidget = self.container.infowidget
+        self._infowidget = self.container.infowidget
         self.blank_page = self._create_blank_page()
         self.loading_page = self._create_loading_page()
         # To keep a reference to the page to be displayed
@@ -338,6 +338,13 @@ def connection_file(self):
         if self.kernel_handler is None:
             return None
         return self.kernel_handler.connection_file
+    
+    @property
+    def infowidget(self):
+        try:
+            return self._infowidget
+        except RuntimeError:
+            return None
 
     def connect_kernel(self, kernel_handler, first_connect=True):
         """Connect kernel to client using our handler."""
diff --git a/spyder/plugins/ipythonconsole/widgets/main_widget.py b/spyder/plugins/ipythonconsole/widgets/main_widget.py
index e1d9bbf74a8..ef5fae01fe2 100644
--- a/spyder/plugins/ipythonconsole/widgets/main_widget.py
+++ b/spyder/plugins/ipythonconsole/widgets/main_widget.py
@@ -329,7 +329,7 @@ def __init__(self, name=None, plugin=None, parent=None):
         if self.enable_infowidget:
             from spyder.widgets.browser import FrameWebView
 
-            self.infowidget = FrameWebView(self)
+            self._infowidget = FrameWebView(self)
             if WEBENGINE:
                 self.infowidget.page().setBackgroundColor(
                     QColor(MAIN_BG_COLOR))
@@ -338,7 +338,7 @@ def __init__(self, name=None, plugin=None, parent=None):
                     "background:{}".format(MAIN_BG_COLOR))
             layout.addWidget(self.infowidget)
         else:
-            self.infowidget = None
+            self._infowidget = None
 
         # Label to inform users how to get out of the pager
         self.pager_label = QLabel(_("Press <b>Q</b> to exit pager"), self)
@@ -1384,6 +1384,13 @@ def find_connection_file(self, connection_file):
 
     # ---- Public API
     # -------------------------------------------------------------------------
+    @property
+    def infowidget(self):
+        try:
+            return self._infowidget
+        except RuntimeError:
+            self.enable_infowidget = False
+            return None
 
     # ---- General
     # -------------------------------------------------------------------------
@@ -1425,18 +1432,12 @@ def refresh_container(self, give_focus=False):
                 client.set_info_page()
                 client.shellwidget.hide()
                 client.layout.addWidget(self.infowidget)
-                self.infowidget.show()
+                if self.infowidget is not None:
+                    self.infowidget.show()
             else:
                 if self.enable_infowidget:
-                    try:
+                    if self.infowidget is not None:
                         self.infowidget.hide()
-                    except RuntimeError:
-                        # Needed to handle the possible scenario where the
-                        # `infowidget` (`FrameWebView`) related C/C++ object
-                        # has been already deleted when trying to hide it.
-                        # See spyder-ider/spyder#21509
-                        self.enable_infowidget = False
-                        self.infowidget = None
                 client.shellwidget.show()
 
             # Get reference for the control widget of the selected tab


Code review comments:
diff_hunk: @@ -154,7 +154,7 @@ def __init__(
             special_kernel=special_kernel,
             server_id=server_id,
         )
-        self.infowidget = self.container.infowidget
+        self._infowidget = self.container.infowidget
path: spyder/plugins/ipythonconsole/widgets/client.py
text: @user1:
After thinking more carefully about this issue and also some manual testing, I found the changes in this file are not necessary because they are covered by the ones in `IPythonConsoleWidget`.

So, please revert them.

diff_hunk: @@ -329,7 +329,7 @@ def __init__(self, name=None, plugin=None, parent=None):
         if self.enable_infowidget:
             from spyder.widgets.browser import FrameWebView
 
-            self.infowidget = FrameWebView(self)
+            self._infowidget = FrameWebView(self)
             if WEBENGINE:
                 self.infowidget.page().setBackgroundColor(
path: spyder/plugins/ipythonconsole/widgets/main_widget.py
text: @user1:
Let's use `self._infowidget` instead of `self.infowidget` inside this `if self.enable_infowidget`  statement for simplicity. I mean, that way we'd avoid checking if `self.infowidget is not None` before using it.