Opened 9 years ago

Closed 9 years ago

#46 closed defect (fixed)

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

Reported by: ssteiner Owned by: schwa
Priority: major Milestone: 2.5
Component: Library Version: 2.4.2b2
Keywords: Cc:

Description (last modified by schwa)

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.

Change History (3)

comment:1 Changed 9 years ago by schwa

  • Description modified (diff)
  • Status changed from new to assigned

Thanks for the report, Steve!

I've checked in changeset [39a3da8880a7] which should fix the issue. Can you please pull and test it?

comment:2 Changed 9 years ago by ssteiner

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).

comment:3 Changed 9 years ago by schwa

  • Resolution set to fixed
  • Status changed from assigned to closed

That's a good idea. I included the directory in changeset [2fdba7fd42ba].

Note: See TracTickets for help on using tickets.