When supplying the Loader class with a directory on Windows 7, the renaming of deltat.preds fails:
File "C:\Users\icg173\Anaconda2\envs\python3\lib\site-packages\skyfield\iokit.py", line 159, in call
os.rename(self.path_to(filename), self.path_to(backup_name))
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\Users\icg173\.config\mss\deltat.preds' -> 'C:\Users\icg173\.config\mss\deltat.old1.preds'
The problem seems to be a missing "self.path_to" here:
skyfield/iokit.py, line 156ff
[...]
if not os.path.exists(backup_name):
break
self._log(' Renaming to: {0}', backup_name)
os.rename(self.path_to(filename), self.path_to(backup_name))
[...]
should be changed to:
[...]
if not os.path.exists(self.path_to(backup_name)):
[...]
I also end up with many backups after fixing it, but that seems to be related to issue #170
When supplying the Loader class with a directory on Windows 7, the renaming of deltat.preds fails:
File "C:\Users\icg173\Anaconda2\envs\python3\lib\site-packages\skyfield\iokit.py", line 159, in call os.rename(self.path_to(filename), self.path_to(backup_name)) FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\Users\icg173\.config\mss\deltat.preds' -> 'C:\Users\icg173\.config\mss\deltat.old1.preds'
The problem seems to be a missing "self.path_to" here: skyfield/iokit.py, line 156ff [...] if not os.path.exists(backup_name): break self._log(' Renaming to: {0}', backup_name) os.rename(self.path_to(filename), self.path_to(backup_name)) [...] should be changed to: [...] if not os.path.exists(self.path_to(backup_name)): [...]
I also end up with many backups after fixing it, but that seems to be related to issue #170