spyder-ide / spyder

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

Unable to discard changes and close file in macOS #13987

Open whitehat007 opened 4 years ago

whitehat007 commented 4 years ago

Description

What steps will reproduce the problem?

  1. Create new file
  2. Modify the file (type something)
  3. Click the X in the file's tab
  4. Select "No" when asked if you want to save changes
  5. Become frustrated when nothing happens

Versions

Dependencies


# Mandatory:
applaunchservices >=0.1.7      :  0.2.1 (OK)
atomicwrites >=1.2.0           :  1.4.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.6.0 (OK)
diff_match_patch >=20181111    :  20200713 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.18.1 (OK)
jedi =0.17.1                   :  0.17.1 (OK)
nbconvert >=4.0                :  6.0.6 (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.7.2 (OK)
pygments >=2.0                 :  2.7.1 (OK)
pylint >=1.0                   :  2.6.0 (OK)
pyls >=0.34.0;<1.0.0           :  0.35.1 (OK)
qdarkstyle >=2.8               :  2.8.1 (OK)
qtawesome >=0.5.7              :  0.7.2 (OK)
qtconsole >=4.6.0              :  4.7.7 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.4 (OK)
sphinx >=0.6.6                 :  3.2.1 (OK)
spyder_kernels >=1.9.4;<1.10.0 :  1.9.4 (OK)
watchdog                       :  None (OK)
zmq >=17                       :  19.0.2 (OK)

# Optional:
cython >=0.21                  :  None (OK)
matplotlib >=2.0.0             :  3.3.1 (OK)
numpy >=1.7                    :  1.19.1 (OK)
pandas >=0.13.1                :  1.1.1 (OK)
scipy >=0.17.0                 :  1.5.0 (OK)
sympy >=0.7.3                  :  1.6.2 (OK)
dalthviz commented 4 years ago

Hi @whitehat007 sorry to hear that. When you say that nothing happens, the same file remains open? or a new untitled file appears? Checking I think we always left a file in the Editor so if you don't have a any other file open, closing an untitled<n> file will end up in the automatic creation of a new untitled<n+1> file:

untitled

Is this the behavior you are experiencing? If is something different, maybe you could show us with a GIF what is happening in your case (to get a better understanding of what is going on :) )

whitehat007 commented 4 years ago

I had other files open, so it wasn't automatically creating a new file--it stayed the old untitled0.py* (with the unsaved changes mark) when I clicked "No". Creating another new file (untitled1.py) and following the above steps gave me the same issue. I ended up having to force-quit Spyder to make it shut down. However, when I tried to reproduce the issue just now to make a GIF, I wasn't able to make it happen again. Here's what I do know/remember about the operational state when I experienced the bug:

Does that help at all? If I run across the issue again, I'll be sure to capture it and add it to the bug report.

dalthviz commented 4 years ago

That's quite strange but thanks for the feedback and yes please, if you are able to gather more info post it here :+1:

Thinking a little bit, maybe a way to reproduce this is trying to change working directory to the one that presented the issue (i.e your home dir)?:

image

whitehat007 commented 4 years ago

I was able to (inadvertently) get it to happen again, though under different circumstances--this time I did write and run some code. Here's the GIF:image

ccordoba12 commented 4 years ago

@whitehat007, I think that happens because you're debugging untitled files.

Is there not a message printed in the console about that?

whitehat007 commented 4 years ago

@ccordoba12 Yes, I see that in the console now, but it only showed up after I cleared the console (Command + L) first. Also, I never ran the file in Debug mode--always just in regular run mode (F5).

ccordoba12 commented 4 years ago

Ok, the best we can do to avoid this is to allow closing untitled files that are being debugged. We'll implement that in a future version.