Strange IO Error when extracting zips to a network location

H

Hari Sekhon

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 pulls fine, why doesn't it push fine?


Thanks for any help or suggestions anybody can give me.

Hari
 
S

Serge Orlov

Hari said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top