Skip to content

#141 - Enabling Zip64 Extension to support zipfile >- 2GB. #144

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

Merged
merged 1 commit into from
Aug 14, 2017
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
6 changes: 3 additions & 3 deletions tableaudocumentapi/xfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def find_file_in_zip(zip_file):


def get_xml_from_archive(filename):
with zipfile.ZipFile(filename) as zf:
with zipfile.ZipFile(filename, allowZip64=True) as zf:
with zf.open(find_file_in_zip(zf)) as xml_file:
xml_tree = ET.parse(xml_file)

Expand Down Expand Up @@ -107,15 +107,15 @@ def save_into_archive(xml_tree, filename, new_filename=None):

# Extract to temp directory
with temporary_directory() as temp_path:
with zipfile.ZipFile(filename) as zf:
with zipfile.ZipFile(filename, allowZip64=True) as zf:
xml_file = find_file_in_zip(zf)
zf.extractall(temp_path)
# Write the new version of the file to the temp directory
xml_tree.write(os.path.join(
temp_path, xml_file), encoding="utf-8", xml_declaration=True)

# Write the new archive with the contents of the temp folder
with zipfile.ZipFile(new_filename, "w", compression=zipfile.ZIP_DEFLATED) as new_archive:
with zipfile.ZipFile(new_filename, "w", compression=zipfile.ZIP_DEFLATED, allowZip64=True) as new_archive:
build_archive_file(temp_path, new_archive)


Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy