ioerror

How to close file objects when downloading files over FTP using Twisted?

I've got the following code: for f in fileListProtocol.files: if f['filetype'] == '-': filename = os.path.join(directory['filename'], f['filename']) print 'Downloading %s...' % (filename) newFile = open(filename, 'w+') d = ftpClient.retrieveFile(filename, FileConsumer(newFile)) d.addCallback(c...

Getting IOError when using pre_save signal to store a thumbnail

I have a model that has an option photo field. When a photo is added, I want a thumbnail to be automatically created and stored. However, when I do this with a pre_save signal, I keep getting an IOError, and if I try to do it with a post_save signal I can't save the thumbnails path to my model without creating and infinite post_save loop...

Why do I get inconsistent exceptions on Python?

I encountered a very strange behavior in Python, a behavior that is not consistent. ... except IOError as msg: sys.exit("###ERROR IOError: %s" % (msg)) Usually this would get me a message like: ###ERROR IOError: [Errno 13] Permission denied: 'filename' In same cases the above code is giving me a tuple instead of a proper error ...

IO error: seeking to local header : while reading from a remote server using Archive::Zip,PERL

Hello all, Want to read the contents from a .csv file which is in a remote zip file without downloading & extracting the zip file to local machine. I need this because the file zip file size is too large and downloading it whenever needed takes longer time. I am trying this in perl. My code is : my $ftp = Net::FTP::AutoReconnect->ne...