Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File save as: file is unavailable #3026

Closed
dacoex opened this issue Mar 3, 2016 · 14 comments
Closed

File save as: file is unavailable #3026

dacoex opened this issue Mar 3, 2016 · 14 comments

Comments

@dacoex
Copy link

dacoex commented Mar 3, 2016

Description of your problem

What steps will reproduce the problem?

  1. Open file in Editor
  2. File Menu -> Save as
  3. The dialogue betlow appears.
  4. If I click on Yes, the file is never saved
  5. If click on NO, the file is kept in Editor

spyder_file_unavailable

Why does this come up?

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

Expected / desired:

  • The file with the new name ("save as") shall be kept in editor.
  • A dialogue may ask if the old file can be closed. The file must not be deleted from the disk.

Please provide any additional information below

Versions and main components

  • Spyder Version: 3.0.0
  • Python Version: 3.5
  • Operating system: Windows 7

Dependencies

Please go to the menu entry Help > Optional Dependencies (or
Help > Dependencies), press the button Copy to clipboard
and paste the contents below:

IPython >=3.0      :  4.0.1 (OK)
jedi >=0.8.1;<0.9.0:  0.8.1 (OK)
matplotlib >=1.0   :  1.5.0 (OK)
numpy >=1.7        :  1.9.3 (OK)
pandas >=0.13.1    :  0.17.1 (OK)
pep8 >=0.6         :  1.6.2 (OK)
pyflakes >=0.6.0   :  0.9.2 (OK)
pygments >=1.6     :  2.0.2 (OK)
pylint >=0.25      :  1.5.1 (OK)
qtconsole >=4.0    :  4.1.1 (OK)
rope >=0.9.4       :  0.9.4-1 (OK)
sphinx >=0.6.6     :  1.3.3 (OK)
sympy >=0.7.3      :  0.7.6.1 (OK)
zmq >=13.0.0       :  15.1.0 (OK)
@ccordoba12
Copy link
Member

@stonebig, can you reproduce this problem?

@ccordoba12 ccordoba12 modified the milestones: v3.0beta3, v3.0beta4 Mar 3, 2016
@stonebig
Copy link
Contributor

stonebig commented Mar 3, 2016

curious, I would imagine the file is open on internet, on a zip directory or in a read-only directory ?

@dacoex
Copy link
Author

dacoex commented Mar 4, 2016

on the local drive.

@stonebig
Copy link
Contributor

stonebig commented Mar 4, 2016

Is it a file in a normal directory or in a zipped directory ? which exact version of Spyder 3.0.0 ?

@dacoex
Copy link
Author

dacoex commented Mar 4, 2016

Is it a file in a normal directory or in a zipped directory ?

normal, nothing compressed. Windows 7.

which exact version of Spyder 3.0.0 ?

It does only show 3.0.0dev under the help / info.
(maybe this dialogue could in future show the last git commit tag)

I updated from github middle of the week.

More info on Monday. Please ask what I could provide.

@stonebig
Copy link
Contributor

stonebig commented Mar 6, 2016

will recheck with spyder-master of the moment. hold on 10 minutes

@stonebig
Copy link
Contributor

stonebig commented Mar 6, 2016

would be nice for inquiries if when building spyder wheel of today, it would generate a spyder-3.0.0.b2-py3-none-any.whl rather than a spyder-3.0.0.dev0-py3-none-any.whl

@stonebig
Copy link
Contributor

stonebig commented Mar 6, 2016

argh, spyder starting method has changed.

@stonebig
Copy link
Contributor

stonebig commented Mar 6, 2016

I do not notice this 3026 problem with master of today (just before Carlos committed the pygment lexer).

But checking that, I notice all my previous WinPython "spyder" icon will fail, as they were launching

python.exe -m spyderlib.start_app %*

Keeping a working spyderlib.start_app until spyder 3.1 would be kind.

Next Winpython will of course point to 'spyder.exe' executable

@ccordoba12 ccordoba12 modified the milestones: v3.0beta4, v3.0rc1 Apr 25, 2016
@ccordoba12 ccordoba12 modified the milestones: v3.1, v3.0rc1 Jun 9, 2016
@TWAC
Copy link

TWAC commented Jun 14, 2016

I see this on master (5f7f375).
It only happens when multiple files are open.
Save as on the first tab works.
Save as on second or later tabs gives error message.

@ccordoba12
Copy link
Member

Could you post the error please?

@TWAC
Copy link

TWAC commented Jun 14, 2016

Sorry, I did not mean error message, just the dialog box from first comment "Do you want to close...".

Further investigation:

  • Only seems to happen on pyqt5, not pyqt4.
  • Blocking tab signals here seems to help. But the code seems a bit convoluted, so there might exist a better fix.
--- a/spyderlib/widgets/editor.py
+++ b/spyderlib/widgets/editor.py
@@ -974,7 +974,9 @@ class EditorStack(QWidget):
         new_index = self.data.index(finfo)
         self.__repopulate_stack()
         if set_new_index:
+            self.tabs.blockSignals(True)
             self.set_stack_index(new_index)
+            self.tabs.blockSignals(False)
         else:
             # Fixes Issue 1287
             self.set_current_filename(current_fname)

@thierryBottaro
Copy link

I just wanted to said that I reproduced this bug with a fresh installation of the last WinPython-64bit-3.5.2.1Qt5.exe

here is my dependency copy-pasted :
jedi >=0.8.1 : 0.9.0 (OK)
matplotlib >=1.0 : 1.5.2 (OK)
nbconvert >=4.0 : 4.2.0 (OK)
numpy >=1.7 : 1.11.1 (OK)
pandas >=0.13.1 : 0.18.1 (OK)
pep8 >=0.6 : 1.7.0 (OK)
pyflakes >=0.6.0 : 1.2.3 (OK)
pygments >=2.0 : 2.1.3 (OK)
pylint >=0.25 : 1.6.1 (OK)
qtconsole >=4.2.0: 4.2.1 (OK)
rope >=0.9.4 : 0.9.4-1 (OK)
sphinx >=0.6.6 : 1.4.5 (OK)
sympy >=0.7.3 : 1.0 (OK)

@joshburnett
Copy link

joshburnett commented Oct 31, 2016

Yep, still happens with:

Version and main components

  • Spyder Version: 3.0.1
  • Python Version: 2.7.11
  • Qt Versions: 5.6.0, PyQt5 5.6 on Windows

Dependencies

pyflakes >=0.5.0 :  1.3.0 (OK)
pep8 >=0.6       :  1.7.0 (OK)
pygments >=2.0   :  2.1.3 (OK)
qtconsole >=4.2.0:  4.2.1 (OK)
nbconvert >=4.0  :  4.2.0 (OK)
pandas >=0.13.1  :  0.18.1 (OK)
numpy >=1.7      :  1.10.4 (OK)
sphinx >=0.6.6   :  1.5a1 (OK)
rope >=0.9.4     :  0.10.3 (OK)
jedi >=0.8.1     :  0.9.0 (OK)
matplotlib >=1.0 :  1.5.1 (OK)
sympy >=0.7.3    :  1.0 (OK)
pylint >=0.25    :  1.6.4 (OK)

When I get the dialog shown above in the initial post, if I answer 'no' then it does the 'Save As' operation correctly and leaves the file open, with it properly renamed. If I answer 'yes,' then it closes the tab and the file with the new name never gets created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants