Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
Closed
@gitozi

Description

@gitozi
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.