How to tell if python's ZipFile.writestr() failed because file is full?
Question: Without using zip64 extensions, a Zip file cannot be more than 2GB in size, so
trying to write to a file that would put it over that limit won't work. I
expected that when such a writing was attempted, it would raise an exception,
but I've not been able to cause one to be raised. (The documentation is silent
on the matter.) If an exception doesn't get raised in such a circumstance, how
would I (efficiently) go about determining if the write succeeded or not?


Answer: 
    import os
    
    size = os.path.getsize("file") #Get the size of the file.
    size = size/1073741824 #Converting bytes to GB.
    
    if size < 2: # < is probably safer than <=
            #do the zipping
    else:
            print "The file is too large!"
    

This isn't ideal, of course, but it might serve as a temporary solution until
a better one has been found. Again, I don't think this is a very good way of
using zip. But if there is no appropriate exception (which there should), it
might serve as a temporary solution.

