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

Python scripts cannot use hooks that may return invalid utf-8 with python 3 #1389

Closed
tribut opened this issue Aug 6, 2019 · 1 comment
Assignees
Labels
bug
Milestone

Comments

@tribut
Copy link
Contributor

@tribut tribut commented Aug 6, 2019

Bug summary

When a hook sends non-utf8 data to python, a UnicodeDecodeError is immediately triggered. There is no way for the script to handle this.

Steps to reproduce

1. Load test.py
2. Send a non-utf8 message from another client
3. Observe error

Current behavior

Any non-utf8 data cannot be processed by a python(3) script.

Expected behavior

Non-utf8 data is passed as bytes.


  • WeeChat version: v2.5-89-g210e86489
  • OS, distribution and version: Ubuntu disco
@sim642

This comment has been minimized.

Copy link
Member

@sim642 sim642 commented Aug 6, 2019

There's a related issue: #1220. While it is regarding a different signal (which got fixed to call with valid UTF-8), it also contains an extensive overview of the situation, including the bytes suggestion.

@flashcode flashcode self-assigned this Oct 11, 2019
@flashcode flashcode added this to the 2.7 milestone Oct 11, 2019
@flashcode flashcode closed this in 513f5a1 Oct 12, 2019
@flashcode flashcode removed the in progress label Oct 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.