python-gitlab icon indicating copy to clipboard operation
python-gitlab copied to clipboard

bad artifacts zip file

Open obelix05 opened this issue 9 years ago • 2 comments

I use the code-example from http://python-gitlab.readthedocs.io/en/latest/gl_objects/builds.html#streaming-example to download artifacts from gitlab. There is no error by doing this and the size of the zip-file is also correct. But it is a bad zipfile. If i open it with 7-zip, there is only one folder, one subfolder and a file with size "0". If I try to open it with the windows Explorer, the error "the compressed (zipped) folder ... is invalid." occured. Is there any idea to solve this problem?

obelix05 avatar Dec 15 '16 16:12 obelix05

the solution is to open the zip-file in binary-mode (yes i am using windows :) ) self._fd = open('artifacts.zip', 'wb')

obelix05 avatar Dec 20 '16 08:12 obelix05

Thank you for your feedback. I'll update the doc.

gpocentek avatar Dec 20 '16 09:12 gpocentek