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

rename open_text to open, and open to _open #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

midichef
Copy link

Restore synch with the VisiData v3.1.1 parallel version of unzip_http.py.

Restore synch with the VisiData v3.1.1 parallel version of unzip_http.py.
@anjakefala
Copy link
Collaborator

anjakefala commented Dec 27, 2024

The renaming of these functions was necessary for archive.py: zip_open = fp._open

@@ -260,8 +260,8 @@ def open(self, fn):
else:
error(f'unknown compression method {method}')

def open_text(self, fn):
return io.TextIOWrapper(self.open(fn))
def open(self, fn):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ZipFile.open() API should return a binary stream. So let's keep this as it was and fix VisiData instead.

@saulpw
Copy link
Owner

saulpw commented Jan 13, 2025

The renaming of these functions was necessary for archive.py: zip_open = fp._open

This is probably vestigial. The interface for RemoteZipFile should be as close to ZipFile as possible. So we should be able to combine these into one check (unfortunately I don't believe RemoteZipFile can inherit from ZipFile though) and always use fp.open.

@anjakefala
Copy link
Collaborator

@saulpw It's likely not vestigial, but I'll need a bit of time to dig up the old issues and PRs where we discussed why this change was necessary!

@anjakefala
Copy link
Collaborator

This is the collection of all the issues that related to this: saulpw/visidata#2110

@anjakefala
Copy link
Collaborator

Basically, loading + extracting zip files needed to work locally and remotely: saulpw/visidata@0e1afd8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants