synchronize_times() throws ftputil.ftp_error.PermanentError on failed file creation

The docs say it throws a TimeShiftError but, if the login dir is not writable, the finally clause on line 453 actually throws a different error trying to unlink the file.

The unlink should be wrapped in its own try...except and raise the correct error if the unlink raises an exception trying to delete the file it couldn't create in the first place.

ssteiner (unverified)
Assigned to
14 years ago
14 years ago
bug library

schwa (unverified) 14 years ago · edit

Thanks for the report, Steve!

I've checked in changeset [a3e846dd0ecf36db2896e3b32187ca5e370d06a9](https://git.sr.ht/~sschwarzer/ftputil/commit/a3e846dd0ecf36db2896e3b32187ca5e370d06a9 "Added test and fix for ticket #46 (thanks go to Steve Steiner).") which should fix the issue. Can you please pull and test it?

ssteiner (unverified) 14 years ago · edit

See my changes on BitBucket?, maybe a combined approach. I was more explicit about where, exactly, it failed though you may know more about other places that raise the TimeShiftError?; I just assumed it was all local to this function (which it probably should be).

schwa (unverified) 14 years ago · edit

That's a good idea. I included the directory in changeset c6c361329c8feaebd0e62eba4aff47d39203c3d0.

Register here or Log in to comment, or comment via email.