I know that this post is 3 years old, but for other users sake that could maybe have the same issue, i will give a possible solution
In your code i don't see that you close your file after the operation, so i think that is where the issue is. As a best practice it is always good to use the with
statement as it gives a context manager and a better error handling.
so your part of code where you retrieve a file should be like this
with open(FILE, 'wb') as fhandle:
ftp.retrbinary('RETR ' + FILE, fhandle.write)
That should fix your problem. And you don't need the os.unlink(FILE)
If you need some background infos about the with
statement, this is the place to visit PEP 343 -- The "with" Statement