Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

File upload not working with Pyodide 0.19 #116

Closed
phorward opened this issue Feb 23, 2022 · 2 comments
Closed

File upload not working with Pyodide 0.19 #116

phorward opened this issue Feb 23, 2022 · 2 comments
Assignees
Labels
bug Something isn't working Priority: Critical This should be dealt with ASAP. It's blocking someone.

Comments

@phorward
Copy link
Member

There is a proxy required.

Uncaught PythonError: Traceback (most recent call last):
  File "/lib/python3.9/site-packages/flare/network.py", line 103, in onReadyStateChange
    self.callbackSuccess(self.req.responseText)
  File "/lib/python3.9/site-packages/flare/network.py", line 499, in onCompletion
    s(self)
  File "/lib/python3.9/site-packages/vi/widgets/file.py", line 184, in onUploadUrlAvailable
    html5.window.fetch(params["uploadUrl"], **{"method": "POST", "body": req.file, "mode": "no-cors"}).then(
AttributeError: 'Future' object has no attribute 'then'
@akelch akelch self-assigned this Feb 24, 2022
@akelch akelch added bug Something isn't working Priority: Critical This should be dealt with ASAP. It's blocking someone. labels Feb 24, 2022
@phorward phorward self-assigned this Feb 24, 2022
@phorward
Copy link
Member Author

Regarding #86 (which is already implemented this way in current main) the use of fetch or pyfetch is required, but not possible at the moment. I've started a discussion at pyodide on this problem. HTTPRequest from Flare can't be used as it uses XMLHttpRequest which doesn't implement a mode for "no-cors".

@phorward
Copy link
Member Author

Fixed with 5cab860

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working Priority: Critical This should be dealt with ASAP. It's blocking someone.
Projects
None yet
Development

No branches or pull requests

2 participants