Spyder: Code cells not properly executed from splitted editors or new window editors

Created on 4 May 2020  路  8Comments  路  Source: spyder-ide/spyder

Issue Report Checklist

  • [x] Searched the issues page for similar reports
  • [x] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [x] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [ ] Could not reproduce inside jupyter qtconsole (if console-related)
  • [x] Tried basic troubleshooting (if a bug/error)

    • [x] Restarted Spyder

    • [ ] Reset preferences with spyder --reset

    • [ ] Reinstalled the latest version of Anaconda

    • [ ] Tried the other applicable steps from the Troubleshooting Guide

  • [x] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

The behaviour is:

- the editor shows a red line above each occurence of #%%
- press Ctrl-Enter in any cell N
- console shows runcell(0,...
- the whole file runs as if no cells were defined

What steps reproduce the problem?

It appears to happen randomly in different files, but can also be reproduced more reliably when a second editor window is opened. The malfunction (sofar) always happened in the new window.

What is the expected output? What do you see instead?

See above

Paste Traceback/Error Below (if applicable)

n/a

Versions

  • Spyder version: 4.1.2 (problem first noticed a few months ago already)
  • Python version: 3.7.2 64b
  • Qt version: 5.9.6
  • PyQt version: 5.9.2
  • Operating System name/version: Win7 64b

Dependencies


# Mandatory:
atomicwrites >=1.2.0           :  1.2.1 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  0.6.1 (OK)
diff_match_patch >=20181111    :  20181111 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.2.0 (OK)
jedi =0.15.2                   :  0.15.2 (OK)
nbconvert >=4.0                :  5.3.1 (OK)
numpydoc >=0.6.0               :  0.8.0 (OK)
paramiko >=2.4.0               :  2.4.2 (OK)
parso =0.5.2                   :  0.5.2 (OK)
pexpect >=4.4.0                :  4.7.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.4.8 (OK)
pygments >=2.0                 :  2.3.1 (OK)
pylint >=0.25                  :  2.2.2 (OK)
pyls >=0.31.9;<0.32.0          :  0.31.9 (OK)
qdarkstyle >=2.8               :  2.8 (OK)
qtawesome >=0.5.7              :  0.5.7 (OK)
qtconsole >=4.6.0              :  4.6.0 (OK)
qtpy >=1.5.0                   :  1.5.2 (OK)
rtree >=0.8.3                  :  0.8.3 (OK)
sphinx >=0.6.6                 :  1.8.2 (OK)
spyder_kernels >=1.9.0;<1.10.0 :  1.9.0 (OK)
watchdog                       :  None (OK)
zmq >=17                       :  17.1.2 (OK)

# Optional:
cython >=0.21                  :  0.29.2 (OK)
matplotlib >=2.0.0             :  3.0.2 (OK)
numpy >=1.7                    :  1.15.4 (OK)
pandas >=0.13.1                :  0.24.2 (OK)
scipy >=0.17.0                 :  1.2.1 (OK)
sympy >=0.7.3                  :  1.3 (OK)

Editor IPython Console Reproduced Bug

Most helpful comment

All 8 comments

Thanks for the bug report.

I haven鈥檛 seen errors in the main window yet but code cells in a new editor window and a split view are broken in 4.x. Runcell function will always return 0 and the whole file will be executed

This is a recent regression (within the last 2-3 months)

@impact27, could you take a look at this one?

Here's another observation: When I split the editor into two panels, the new one has the problem. The work-around appears to be to just run code cells from the original editor pane.

@steff456, please take a look at this one.

I had a quick look and it looks like the first code editor stack receives the command even if it was sent from another window. I think these should be handled at the plugin level

@impact27, I was checking this issue out all the day and I found out that there's something weird with the cells in splitted editors. For example, the creation of the cells is alright in the code, but in some point it changes and even the cell highlight isn't working as expected. And I think that probably fixing the highlighting out will fix as well the run cell action.

image

Can you please help us out to see how we may fix this issue?

Thanks @impact27 !!

Was this page helpful?
0 / 5 - 0 ratings