Skip to content

Conversation

@gilfree
Copy link
Contributor

@gilfree gilfree commented Sep 20, 2022

Some programs e.g. pip in versions 21.X emit non strictly output unicode.

This means that running pip install something in pyxtermjs crashes pyxtermjs due to a unicode error, if there is a long progress bar:

To reproduce, inside pyxtermjs do:

python3 -mvenv venv
source venv/bin/activate
pip install -U pip==21.*
pip install torch

pyxtermjs crashes with:

line 41, in read_and_forward_pty_output
    output = os.read(app.config["fd"], max_read_bytes).decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 4094: unexpected end of data

After this change - the above works.

@gilfree gilfree force-pushed the do-not-crash-on-non-unicode branch from e43e50d to 9fa6b76 Compare September 20, 2022 10:22
@cs01
Copy link
Owner

cs01 commented Sep 20, 2022

Thanks!

@cs01 cs01 merged commit 50dce49 into cs01:master Sep 20, 2022
@gilfree
Copy link
Contributor Author

gilfree commented Sep 21, 2022

Thanks for merging.

Will it be possible to release a fixed version to pypi? May I help with that somehow?

@gilfree gilfree deleted the do-not-crash-on-non-unicode branch September 21, 2022 05:17
@cs01
Copy link
Owner

cs01 commented Oct 4, 2022

Sure! I just published to v0.5.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants