{
  "id": 2850,
  "title": "PKzip-compressed zipfiles cannot be read in Python",
  "url": "/competitions/predict-closed-questions-on-stack-overflow/discussion/2850",
  "author_name": "",
  "post_date": "2012-10-10T00:07:44.597Z",
  "votes": null,
  "comment_count": 1,
  "views": 3274,
  "content": "<p>FYI Ben and Kaggle admins. In future for zipping, can you please use open-source like gzip/gunzip not PKzip?</p>\r\n<p>Zipfiles created with PKzip have compression <em>type 9 : Deflate64/Enhanced Deflate</em> (PKWare's crappy proprietary standard)</p>\r\n<p>It turns out Python <a href=\"http://docs.python.org/library/zipfile.html\">zipfile</a> cannot handle this; and probably a lot of other open-source. But instead of throwing an exception, zipfile silently returns an empty filestream. (I burned a lot of time\r\n figuring that out for myself. SO question <a href=\"http://stackoverflow.com/questions/12809651/opening-zipfile-of-unsupported-compression-type-gives-empty-filestream/12809847#12809847\">\r\nhere</a>)</p>\r\n<p>This is a <a href=\"http://bugs.python.org/issue14313\">known issue</a> in Python 2.7/3.2.</p>\r\n<p>Workaround: unzip, then rezip using a standard tool.</p>",
  "messages": [
    {
      "id": "15372",
      "postDate": "10/10/2012 00:07:44",
      "content": "<p>FYI Ben and Kaggle admins. In future for zipping, can you please use open-source like gzip/gunzip not PKzip?</p>\r\n<p>Zipfiles created with PKzip have compression <em>type 9 : Deflate64/Enhanced Deflate</em> (PKWare's crappy proprietary standard)</p>\r\n<p>It turns out Python <a href=\"http://docs.python.org/library/zipfile.html\">zipfile</a> cannot handle this; and probably a lot of other open-source. But instead of throwing an exception, zipfile silently returns an empty filestream. (I burned a lot of time\r\n figuring that out for myself. SO question <a href=\"http://stackoverflow.com/questions/12809651/opening-zipfile-of-unsupported-compression-type-gives-empty-filestream/12809847#12809847\">\r\nhere</a>)</p>\r\n<p>This is a <a href=\"http://bugs.python.org/issue14313\">known issue</a> in Python 2.7/3.2.</p>\r\n<p>Workaround: unzip, then rezip using a standard tool.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "15373",
      "postDate": "10/10/2012 00:11:48",
      "content": "<p>[quote=Stephen McInerney;15372]</p>\r\n<p>FYI Ben and Kaggle admins. In future for zipping, can you please use open-source like gzip/gunzip not PKzip?</p>\r\n<p>Zipfiles created with PKzip have compression <em>type 9 : Deflate64/Enhanced Deflate</em> (PKWare's crappy proprietary standard)</p>\r\n<p>It turns out Python <a href=\"http://docs.python.org/library/zipfile.html\">zipfile</a> cannot handle this; and probably a lot of other open-source. But instead of throwing an exception, zipfile silently returns an empty filestream. (I burned a lot of time\r\n figuring that out for myself. SO question <a href=\"http://stackoverflow.com/questions/12809651/opening-zipfile-of-unsupported-compression-type-gives-empty-filestream/12809847#12809847\">\r\nhere</a>)</p>\r\n<p>This is a <a href=\"http://bugs.python.org/issue14313\">known issue</a> in Python 2.7/3.2.</p>\r\n<p>Workaround: unzip, then rezip using a standard tool.</p>\r\n<p>[/quote]Thanks for the heads up - we'll try doing this for the future. AFAIK, this is the first time this issue has come up on a Kaggle competition.</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 15373,
      "author_name": "benhamner",
      "author_url": "",
      "post_date": "10/10/2012 00:11:48",
      "content": "<p>[quote=Stephen McInerney;15372]</p>\r\n<p>FYI Ben and Kaggle admins. In future for zipping, can you please use open-source like gzip/gunzip not PKzip?</p>\r\n<p>Zipfiles created with PKzip have compression <em>type 9 : Deflate64/Enhanced Deflate</em> (PKWare's crappy proprietary standard)</p>\r\n<p>It turns out Python <a href=\"http://docs.python.org/library/zipfile.html\">zipfile</a> cannot handle this; and probably a lot of other open-source. But instead of throwing an exception, zipfile silently returns an empty filestream. (I burned a lot of time\r\n figuring that out for myself. SO question <a href=\"http://stackoverflow.com/questions/12809651/opening-zipfile-of-unsupported-compression-type-gives-empty-filestream/12809847#12809847\">\r\nhere</a>)</p>\r\n<p>This is a <a href=\"http://bugs.python.org/issue14313\">known issue</a> in Python 2.7/3.2.</p>\r\n<p>Workaround: unzip, then rezip using a standard tool.</p>\r\n<p>[/quote]Thanks for the heads up - we'll try doing this for the future. AFAIK, this is the first time this issue has come up on a Kaggle competition.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "15372": "",
    "15373": ""
  },
  "source": "meta"
}