8000 example code in user documentation for pyscript WebSocket fails with pyodide · Issue #2146 · pyscript/pyscript · GitHub
[go: up one dir, main page]

Skip to content

example code in user documentation for pyscript WebSocket fails with pyodide #2146

New issue

Have a question about this project? Sign up for a 8000 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

Closed
3 tasks done
gitozi opened this issue Aug 14, 2024 · 1 comment · Fixed by #2148
Closed
3 tasks done

example code in user documentation for pyscript WebSocket fails with pyodide #2146

gitozi opened this issue Aug 14, 2024 · 1 comment · Fixed by #2148
Labels
needs-triage Issue needs triage type: bug Something isn't working

Comments

@gitozi
Copy link
gitozi commented Aug 14, 2024

Checklist

  • I added a descriptive title
  • I searched for other issues and couldn't find a solution or duplication
  • I already searched in Google and didn't find any good information or help

What happened?

The example code for WebSocket given in the pyscript user documentation works without problems under micropython but gives an error with pyodide.

What browsers are you seeing the problem on? (if applicable)

Chrome

Console info

Traceback (most recent call last):
  File "/lib/python312.zip/_pyodide/_base.py", line 596, in eval_code_async
    await CodeRunner(
  File "/lib/python312.zip/_pyodide/_base.py", line 410, in run_async
    coroutine = eval(self.code, globals, locals)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<exec>", line 17, in <module>
  File "/home/pyodide/pyscript/websocket.py", line 50, in __setattr__
    self._ws[attr] = value
    ~~~~~~~~^^^^^^
TypeError: 'pyodide.ffi.JsProxy' object does not support item assignment

Additional Context

Using pyscript 2024.8.2

@gitozi gitozi added needs-triage Issue needs triage type: bug Something isn't working labels Aug 14, 2024
@WebReflection
Copy link
Contributor

@gitozi you can try https://cdn.jsdelivr.net/npm/@pyscript/core@0.5.6/dist/core.js and see it working now.

WebReflection added a commit that referenced this issue Aug 27, 2024
* Fix #2146 - Workaround Pyodide issue with attributes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix #2146 - Updated polyscript

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Issue needs triage type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0