Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated BadZipfile with BadZipFile #969

Merged
merged 1 commit into from
Mar 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/vba_extract.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
#
import sys
from zipfile import ZipFile
from zipfile import BadZipfile
from zipfile import BadZipFile

# The VBA project file we want to extract.
vba_filename = "vbaProject.bin"
@@ -51,7 +51,7 @@
print("File may not be an Excel xlsm macro file: '%s'" % xlsm_file)
exit()

except BadZipfile as e:
except BadZipFile as e:
# Usually if the file is an xls file and not an xlsm file.
print("File error: %s: '%s'" % (str(e), xlsm_file))
print("File may not be an Excel xlsm macro file.")
6 changes: 3 additions & 3 deletions xlsxwriter/test/helperfunctions.py
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
import re
import os.path
from zipfile import ZipFile
from zipfile import BadZipfile
from zipfile import BadZipFile
from zipfile import LargeZipFile


@@ -112,7 +112,7 @@ def _compare_xlsx_files(got_file, exp_file, ignore_files, ignore_elements):
except IOError as e:
error = "XlsxWriter file error: " + str(e)
return error, ""
except (BadZipfile, LargeZipFile) as e:
except (BadZipFile, LargeZipFile) as e:
error = "XlsxWriter zipfile error, '" + got_file + "': " + str(e)
return error, ""

@@ -122,7 +122,7 @@ def _compare_xlsx_files(got_file, exp_file, ignore_files, ignore_elements):
except IOError as e:
error = "Excel file error: " + str(e)
return error, ""
except (BadZipfile, LargeZipFile) as e:
except (BadZipFile, LargeZipFile) as e:
error = "Excel zipfile error, '" + exp_file + "': " + str(e)
return error, ""