spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.38k stars 1.62k forks source link

RuntimeError when switching projects with watchdog>=2.0.0 #14803

Closed mrclary closed 3 years ago

mrclary commented 3 years ago

Problem Description

The advent of watchdog>2.0.0 manifested several issues, one of which was solved with watchdog=2.0.2 but uncovered a RuntimeError. See #14779.

watchdog>1.0.2 is not yet available on conda main channel, so bootstrap requires updating via conda-forge in order to manifest the issue.

What steps reproduce the problem?

  1. Switch from one project to another
  2. Switch back to original project
  3. Spyder issue reporter launches

Paste Traceback/Error Below (if applicable)

File "watchdog/observers/fsevents.pyc", line 283, in run
RuntimeError: Cannot add watch <ObservedWatch: path=/Users/rclary/Documents/Python/spyder-kernels, is_recursive=True> - it is already scheduled

Versions

Dependencies

Dependencies ``` # Mandatory: applaunchservices >=0.1.7 : 0.2.1 (OK) atomicwrites >=1.2.0 : 1.4.0 (OK) chardet >=2.0.0 : 4.0.0 (OK) cloudpickle >=0.5.0 : 1.6.0 (OK) diff_match_patch >=20181111 : 20200713 (OK) intervaltree >=3.0.2 : 3.1.0 (OK) IPython >=7.6.0 : 7.20.0 (OK) jedi =0.17.2 : 0.17.2 (OK) jsonschema >=3.2.0 : 3.2.0 (OK) keyring >=17.0.0 : 22.0.1 (OK) nbconvert >=4.0 : 6.0.7 (OK) numpydoc >=0.6.0 : 1.1.0 (OK) parso =0.7.0 : 0.7.0 (OK) pexpect >=4.4.0 : 4.8.0 (OK) pickleshare >=0.4 : 0.7.5 (OK) psutil >=5.3 : 5.8.0 (OK) pygments >=2.0 : 2.8.0 (OK) pylint >=1.0 : 2.7.0 (OK) pyls >=0.36.2;<1.0.0 : 0.36.2 (OK) pyls_black >=0.4.6 : 0.4.6 (OK) pyls_spyder >=0.3.2 : 0.3.2 (OK) qdarkstyle >=2.8 : 2.8.1 (OK) qtawesome >=0.5.7 : 1.0.2 (OK) qtconsole >=5.0.1 : 5.0.2 (OK) qtpy >=1.5.0 : 1.9.0 (OK) setuptools >=39.0.0 : 52.0.0 (OK) sphinx >=0.6.6 : 3.5.1 (OK) spyder_kernels >=1.10.2;<1.11.0 : 1.10.2 (OK) textdistance >=4.2.0 : 4.2.1 (OK) three_merge >=0.1.1 : 0.1.1 (OK) watchdog >=0.10.3 : 2.0.2 (OK) zmq >=17 : 22.0.3 (OK) ```
mrclary commented 3 years ago

I think this may no longer be an issue with watchdog but requires some updates on our end. See comment from @boboTiG.

bnavigator commented 3 years ago

Spyder 5.0.3 with watchdog 2.1.1: I no longer see the watchdog RuntimeError when switching projects. However I see a Qt error. Could be openSUSE specific though, as we don't pin to PyQt5 < 5.13:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/spyder/plugins/editor/widgets/editor.py", line 2177, in focus_changed
    self.refresh()
  File "/usr/lib/python3.8/site-packages/spyder/plugins/editor/widgets/editor.py", line 2320, in refresh
    self._refresh_outlineexplorer(index, update=False)
  File "/usr/lib/python3.8/site-packages/spyder/plugins/editor/widgets/editor.py", line 2190, in _refresh_outlineexplorer
    oe.set_current_editor(finfo.editor.oe_proxy,
  File "/usr/lib/python3.8/site-packages/spyder/plugins/outlineexplorer/widgets.py", line 1012, in set_current_editor
    self.treewidget.set_current_editor(editor, update)
  File "/usr/lib/python3.8/site-packages/spyder/plugins/outlineexplorer/widgets.py", line 488, in set_current_editor
    self.current_editor = editor
  File "/usr/lib/python3.8/site-packages/spyder/plugins/outlineexplorer/widgets.py", line 344, in current_editor
    self.connect_current_editor(True)
  File "/usr/lib/python3.8/site-packages/spyder/plugins/outlineexplorer/widgets.py", line 453, in connect_current_editor
    self.do_follow_cursor()
  File "/usr/lib/python3.8/site-packages/spyder/plugins/outlineexplorer/widgets.py", line 407, in do_follow_cursor
    self.go_to_cursor_position()
  File "/usr/lib/python3.8/site-packages/spyder/plugins/outlineexplorer/widgets.py", line 412, in go_to_cursor_position
    editor_id = self.editor_ids[self.current_editor]
KeyError: <spyder.plugins.outlineexplorer.editor.OutlineExplorerProxyEditor object at 0x7f0efd7ea280>
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/spyder/plugins/editor/panels/debugger.py", line 89, in paintEvent
    painter.fillRect(event.rect(), self.editor.sideareas_color)
TypeError: arguments did not match any overloaded call:
  fillRect(self, QRectF, Union[QBrush, QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'QRect'
  fillRect(self, QRect, Union[QBrush, QColor, Qt.GlobalColor, QGradient]): argument 2 has unexpected type 'NoneType'
  fillRect(self, int, int, int, int, Union[QBrush, QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'QRect'
  fillRect(self, QRectF, Union[QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'QRect'
  fillRect(self, QRect, Union[QColor, Qt.GlobalColor, QGradient]): argument 2 has unexpected type 'NoneType'
  fillRect(self, int, int, int, int, Union[QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'QRect'
  fillRect(self, int, int, int, int, Qt.GlobalColor): argument 1 has unexpected type 'QRect'
  fillRect(self, QRect, Qt.GlobalColor): argument 2 has unexpected type 'NoneType'
  fillRect(self, QRectF, Qt.GlobalColor): argument 1 has unexpected type 'QRect'
  fillRect(self, int, int, int, int, Qt.BrushStyle): argument 1 has unexpected type 'QRect'
  fillRect(self, QRect, Qt.BrushStyle): argument 2 has unexpected type 'NoneType'
  fillRect(self, QRectF, Qt.BrushStyle): argument 1 has unexpected type 'QRect'
  fillRect(self, int, int, int, int, QGradient.Preset): argument 1 has unexpected type 'QRect'
  fillRect(self, QRect, QGradient.Preset): argument 2 has unexpected type 'NoneType'
  fillRect(self, QRectF, QGradient.Preset): argument 1 has unexpected type 'QRect'
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/spyder/plugins/editor/panels/linenumber.py", line 68, in paintEvent
    painter.fillRect(event.rect(), self.editor.sideareas_color)
TypeError: arguments did not match any overloaded call:
  fillRect(self, QRectF, Union[QBrush, QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'QRect'
  fillRect(self, QRect, Union[QBrush, QColor, Qt.GlobalColor, QGradient]): argument 2 has unexpected type 'NoneType'
  fillRect(self, int, int, int, int, Union[QBrush, QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'QRect'
  fillRect(self, QRectF, Union[QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'QRect'
  fillRect(self, QRect, Union[QColor, Qt.GlobalColor, QGradient]): argument 2 has unexpected type 'NoneType'
  fillRect(self, int, int, int, int, Union[QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'QRect'
  fillRect(self, int, int, int, int, Qt.GlobalColor): argument 1 has unexpected type 'QRect'
  fillRect(self, QRect, Qt.GlobalColor): argument 2 has unexpected type 'NoneType'
  fillRect(self, QRectF, Qt.GlobalColor): argument 1 has unexpected type 'QRect'
  fillRect(self, int, int, int, int, Qt.BrushStyle): argument 1 has unexpected type 'QRect'
  fillRect(self, QRect, Qt.BrushStyle): argument 2 has unexpected type 'NoneType'
  fillRect(self, QRectF, Qt.BrushStyle): argument 1 has unexpected type 'QRect'
  fillRect(self, int, int, int, int, QGradient.Preset): argument 1 has unexpected type 'QRect'
  fillRect(self, QRect, QGradient.Preset): argument 2 has unexpected type 'NoneType'
  fillRect(self, QRectF, QGradient.Preset): argument 1 has unexpected type 'QRect'
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/spyder/plugins/editor/panels/scrollflag.py", line 183, in paintEvent
    painter.fillRect(event.rect(), self.editor.sideareas_color)
TypeError: arguments did not match any overloaded call:
  fillRect(self, QRectF, Union[QBrush, QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'QRect'
  fillRect(self, QRect, Union[QBrush, QColor, Qt.GlobalColor, QGradient]): argument 2 has unexpected type 'NoneType'
  fillRect(self, int, int, int, int, Union[QBrush, QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'QRect'
  fillRect(self, QRectF, Union[QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'QRect'
  fillRect(self, QRect, Union[QColor, Qt.GlobalColor, QGradient]): argument 2 has unexpected type 'NoneType'
  fillRect(self, int, int, int, int, Union[QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'QRect'
  fillRect(self, int, int, int, int, Qt.GlobalColor): argument 1 has unexpected type 'QRect'
  fillRect(self, QRect, Qt.GlobalColor): argument 2 has unexpected type 'NoneType'
  fillRect(self, QRectF, Qt.GlobalColor): argument 1 has unexpected type 'QRect'
  fillRect(self, int, int, int, int, Qt.BrushStyle): argument 1 has unexpected type 'QRect'
  fillRect(self, QRect, Qt.BrushStyle): argument 2 has unexpected type 'NoneType'
  fillRect(self, QRectF, Qt.BrushStyle): argument 1 has unexpected type 'QRect'
  fillRect(self, int, int, int, int, QGradient.Preset): argument 1 has unexpected type 'QRect'
  fillRect(self, QRect, QGradient.Preset): argument 2 has unexpected type 'NoneType'
  fillRect(self, QRectF, QGradient.Preset): argument 1 has unexpected type 'QRect'
mrclary commented 3 years ago

I can confirm that the original post is NOT resolved with watchdog=2.1.1 running from bootstrap on macOS Catalina in a conda environment. I cannot reproduce the KeyError mentioned by @bnavigator.

ERROR:fsevents:Unhandled exception in FSEventsEmitter
Traceback (most recent call last):
  File "/Users/rclary/opt/miniconda3/envs/spy-dev/lib/python3.9/site-packages/watchdog/observers/fsevents.py", line 309, in run
    _fsevents.add_watch(self, self.watch, self.events_callback, self.pathnames)
RuntimeError: Cannot add watch <ObservedWatch: path=/Users/rclary/Documents/Python/c2w, is_recursive=True> - it is already scheduled
Dependencies ``` # Mandatory: applaunchservices >=0.1.7 : 0.2.1 (OK) atomicwrites >=1.2.0 : 1.4.0 (OK) chardet >=2.0.0 : 4.0.0 (OK) cloudpickle >=0.5.0 : 1.6.0 (OK) cookiecutter >=1.6.0 : 1.7.2 (OK) diff_match_patch >=20181111 : 20200713 (OK) intervaltree >=3.0.2 : 3.1.0 (OK) IPython >=7.6.0 : 7.22.0 (OK) jedi =0.17.2 : 0.17.2 (OK) jsonschema >=3.2.0 : 3.2.0 (OK) keyring >=17.0.0 : 23.0.1 (OK) nbconvert >=4.0 : 6.0.7 (OK) numpydoc >=0.6.0 : 1.1.0 (OK) parso =0.7.0 : 0.7.0 (OK) pexpect >=4.4.0 : 4.8.0 (OK) pickleshare >=0.4 : 0.7.5 (OK) psutil >=5.3 : 5.8.0 (OK) pygments >=2.0 : 2.8.1 (OK) pylint >=1.0 : 2.7.4 (OK) pyls >=0.36.2;<1.0.0 : v5.0.3+2.g0b57321af (NOK) pyls_black >=0.4.6 : 0.4.6 (OK) pyls_spyder >=0.3.2;<0.4.0 : 0.3.2 (OK) qdarkstyle =3.0.2 : 3.0.dev (NOK) qstylizer >=0.1.10 : 0.1.10 (OK) qtawesome >=1.0.2 : 1.0.2 (OK) qtconsole >=5.1.0 : 5.1.0 (OK) qtpy >=1.5.0 : 1.9.0 (OK) rtree >=0.9.7 : 0.9.7 (OK) setuptools >=39.0.0 : 52.0.0.post20210125 (OK) sphinx >=0.6.6 : 4.0.1 (OK) spyder_kernels >=2.0.3;<2.1.0 : 2.1.0.dev0 (OK) textdistance >=4.2.0 : 4.2.1 (OK) three_merge >=0.1.1 : 0.1.1 (OK) watchdog >=0.10.3 : 2.1.1 (OK) zmq >=17 : 20.0.0 (OK) # Optional: cython >=0.21 : 0.29.23 (OK) matplotlib >=2.0.0 : 3.3.4 (OK) numpy >=1.7 : 1.20.2 (OK) pandas >=1.1.1 : 1.2.4 (OK) scipy >=0.17.0 : 1.6.2 (OK) sympy >=0.7.3 : 1.8 (OK) ```
mrclary commented 3 years ago

I wonder if this issue is related to #14787...

bnavigator commented 3 years ago

One more note: Even with watchdog 1.0.2, I get the above error about sideareas_color = None. So the error is unrelated to the watchdog issue.

mrclary commented 3 years ago

Okay, I can confirm that the OP still manifests when running from bootstrap in a pyenv environment with watchdog=2.1.2 and PyQt5=5.12.3 (conda's main channel is stuck at 5.9.2)

Pyenv environment: RuntimeError * Spyder version: 5.1.0.dev0 0b57321af * Python version: 3.9.4 64-bit * Qt version: 5.12.10 * PyQt5 version: 5.12.3 * Operating System: Darwin 19.6.0 ``` Package Version Location ------------------------------------------------- ---------- ------------------------------------------------------------------ alabaster 0.7.12 altgraph 0.17 appdirs 1.4.4 applaunchservices 0.2.1 appnope 0.1.2 arrow 1.1.0 astroid 2.5.6 async-generator 1.10 atomicwrites 1.4.0 attrs 21.2.0 autopep8 1.5.5 Babel 2.9.1 backcall 0.2.0 bcrypt 3.2.0 binaryornot 0.4.4 black 21.5b1 bleach 3.3.0 certifi 2020.12.5 cffi 1.14.5 chardet 4.0.0 click 8.0.1 cloudpickle 1.6.0 cookiecutter 1.7.3 coverage 5.5 cryptography 3.4.7 cycler 0.10.0 Cython 0.29.23 decorator 4.4.2 defusedxml 0.7.1 diff-match-patch 20200713 dmgbuild 1.4.2 docutils 0.17.1 ds-store 1.3.0 entrypoints 0.3 flake8 3.8.4 flaky 3.7.0 idna 2.10 imagesize 1.2.0 importlib-metadata 4.0.1 inflection 0.5.1 intervaltree 3.1.0 ipykernel 5.5.5 ipython 7.23.1 ipython-genutils 0.2.0 isort 5.8.0 jedi 0.17.2 Jinja2 3.0.1 jinja2-time 0.2.0 jsonschema 3.2.0 jupyter-client 6.1.12 jupyter-core 4.7.1 jupyterlab-pygments 0.1.2 keyring 23.0.1 kiwisolver 1.3.1 lazy-object-proxy 1.6.0 mac-alias 2.2.0 macholib 1.14 MarkupSafe 2.0.1 matplotlib 3.4.2 matplotlib-inline 0.1.2 mccabe 0.6.1 mistune 0.8.4 modulegraph 0.18 more-itertools 8.8.0 mpmath 1.2.1 mypy-extensions 0.4.3 nbclient 0.5.3 nbconvert 6.0.7 nbformat 5.1.3 nest-asyncio 1.5.1 numpy 1.20.3 numpydoc 1.1.0 packaging 20.9 pandas 1.2.4 pandocfilters 1.4.3 paramiko 2.7.2 parso 0.7.0 pathspec 0.8.1 pexpect 4.8.0 pickleshare 0.7.5 Pillow 8.2.0 pip 21.1.1 pluggy 0.13.1 poyo 0.5.0 prompt-toolkit 3.0.18 psutil 5.8.0 ptyprocess 0.7.0 py 1.10.0 py2app 0.22 pycodestyle 2.6.0 pycparser 2.20 pydocstyle 6.1.1 pyflakes 2.2.0 Pygments 2.9.0 pylint 2.8.2 pyls-black 0.4.6 pyls-spyder 0.3.2 PyNaCl 1.4.0 pyobjc 7.2 pyobjc-core 7.2 pyobjc-framework-Accounts 7.2 pyobjc-framework-AddressBook 7.2 pyobjc-framework-AdSupport 7.2 pyobjc-framework-AppleScriptKit 7.2 pyobjc-framework-AppleScriptObjC 7.2 pyobjc-framework-ApplicationServices 7.2 pyobjc-framework-AuthenticationServices 7.2 pyobjc-framework-AutomaticAssessmentConfiguration 7.2 pyobjc-framework-Automator 7.2 pyobjc-framework-AVFoundation 7.2 pyobjc-framework-AVKit 7.2 pyobjc-framework-BusinessChat 7.2 pyobjc-framework-CalendarStore 7.2 pyobjc-framework-CFNetwork 7.2 pyobjc-framework-CloudKit 7.2 pyobjc-framework-Cocoa 7.2 pyobjc-framework-Collaboration 7.2 pyobjc-framework-ColorSync 7.2 pyobjc-framework-Contacts 7.2 pyobjc-framework-ContactsUI 7.2 pyobjc-framework-CoreAudio 7.2 pyobjc-framework-CoreAudioKit 7.2 pyobjc-framework-CoreBluetooth 7.2 pyobjc-framework-CoreData 7.2 pyobjc-framework-CoreHaptics 7.2 pyobjc-framework-CoreLocation 7.2 pyobjc-framework-CoreMedia 7.2 pyobjc-framework-CoreMediaIO 7.2 pyobjc-framework-CoreMIDI 7.2 pyobjc-framework-CoreML 7.2 pyobjc-framework-CoreMotion 7.2 pyobjc-framework-CoreServices 7.2 pyobjc-framework-CoreSpotlight 7.2 pyobjc-framework-CoreText 7.2 pyobjc-framework-CoreWLAN 7.2 pyobjc-framework-CryptoTokenKit 7.2 pyobjc-framework-DeviceCheck 7.2 pyobjc-framework-DictionaryServices 7.2 pyobjc-framework-DiscRecording 7.2 pyobjc-framework-DiscRecordingUI 7.2 pyobjc-framework-DiskArbitration 7.2 pyobjc-framework-DVDPlayback 7.2 pyobjc-framework-EventKit 7.2 pyobjc-framework-ExceptionHandling 7.2 pyobjc-framework-ExecutionPolicy 7.2 pyobjc-framework-ExternalAccessory 7.2 pyobjc-framework-FileProvider 7.2 pyobjc-framework-FileProviderUI 7.2 pyobjc-framework-FinderSync 7.2 pyobjc-framework-FSEvents 7.2 pyobjc-framework-GameCenter 7.2 pyobjc-framework-GameController 7.2 pyobjc-framework-GameKit 7.2 pyobjc-framework-GameplayKit 7.2 pyobjc-framework-ImageCaptureCore 7.2 pyobjc-framework-IMServicePlugIn 7.2 pyobjc-framework-InputMethodKit 7.2 pyobjc-framework-InstallerPlugins 7.2 pyobjc-framework-InstantMessage 7.2 pyobjc-framework-Intents 7.2 pyobjc-framework-IOSurface 7.2 pyobjc-framework-iTunesLibrary 7.2 pyobjc-framework-LatentSemanticMapping 7.2 pyobjc-framework-LaunchServices 7.2 pyobjc-framework-libdispatch 7.2 pyobjc-framework-LinkPresentation 7.2 pyobjc-framework-LocalAuthentication 7.2 pyobjc-framework-MapKit 7.2 pyobjc-framework-MediaAccessibility 7.2 pyobjc-framework-MediaLibrary 7.2 pyobjc-framework-MediaPlayer 7.2 pyobjc-framework-MediaToolbox 7.2 pyobjc-framework-Metal 7.2 pyobjc-framework-MetalKit 7.2 pyobjc-framework-MetalPerformanceShaders 7.2 pyobjc-framework-ModelIO 7.2 pyobjc-framework-MultipeerConnectivity 7.2 pyobjc-framework-NaturalLanguage 7.2 pyobjc-framework-NetFS 7.2 pyobjc-framework-Network 7.2 pyobjc-framework-NetworkExtension 7.2 pyobjc-framework-NotificationCenter 7.2 pyobjc-framework-OpenDirectory 7.2 pyobjc-framework-OSAKit 7.2 pyobjc-framework-OSLog 7.2 pyobjc-framework-PencilKit 7.2 pyobjc-framework-Photos 7.2 pyobjc-framework-PhotosUI 7.2 pyobjc-framework-PreferencePanes 7.2 pyobjc-framework-PushKit 7.2 pyobjc-framework-Quartz 7.2 pyobjc-framework-QuickLookThumbnailing 7.2 pyobjc-framework-SafariServices 7.2 pyobjc-framework-SceneKit 7.2 pyobjc-framework-ScreenSaver 7.2 pyobjc-framework-ScriptingBridge 7.2 pyobjc-framework-SearchKit 7.2 pyobjc-framework-Security 7.2 pyobjc-framework-SecurityFoundation 7.2 pyobjc-framework-SecurityInterface 7.2 pyobjc-framework-ServiceManagement 7.2 pyobjc-framework-Social 7.2 pyobjc-framework-SoundAnalysis 7.2 pyobjc-framework-Speech 7.2 pyobjc-framework-SpriteKit 7.2 pyobjc-framework-StoreKit 7.2 pyobjc-framework-SyncServices 7.2 pyobjc-framework-SystemConfiguration 7.2 pyobjc-framework-SystemExtensions 7.2 pyobjc-framework-UserNotifications 7.2 pyobjc-framework-VideoSubscriberAccount 7.2 pyobjc-framework-VideoToolbox 7.2 pyobjc-framework-Vision 7.2 pyobjc-framework-WebKit 7.2 pyparsing 2.4.7 PyQt5 5.12.3 PyQt5-sip 12.9.0 PyQtWebEngine 5.12.1 pyrsistent 0.17.3 pytest 5.4.3 pytest-cov 2.12.0 pytest-lazy-fixture 0.6.3 pytest-mock 3.6.1 pytest-order 0.11.0 pytest-qt 3.3.0 python-dateutil 2.8.1 python-jsonrpc-server 0.4.0 python-slugify 5.0.2 pytz 2021.1 pyxdg 0.27 PyYAML 5.4.1 pyzmq 22.0.3 QDarkStyle 3.0.dev0 /Users/rclary/Documents/Python/spyder/external-deps/qdarkstyle qstylizer 0.2.0 QtAwesome 1.0.2 qtconsole 5.1.0 QtPy 1.9.0 regex 2021.4.4 requests 2.25.1 rope 0.19.0 Rtree 0.9.7 scipy 1.6.3 setuptools 56.2.0 six 1.16.0 snowballstemmer 2.1.0 sortedcontainers 2.4.0 Sphinx 4.0.2 sphinxcontrib-applehelp 1.0.2 sphinxcontrib-devhelp 1.0.2 sphinxcontrib-htmlhelp 1.0.3 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.3 sphinxcontrib-serializinghtml 1.1.4 spyder-kernels 2.1.0.dev0 /Users/rclary/Documents/Python/spyder/external-deps/spyder-kernels sympy 1.8 testpath 0.5.0 text-unidecode 1.3 textdistance 4.2.1 three-merge 0.1.1 tinycss2 1.1.0 toml 0.10.2 tornado 6.1 traitlets 5.0.5 ujson 4.0.2 urllib3 1.26.4 watchdog 2.1.2 wcwidth 0.2.5 webencodings 0.5.1 wrapt 1.12.1 wurlitzer 2.1.0 yapf 0.31.0 zipp 3.4.1 ```
mrclary commented 3 years ago

@bnavigator , it actually looks like your first error is

editor_id = self.editor_ids[self.current_editor]
KeyError: <spyder.plugins.outlineexplorer.editor.OutlineExplorerProxyEditor object at 0x7f0efd7ea280>

which means that self.current_editor returns an OutlineExplorerProxyEditor object instead of a string object. Could this be related to PyQt5 >= 5.13?

mrclary commented 3 years ago

Okay, I can also confirm that the OP still manifests when running from bootstrap in a pyenv environment with watchdog=2.1.2 and PyQt5=5.15.4, and I cannot reproduce @bnavigator's KeyError.

Pyenv environment: RuntimeError * Spyder version: 5.1.0.dev0 65294a8b8 * Python version: 3.9.4 64-bit * Qt version: 5.15.2 * PyQt5 version: 5.15.4 * Operating System: Darwin 19.6.0 ``` Package Version Location ------------------------------------------------- ---------- ------------------------------------------------------------------ alabaster 0.7.12 altgraph 0.17 appdirs 1.4.4 applaunchservices 0.2.1 appnope 0.1.2 arrow 1.1.0 astroid 2.5.6 async-generator 1.10 atomicwrites 1.4.0 attrs 21.2.0 autopep8 1.5.5 Babel 2.9.1 backcall 0.2.0 bcrypt 3.2.0 binaryornot 0.4.4 black 21.5b1 bleach 3.3.0 certifi 2020.12.5 cffi 1.14.5 chardet 4.0.0 click 8.0.1 cloudpickle 1.6.0 cookiecutter 1.7.3 coverage 5.5 cryptography 3.4.7 cycler 0.10.0 Cython 0.29.23 decorator 4.4.2 defusedxml 0.7.1 diff-match-patch 20200713 dmgbuild 1.4.2 docutils 0.17.1 ds-store 1.3.0 entrypoints 0.3 flake8 3.8.4 flaky 3.7.0 idna 2.10 imagesize 1.2.0 importlib-metadata 4.0.1 inflection 0.5.1 intervaltree 3.1.0 ipykernel 5.5.5 ipython 7.23.1 ipython-genutils 0.2.0 isort 5.8.0 jedi 0.17.2 Jinja2 3.0.1 jinja2-time 0.2.0 jsonschema 3.2.0 jupyter-client 6.1.12 jupyter-core 4.7.1 jupyterlab-pygments 0.1.2 keyring 23.0.1 kiwisolver 1.3.1 lazy-object-proxy 1.6.0 mac-alias 2.2.0 macholib 1.14 MarkupSafe 2.0.1 matplotlib 3.4.2 matplotlib-inline 0.1.2 mccabe 0.6.1 mistune 0.8.4 modulegraph 0.18 more-itertools 8.8.0 mpmath 1.2.1 mypy-extensions 0.4.3 nbclient 0.5.3 nbconvert 6.0.7 nbformat 5.1.3 nest-asyncio 1.5.1 numpy 1.20.3 numpydoc 1.1.0 packaging 20.9 pandas 1.2.4 pandocfilters 1.4.3 paramiko 2.7.2 parso 0.7.0 pathspec 0.8.1 pexpect 4.8.0 pickleshare 0.7.5 Pillow 8.2.0 pip 21.1.1 pluggy 0.13.1 poyo 0.5.0 prompt-toolkit 3.0.18 psutil 5.8.0 ptyprocess 0.7.0 py 1.10.0 py2app 0.22 pycodestyle 2.6.0 pycparser 2.20 pydocstyle 6.1.1 pyflakes 2.2.0 Pygments 2.9.0 pylint 2.8.2 pyls-black 0.4.6 pyls-spyder 0.3.2 PyNaCl 1.4.0 pyobjc 7.2 pyobjc-core 7.2 pyobjc-framework-Accounts 7.2 pyobjc-framework-AddressBook 7.2 pyobjc-framework-AdSupport 7.2 pyobjc-framework-AppleScriptKit 7.2 pyobjc-framework-AppleScriptObjC 7.2 pyobjc-framework-ApplicationServices 7.2 pyobjc-framework-AuthenticationServices 7.2 pyobjc-framework-AutomaticAssessmentConfiguration 7.2 pyobjc-framework-Automator 7.2 pyobjc-framework-AVFoundation 7.2 pyobjc-framework-AVKit 7.2 pyobjc-framework-BusinessChat 7.2 pyobjc-framework-CalendarStore 7.2 pyobjc-framework-CFNetwork 7.2 pyobjc-framework-CloudKit 7.2 pyobjc-framework-Cocoa 7.2 pyobjc-framework-Collaboration 7.2 pyobjc-framework-ColorSync 7.2 pyobjc-framework-Contacts 7.2 pyobjc-framework-ContactsUI 7.2 pyobjc-framework-CoreAudio 7.2 pyobjc-framework-CoreAudioKit 7.2 pyobjc-framework-CoreBluetooth 7.2 pyobjc-framework-CoreData 7.2 pyobjc-framework-CoreHaptics 7.2 pyobjc-framework-CoreLocation 7.2 pyobjc-framework-CoreMedia 7.2 pyobjc-framework-CoreMediaIO 7.2 pyobjc-framework-CoreMIDI 7.2 pyobjc-framework-CoreML 7.2 pyobjc-framework-CoreMotion 7.2 pyobjc-framework-CoreServices 7.2 pyobjc-framework-CoreSpotlight 7.2 pyobjc-framework-CoreText 7.2 pyobjc-framework-CoreWLAN 7.2 pyobjc-framework-CryptoTokenKit 7.2 pyobjc-framework-DeviceCheck 7.2 pyobjc-framework-DictionaryServices 7.2 pyobjc-framework-DiscRecording 7.2 pyobjc-framework-DiscRecordingUI 7.2 pyobjc-framework-DiskArbitration 7.2 pyobjc-framework-DVDPlayback 7.2 pyobjc-framework-EventKit 7.2 pyobjc-framework-ExceptionHandling 7.2 pyobjc-framework-ExecutionPolicy 7.2 pyobjc-framework-ExternalAccessory 7.2 pyobjc-framework-FileProvider 7.2 pyobjc-framework-FileProviderUI 7.2 pyobjc-framework-FinderSync 7.2 pyobjc-framework-FSEvents 7.2 pyobjc-framework-GameCenter 7.2 pyobjc-framework-GameController 7.2 pyobjc-framework-GameKit 7.2 pyobjc-framework-GameplayKit 7.2 pyobjc-framework-ImageCaptureCore 7.2 pyobjc-framework-IMServicePlugIn 7.2 pyobjc-framework-InputMethodKit 7.2 pyobjc-framework-InstallerPlugins 7.2 pyobjc-framework-InstantMessage 7.2 pyobjc-framework-Intents 7.2 pyobjc-framework-IOSurface 7.2 pyobjc-framework-iTunesLibrary 7.2 pyobjc-framework-LatentSemanticMapping 7.2 pyobjc-framework-LaunchServices 7.2 pyobjc-framework-libdispatch 7.2 pyobjc-framework-LinkPresentation 7.2 pyobjc-framework-LocalAuthentication 7.2 pyobjc-framework-MapKit 7.2 pyobjc-framework-MediaAccessibility 7.2 pyobjc-framework-MediaLibrary 7.2 pyobjc-framework-MediaPlayer 7.2 pyobjc-framework-MediaToolbox 7.2 pyobjc-framework-Metal 7.2 pyobjc-framework-MetalKit 7.2 pyobjc-framework-MetalPerformanceShaders 7.2 pyobjc-framework-ModelIO 7.2 pyobjc-framework-MultipeerConnectivity 7.2 pyobjc-framework-NaturalLanguage 7.2 pyobjc-framework-NetFS 7.2 pyobjc-framework-Network 7.2 pyobjc-framework-NetworkExtension 7.2 pyobjc-framework-NotificationCenter 7.2 pyobjc-framework-OpenDirectory 7.2 pyobjc-framework-OSAKit 7.2 pyobjc-framework-OSLog 7.2 pyobjc-framework-PencilKit 7.2 pyobjc-framework-Photos 7.2 pyobjc-framework-PhotosUI 7.2 pyobjc-framework-PreferencePanes 7.2 pyobjc-framework-PushKit 7.2 pyobjc-framework-Quartz 7.2 pyobjc-framework-QuickLookThumbnailing 7.2 pyobjc-framework-SafariServices 7.2 pyobjc-framework-SceneKit 7.2 pyobjc-framework-ScreenSaver 7.2 pyobjc-framework-ScriptingBridge 7.2 pyobjc-framework-SearchKit 7.2 pyobjc-framework-Security 7.2 pyobjc-framework-SecurityFoundation 7.2 pyobjc-framework-SecurityInterface 7.2 pyobjc-framework-ServiceManagement 7.2 pyobjc-framework-Social 7.2 pyobjc-framework-SoundAnalysis 7.2 pyobjc-framework-Speech 7.2 pyobjc-framework-SpriteKit 7.2 pyobjc-framework-StoreKit 7.2 pyobjc-framework-SyncServices 7.2 pyobjc-framework-SystemConfiguration 7.2 pyobjc-framework-SystemExtensions 7.2 pyobjc-framework-UserNotifications 7.2 pyobjc-framework-VideoSubscriberAccount 7.2 pyobjc-framework-VideoToolbox 7.2 pyobjc-framework-Vision 7.2 pyobjc-framework-WebKit 7.2 pyparsing 2.4.7 PyQt5 5.15.4 PyQt5-Qt5 5.15.2 PyQt5-sip 12.9.0 PyQtWebEngine 5.15.4 PyQtWebEngine-Qt5 5.15.2 pyrsistent 0.17.3 pytest 5.4.3 pytest-cov 2.12.0 pytest-lazy-fixture 0.6.3 pytest-mock 3.6.1 pytest-order 0.11.0 pytest-qt 3.3.0 python-dateutil 2.8.1 python-jsonrpc-server 0.4.0 python-slugify 5.0.2 pytz 2021.1 pyxdg 0.27 PyYAML 5.4.1 pyzmq 22.0.3 QDarkStyle 3.0.dev0 /Users/rclary/Documents/Python/spyder/external-deps/qdarkstyle qstylizer 0.2.0 QtAwesome 1.0.2 qtconsole 5.1.0 QtPy 1.9.0 regex 2021.4.4 requests 2.25.1 rope 0.19.0 Rtree 0.9.7 scipy 1.6.3 setuptools 56.2.0 six 1.16.0 snowballstemmer 2.1.0 sortedcontainers 2.4.0 Sphinx 4.0.2 sphinxcontrib-applehelp 1.0.2 sphinxcontrib-devhelp 1.0.2 sphinxcontrib-htmlhelp 1.0.3 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.3 sphinxcontrib-serializinghtml 1.1.4 spyder-kernels 2.1.0.dev0 /Users/rclary/Documents/Python/spyder/external-deps/spyder-kernels sympy 1.8 testpath 0.5.0 text-unidecode 1.3 textdistance 4.2.1 three-merge 0.1.1 tinycss2 1.1.0 toml 0.10.2 tornado 6.1 traitlets 5.0.5 ujson 4.0.2 urllib3 1.26.4 watchdog 2.1.2 wcwidth 0.2.5 webencodings 0.5.1 wrapt 1.12.1 wurlitzer 2.1.0 yapf 0.31.0 zipp 3.4.1 ```

As further clarification, regardless of launch environment, the OP issue only results in the error posting to the launch terminal, NOT the internal Python interpreter and does NOT produce an Issue Reporter pop-up window. This means that running a standalone macOS app does NOT make this issue visible to the user. The issue still occurs, however, as it is reported to the Terminal when launching in this manner

$ Spyder.app/Contents/MacOS/Spyder
stonebig commented 3 years ago

could this Watchdog constraint be only limited to MacOS ? so non-MacOS Users would be not impacted ?

mrclary commented 3 years ago

could this Watchdog constraint be only limited to MacOS ? so non-MacOS Users would be not impacted ?

Can anyone test this on Windows or Ubuntu? I've pushed up branch constrain-watchdog if that's helpful. I cannot get the language server to work with bootstrap in my Windows VM.

mrclary commented 3 years ago

Reviewing my first comment in this issue, I now remember that this is no longer an issue on watchdog's side. On Spyder's end we need to ensure that we aren't adding new watch folders that are already watched. See comment