Closed GivanTsai closed 2 years ago
When I unzip the matlab.zip file using unix command. It says: Archive: matlab.zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of matlab.zip or matlab.zip.zip, and cannot find matlab.zip.ZIP, period.
Solved
curdir = os.getcwd() os.chdir(dirname) zip_file = zipfile.ZipFile(filename, "r") zip_file.extract("matlab/emnist-byclass.mat")
The filename is exactly
matlab.zip
. And bug occurs: zipfile.BadZipFile: File is not a zip file