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

OSError when the file system is not available #2468

Closed
williballenthin opened this issue May 3, 2023 · 2 comments · Fixed by #2469
Closed

OSError when the file system is not available #2468

williballenthin opened this issue May 3, 2023 · 2 comments · Fixed by #2469

Comments

@williballenthin
Copy link
Contributor

williballenthin commented May 3, 2023

Textual (specifically App and DOMNode) assumes that the file containing source code for Widget classes is available and raises an OSError when this is not the case. This information is used to render the location of CSS styles.

I'm trying to get a Textual app running in an environment in which getpath doesn't work (Pyodide) because there's no file system in WebAssembly. Obviously, this is a pretty extreme environment, but I think the bug remains reasonable to address.

The calls to getfile are already wrapped in a try/except for TypeError with fallback behavior, so I propose that OSError be handled here, too. I can provide a standalone test case, though it's a little involved, so I'd rather just open a PR shortly, if you'll consider it.

image

@github-actions
Copy link

github-actions bot commented May 3, 2023

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@github-actions
Copy link

github-actions bot commented May 8, 2023

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

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 a pull request may close this issue.

1 participant