-
Notifications
You must be signed in to change notification settings - Fork 514
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
When fetching code from a server, Brython can't handle namespace package #2426
Comments
I have read PEP 420 and I'm afraid that it can't be supported by Brython. In CPython, if a script is in a directory, and this directory has a subdirectory "subdir" (even empty), PEP 420 allows In Brython it is impossible to detect if a url corresponds to a directory. An Ajax request to the url (eg host/script_dir/subdir) might return the directory listing, or the content of a file Unless there is a solution that I don't see at the moment, we will have to add this feature to the list of differences between standard Python and Brython. |
I thought it might be tricky or impossible. So this bug should be delth through documentation I guess. |
Now that I think about it, another fix to the problem may be to provide an additional option to |
As of Python 3.3 package no longer require
__init__.py
. A namespace package will be created.When you fetch code from the server with Brython using import, namespace package will not be detected.
Steps to reproduce:
Now try to run in Brython, adding an HTML with
if you convert the package to a regular package by adding an empty
__init__.py
:In this case Brython will work.
The text was updated successfully, but these errors were encountered: