Re: Strange IO Error when extracting zips to a network location



Hari Sekhon wrote:
Hi,
I've written a script to run on windows to extract all zips under a
given directory path to another directory path as such:

python extractzips.py <fetch all zips under this dir> <put all extracted
files under this dir>

The purpose of this script is to retrieve backup files which are
individually zipped under a backup directory tree on a backup server.

This scripts works nicely and has input validation etc, exiting
gracefully and telling you if you gave a non existent start or target
path...

When running the script as follows

python extractzips.py \\backupserver\backupshare\machine\folder d:\unziphere

the script works perfectly, but if I do

python extractzips.py \\backupserver\backupshare\machine\folder
\\anetworkmachine\share\folder

then it unzips a lot of files, recreating the directory tree as it goes
but eventually fails with the traceback:

File "extractzips.py", line 41, in zipextract
outfile.write(zip.read(x))
IOError: [Errno 22] Invalid argument


But I'm sure the code is correct and the argument is passed properly,
otherwise a hundred files before it wouldn't have extracted successfully
using this exact same piece of code (it loops over it). It always fails
on this same file every time. When I extract the same tree to my local
drive it works fine without error.

I have no idea why pushing to a network share causes an IO Error,
shouldn't it be the same as extracting locally from our perspective?

It looks like
http://support.microsoft.com/default.aspx?scid=kb;en-us;899149 is the
answer.

.



Relevant Pages

  • Strange IO Error when extracting zips to a network location
    ... I've written a script to run on windows to extract all zips under a given directory path to another directory path as such: ... python extractzips.py ... The purpose of this script is to retrieve backup files which are individually zipped under a backup directory tree on a backup server. ... When I extract the same tree to my local drive it works fine without error. ...
    (comp.lang.python)
  • Script to extract text from PDF files
    ... I have a very crude Python script that extracts text from some PDF documents. ... I wanted to post here and ask if anyone is interested in helping make the script better which means it should accurately extract text from most any pdf file... ... I know the topic of reading/extracting the text from a PDF document natively in Python comes up every now and then on comp.lang.python... ...
    (comp.lang.python)
  • Re: Strange IO Error when extracting zips to a network location
    ... After extraction I checked the file size of every single file in the directory tree and only 2 files on the network drive are of different size to the ones extracted locally. ... I wonder if I'm hitting a size limit or something with this "zipfile" module, or perhaps a python limitation on buffer or something? ... The purpose of this script is to retrieve backup files which are individually zipped under a backup directory tree on a backup server. ... When I extract the same tree to my local drive it works fine without error. ...
    (comp.lang.python)
  • Re: sort files by exif date
    ... >> and the filenames in a list, sort, then extract the filenames again. ... >> Probably a few lines of shell script. ... That string will be a line of text. ...
    (comp.unix.questions)
  • Re: HTML - Extract Specific Text
    ... etc.) that can be used in any calculation. ... imported text is standardised you can easily extract whatever you want. ... a VBA script. ... and then takes the 11 characters starting with the fourth ...
    (comp.databases.filemaker)