[Tutor] Zip - password protect

James Reynolds eire1130 at gmail.com
Tue Aug 23 21:31:25 CEST 2011


On Tue, Aug 23, 2011 at 2:57 PM, Alan Gauld <alan.gauld at btinternet.com>wrote:

> On 23/08/11 19:23, James Reynolds wrote:
>
>> I tried that already.
>>
>> that's only to set the default password to read the zip, not to set a
>> pasword (wording is misleading I think)
>>
>>
> I'm confused.
>
> Which password are you thinking of?
>
> Is it at the OS level to prevent access to the file
>  - in which case the fact that its a zipfile is immaterial.
> Or is it the zipfile's own password? In which case what
> is different from the "default password to read the file"?
>
>
> What exactly are you trying to achieve?
>
>
> --
> Alan G
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
>
>
> ______________________________**_________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/**mailman/listinfo/tutor<http://mail.python.org/mailman/listinfo/tutor>
>

(from earlier)



I need to password protect a zip file I am creating from within python.

I would rather not have a user open the zip and set the password manually.

I'm trying the 7-zip solution, but I can't get past this
error: WindowsError: [Error 2] The system cannot find the file specified

The line it fails at is here: z = subprocess.call(['7z', 'a', '1234', '-y',
name + '.zip'] + self.file_locs)

(from now)

oddly enough, when I open up a python shell, i can run the above just fine
and it creates a .zip file.

But when I run it from eclipse, the exact thing, I get the error.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110823/ad098d2e/attachment-0001.html>


More information about the Tutor mailing list