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

Old .spyder.ini is not copied to spyder.ini #1519

Closed
spyder-bot opened this issue Feb 17, 2015 · 6 comments
Closed

Old .spyder.ini is not copied to spyder.ini #1519

spyder-bot opened this issue Feb 17, 2015 · 6 comments

Comments

@spyder-bot
Copy link
Collaborator

From adrian.k...@gmail.com on 2013-08-16T13:05:26Z

Spyder Version: 2.3.0dev5
Python Version: 2.7.3
Qt Version: 4.8.1, PyQt4 (API v2) 4.9.1 on Linux

What steps will reproduce the problem?

  1. Upgrade to Spyder 2.3
    1. Open Spyder 3. What is the expected output? What do you see instead? I expect to see the same layout as in my previous version.

I get a default layout.

Please provide any additional information below

. In 2.2 the ini file was named .spyder.ini, in 2.3 it is named spyder.ini and is a new file. The old file is removed. I would expect it to pick up the old file and just rename it. This is what I did by going to a backup.

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1519

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2013-08-16T11:32:40Z

After re-reading the code I wrote in revision 1ebbd64eb4b8 (in file spyderlib/userconfig.py), the old file should have been renamed to the new filename (without leading dot).

This needs further testing.

Status: Accepted
Owner: pierre.raybaut
Labels: -Priority-Medium Priority-High MS-v2.3

@spyder-bot
Copy link
Collaborator Author

From adrian.k...@gmail.com on 2013-08-16T12:28:36Z

See comments in line, assuming I follow the code correctly:

def filename(self):
"""
Create a .ini filename located in user home directory
"""
folder = get_home_dir()
w_dot = osp.join(folder, '.%s.ini' % self.name) #This creates a file reference in home directory
if self.subfolder is None:
return w_dot
else: # Found .spyder2 subdirectory.
folder = osp.join(folder, self.subfolder)
try:
os.makedirs(folder)
except os.error:
# Folder (or one of its parents) already exists
pass
old, new = w_dot, osp.join(folder, '%s.ini' % self.name)
if osp.isfile(old): # Looking for file in ~ not ~/.spyder2/
try:
if osp.isfile(new):
os.remove(old)
else:
os.rename(old, new)#This does not run because it does find old file in ~/.spyder2
except OSError:
pass
return new # New file is returned because old file is never found.

@spyder-bot
Copy link
Collaborator Author

From adrian.k...@gmail.com on 2013-08-16T17:01:54Z

I got to thinking, what happens with the return value from filename()? In particular the return new part. From the code new is just a file name not the file. So even if the rename took place, does code further downstream just overwrite the renamed file with a new default ini?

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-10-16T08:07:59Z

Is this still a problem for you Adrian? I think it was solved already.

@spyder-bot
Copy link
Collaborator Author

From adrian.k...@gmail.com on 2013-10-17T07:27:38Z

Well I just updated to Spyder 2.3.0beta1 and got:

-rw-r--r-- 1 aklaver users 33835 Oct 17 07:23 spyder.ini
-rw-r--r-- 1 aklaver users 33834 Oct 17 07:22 spyder.ini.bak

Opening Spyder showed everything as I left it, so I would call it fixed.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-10-17T11:24:05Z

Great! Thanks for the confirmation.

Summary: Old .spyder.ini is not copied to spyder.ini (was: spyder.ini vs .spyder.ini)
Status: Verified
Labels: Cat-Miscelleneous

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

1 participant