[issue3394] zipfile.writestr doesn't set external attributes, so files are extracted mode 000 on Unix

2008-07-25 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Committed in r65235. Thanks! -- resolution: -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue3394] zipfile.writestr doesn't set external attributes, so files are extracted mode 000 on Unix

2008-07-25 Thread Mark Summerfield
Changes by Mark Summerfield <[EMAIL PROTECTED]>: -- nosy: +mark ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailing

[issue3394] zipfile.writestr doesn't set external attributes, so files are extracted mode 000 on Unix

2008-07-25 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Agree with using 0600 as default permissions. -- nosy: +pitrou priority: -> high ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue3394] zipfile.writestr doesn't set external attributes, so files are extracted mode 000 on Unix

2008-07-24 Thread Dylan Grose
Changes by Dylan Grose <[EMAIL PROTECTED]>: -- nosy: +dkbg ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailing list

[issue3394] zipfile.writestr doesn't set external attributes, so files are extracted mode 000 on Unix

2008-07-17 Thread Christopher Brannon
Christopher Brannon <[EMAIL PROTECTED]> added the comment: Here is a patch containing code and a unit test. I set external_attr to 0600, for the following reason. When I extract with Infozip, my umask is ignored when setting permissions of extracted entries. They have the permissions assigned t

[issue3394] zipfile.writestr doesn't set external attributes, so files are extracted mode 000 on Unix

2008-07-17 Thread Stephen Warren
Stephen Warren <[EMAIL PROTECTED]> added the comment: I'd probably argue for at least 0660<<16, if not 0666<<16, since group permissions are pretty typically set, but even 0666<<16 would be OK, since the umask on extraction would take away any permissions the extracting user didn't want. But, as

[issue3394] zipfile.writestr doesn't set external attributes, so files are extracted mode 000 on Unix

2008-07-17 Thread Christopher Brannon
Christopher Brannon <[EMAIL PROTECTED]> added the comment: What value should the new archive entry's external_attr attribute have? ZipFile.write sets it to the permissions of the file being archived, but writestr is archiving a string, not a file. Setting it to 0600 << 16 seems reasonable. Step

[issue3394] zipfile.writestr doesn't set external attributes, so files are extracted mode 000 on Unix

2008-07-17 Thread Stephen Warren
Stephen Warren <[EMAIL PROTECTED]> added the comment: Oops. Forgot to set "type" field. -- type: -> behavior ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue3394] zipfile.writestr doesn't set external attributes, so files are extracted mode 000 on Unix

2008-07-17 Thread Stephen Warren
New submission from Stephen Warren <[EMAIL PROTECTED]>: Run the following Python script, on Unix/Linux: == import zipfile z = zipfile.ZipFile('zipbad.zip', 'w') z.writestr('filebad.txt', 'Some content') z.close() z = zipfile.ZipFile('zipgood.zip', 'w') zi = zipfile.ZipInfo('filegood.tx