Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export in zip format and file attributes #4494

Open
ghost opened this issue Feb 16, 2016 · 3 comments
Open

Export in zip format and file attributes #4494

ghost opened this issue Feb 16, 2016 · 3 comments
Milestone

Comments

@ghost
Copy link

ghost commented Feb 16, 2016

Dear Pootle team
I'm facing an issue with the zip file of project language generated from Pootle 2.7.3b1, that I would like to contrast with you.
It looks like the zip version generated from 2.7.3b1 is 2.0, whereas in Pootle 2.5.x the zip version is 3.0.
Running zipinfo on the downloaded zip file,you see the version on each of its components.

This is zipinfo output from 2.7.3b1

?rw-------  2.0 unx   310672 b- stor 16-Feb-16 14:07 es_ES.po

Which actually should be something like .. the following, coming from a Pootle server 2.5.x

-rw-r--r--  3.0 unx   310408 tx defN 16-Jan-08 15:14 es_ES.po

The file mode bits are wrong in 2.7.3, as well as the file type is wrongly set as binary "b", when it should be "t", as it's a gettext po file . Again, in 2.5.x works fine.
unzip / gzip extracts the contents ok, but not the file mode bits. When using bsdtar-libarchive (3.1.2), the extracted files po files can't be opened, since they are in binary format.

I've been discussing this today at the IRC (thanks dwaynebailey !). Seems like Pootle started using the python native zipfile module. I'll look into the methods on how it's currently creating the file.

In the meantime, if anyone can reproduce this, please let me know.

Bests,
Luis

Can anyone do a zipinfo on the exported project file from 2.7.3b1 (or 2.7.x ) ?

@phlax phlax added this to the 2.8.1 milestone Feb 17, 2016
@ghost
Copy link
Author

ghost commented Feb 17, 2016

I have also included the compress_type = ZIP_DEFLATED to writestr, which reduces the size of the export file significantly. Today there is no compression.

Probably we could replace zip by tar.gz , avoiding all the issues related to the file atributes (mode bits, creation dates ... ) .

@ghost
Copy link
Author

ghost commented Feb 18, 2016

I have created a couple of methods to export and download translation projects in a tar.gz format. I find the tar.gz format more flexible than zip. I'll be happy to share it if you want.

@ghost
Copy link
Author

ghost commented Feb 18, 2016

I'm attaching the changes on views.py and export.py with the functionality to download and export to tar.gz
It's just a draft, to take it from here :)

pootle_export_to_tar.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant