nickmckay / LiPD-utilities

Input/output and manipulation utilities for LiPD files in Matlab, R and Python
http://nickmckay.github.io/LiPD-utilities/
GNU General Public License v2.0
28 stars 9 forks source link

BadZipFile #13

Closed CommonClimate closed 7 years ago

CommonClimate commented 7 years ago

Here is an issue submitted by my postdoc Michael Erb:

I'm having a problem opening a lipd file in python. I installed lipd in anaconda and downloaded this file: http://wiki.linked.earth/GeoB12610-2.Rippert.2015.

In python 3, I imported lipd and tried to use the lipd.readLipd(path) command, but I'm getting an error:

reading: GeoB12610-2.Rippert.2015.lpd Traceback (most recent call last): File "", line 1, in File "/home/geovault-02/erbm/programs/anaconda2/envs/py35/lib/python3.5/site-packages/lipd/init.py", line 49, in readLipd read_file(usr_path, ".lpd") File "/home/geovault-02/erbm/programs/anaconda2/envs/py35/lib/python3.5/site-packages/lipd/init.py", line 680, in read_file universal_load(usr_path, file_type) File "/home/geovault-02/erbm/programs/anaconda2/envs/py35/lib/python3.5/site-packages/lipd/init.py", line 640, in __universal_load lipd_lib.read_lipd(file_meta) File "/home/geovault-02/erbm/programs/anaconda2/envs/py35/lib/python3.5/site-packages/lipd/pkg_resources/lipds/LiPD_Library.py", line 231, in read_lipd lipd_obj.read() File "/home/geovault-02/erbm/programs/anaconda2/envs/py35/lib/python3.5/site-packages/lipd/pkg_resources/lipds/LiPD.py", line 56, in read unzipper(self.name_ext, self.dir_tmp) File "/home/geovault-02/erbm/programs/anaconda2/envs/py35/lib/python3.5/site-packages/lipd/pkg_resources/helpers/zips.py", line 37, in unzipper with zipfile.ZipFile(name_ext) as f: File "/home/geovault-02/erbm/programs/anaconda2/envs/py35/lib/python3.5/zipfile.py", line 1026, in init__ self._RealGetContents() File "/home/geovault-02/erbm/programs/anaconda2/envs/py35/lib/python3.5/zipfile.py", line 1093, in _RealGetContents raise BadZipFile("File is not a zip file") zipfile.BadZipFile: File is not a zip file

Any ideas? I tried a different lipd file and got the same result.

khider commented 7 years ago

Did Michael take the file from the wiki?

CommonClimate commented 7 years ago

Yes, as the link implies.

Julien Emile-Geay, associate professor University of Southern California http://https://scholar.google.com/citations?user=OVti4jEAAAAJ&hl=enclimdyn.usc.eduhttp://climdyn.usc.edu

On Jun 15, 2017, at 07:41, Deborah Khider notifications@github.com<mailto:notifications@github.com> wrote:

Did Michael take the file from the wiki?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_nickmckay_LiPD-2Dutilities_issues_13-23issuecomment-2D308754318&d=DwMCaQ&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=sm7R-KWGS-qL7K-XLvSPqQ&m=nE9iH4--i0wxzPZjZYwgKZ-BOBlDABS4mc6qn6l15pE&s=lnZc1iIG9Ey--RoL-A2w-xdMMTIJTNDmigGPgcMDI0Y&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ANH23wkyIwCh4heVBaqQWYQo3Jmb88-2D3ks5sEUKUgaJpZM4N6lh9&d=DwMCaQ&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=sm7R-KWGS-qL7K-XLvSPqQ&m=nE9iH4--i0wxzPZjZYwgKZ-BOBlDABS4mc6qn6l15pE&s=cUt5kn_H6TuhDFcxb-jfmXPbja8RL1wnT9_hoUY2KQU&e=.

khider commented 7 years ago

Then it's not a LiPD utilities issue. it's a wiki issue. Nick had that error a couple of times, it seems to be random. But the error needs to be reported to Varun not here.

chrismheiser commented 7 years ago

Yep. Wiki issue. That file doesn't even decompress after downloading.

CommonClimate commented 7 years ago

Ok. I'm surprised the problem hasn't been reported to Varun already, given that it was known. I'll email him.

Julien Emile-Geay, associate professor University of Southern California http://https://scholar.google.com/citations?user=OVti4jEAAAAJ&hl=enclimdyn.usc.eduhttp://climdyn.usc.edu

On Jun 15, 2017, at 08:20, Deborah Khider notifications@github.com<mailto:notifications@github.com> wrote:

Then it's not a LiPD utilities issue. it's a wiki issue. Nick had that error a couple of times, it seems to be random. But the error needs to be reported to Varun not here.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_nickmckay_LiPD-2Dutilities_issues_13-23issuecomment-2D308771082&d=DwMCaQ&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=sm7R-KWGS-qL7K-XLvSPqQ&m=2083W2oDf1lYDpMk6IbT7GWha28F4vAMtps-ohmsMdE&s=fMBmA-MsIdwWng9rEIjVJgxdDoiehtnI_hkzUpWfLts&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ANH23x9u7ew6UL7ouziZLxYBkMYqWqrvks5sEUvQgaJpZM4N6lh9&d=DwMCaQ&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=sm7R-KWGS-qL7K-XLvSPqQ&m=2083W2oDf1lYDpMk6IbT7GWha28F4vAMtps-ohmsMdE&s=xP001w92An22YvIawrwWwotaPPxvLnyTOhtm8C_WdYI&e=.

khider commented 7 years ago

I did. But I don't know when he's back from vacation.

CommonClimate commented 7 years ago

Ok, if he's aware of the problem, that's what matters. I hope it can get fixed before OC3.

Julien Emile-Geay, associate professor University of Southern California http://https://scholar.google.com/citations?user=OVti4jEAAAAJ&hl=enclimdyn.usc.eduhttp://climdyn.usc.edu

On Jun 15, 2017, at 09:34, Deborah Khider notifications@github.com<mailto:notifications@github.com> wrote:

I did. But I don't know when he's back from vacation.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_nickmckay_LiPD-2Dutilities_issues_13-23issuecomment-2D308796393&d=DwMCaQ&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=sm7R-KWGS-qL7K-XLvSPqQ&m=RMJR-8gEy7HIJ3zgKrtiR0_hW6or7J0T-Vzb3PjYcoM&s=XQU5UdJpwEzhq8aa5jYcTFw8tBOA2CzvGDNY6fZNxOY&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ANH23wn8E9j30aW2HijHUTpgjBzFOVU9ks5sEVz9gaJpZM4N6lh9&d=DwMCaQ&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=sm7R-KWGS-qL7K-XLvSPqQ&m=RMJR-8gEy7HIJ3zgKrtiR0_hW6or7J0T-Vzb3PjYcoM&s=fUN0kzduXW_DSiwUiUXxKrTf2P-Yx7DMOLMiPquGrN0&e=.

michaelerb commented 7 years ago

Thanks for the replies. I originally tried two files (http://wiki.linked.earth/GeoB12610-2.Rippert.2015 and http://wiki.linked.earth/NAm-MtLemon.Briffa.2002), and both of them gave me the error Julien posted above. However, I just tried a third file (http://wiki.linked.earth/Eur-EasternCarpathianMountains.Popa.2008) and it works fine. Deborah explained to me that the error might result from editing metadata on the wiki.