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

Returing bytestring from Python to JS returns null #717

Open
Patronics opened this issue Jan 26, 2024 · 0 comments
Open

Returing bytestring from Python to JS returns null #717

Patronics opened this issue Jan 26, 2024 · 0 comments
Labels

Comments

@Patronics
Copy link

Eel version
0.16.0

Describe the bug
returning a bytestring from python to Javascript just gives the value null, though decoding it to a utf-8 string works fine.

To Reproduce
Steps to reproduce the behavior:

@eel.expose
def demo_py():
     return b"hello world"
async function demo_js():
    let str = await eel.demo_py()();
    console.log(str);

Expected behavior
The bytestring is passed to the javascript function, either as a array of numbers, or a string, or some other reasonable implementation

System Information

  • OS: Linux Debian
  • Browser: Chromium 120.0.6099.102-rpt1 arm64
  • Python Distribution: Python 3.11.2

Screenshots
N/A

Additional context
As a workaround, decoding the bytestring to a UTF8 string in python before returning behaves as expected.

@Patronics Patronics added the bug label Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant