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

allow loading content through byte streams. #299

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

Conversation

daoyeppl
Copy link

No description provided.

@@ -1699,7 +1699,7 @@ def _load_opf_file(self):
)

def _load(self):
if os.path.isdir(self.file_name):
if isinstance(self.file_name, str) and os.path.isdir(self.file_name):
Copy link

@dnesting dnesting Feb 18, 2024

Choose a reason for hiding this comment

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

I'm just a bystander, and I'm not sure what kind of Python version compatibility this is striving for, but in more recent versions of Python, this might be more accurate:

if isinstance(self.file_name, (str, bytes, os.PathLike))

Either way this patch is what I came here to find, so thank you.

@c1924959470
Copy link

c1924959470 commented Feb 18, 2024 via email

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.

None yet

3 participants