Strange IO Error when extracting zips to a network location

Serge Orlov Serge.Orlov at gmail.com
Wed May 17 13:40:50 CEST 2006


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.




More information about the Python-list mailing list