okfn-brasil/serenata-toolbox

Error updating reimbursement files

cuducos opened this issue · 1 comments

@rodolfo-viana has asked:

I tried to update reimbursement files last Sunday, but found a weird error when fetching.

In [1]: from serenata_toolbox.chamber_of_deputies.chamber_of_deputies_dataset import ChamberOfDeputiesDataset

In [2]: chamber_of_deputies = ChamberOfDeputiesDataset('data/')

In [3]: chamber_of_deputies.fetch()
---------------------------------------------------------------------------
BadZipFile Traceback (most recent call last)
<ipython-input-3-032b8190ff36> in <module>()
----> 1 chamber_of_deputies.fetch()

c:\users\rodolfoviana\documents\serenata-de-amor\serenata-toolbox\serenata_toolbox\chamber_of_deputies\chamber_of_deputies_dataset.py in fetch(self)
21 zip_file_path = os.path.join(self.path, filename)
22 urlretrieve(url, zip_file_path)
---> 23 zip_file = ZipFile(zip_file_path, 'r')
24 zip_file.extractall(self.path)
25 zip_file.close()

c:\users\rodolfoviana\appdata\local\conda\conda\envs\serenata_de_amor\lib\zipfile.py in __init__(self, file, mode, compression, allowZip64)
1098 try:
1099 if mode == 'r':
-> 1100 self._RealGetContents()
1101 elif mode in ('w', 'x'):
1102 # set the modified flag so central directory gets written

c:\users\rodolfoviana\appdata\local\conda\conda\envs\serenata_de_amor\lib\zipfile.py in _RealGetContents(self)
1166 raise BadZipFile("File is not a zip file")
1167 if not endrec:
-> 1168 raise BadZipFile("File is not a zip file")
1169 if self.debug > 1:
1170 print(endrec)

BadZipFile: File is not a zip file

Do you guys know how to solve this?


@jtemporal has replied:

Hi @rodolfo-viana which version of the toolbox are you using?