Better subprocess listening experience#120
Merged
davidlatwe merged 2 commits intomottosso:masterfrom Nov 4, 2020
Merged
Conversation
bleeding-rez and nerdvegas/rez has a bit different shell spawning setup. This commit tries to makes people in both world have the same subprocess experience when using Allzpark. In addition, since Allzpark has the duty to listen to subprocess and displaying logs continually, this commit adds an error handler in case UnicodeDecodeError happens.
Owner
|
Great detective work @davidlatwe. Feel free to merge this and #119 once it works for you. |
Collaborator
Author
|
Merging this tomorrow :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Allzpark freeze when closing the application that it just launched, if Allzpark is using
nerdvegas/rezinstead ofbleeding-rez.The freeze was because
nerdvegas/rezdoesn't setuniversal_newlines=Truewhen spawning shell by default, butbleeding-rezdoes.So this PR will close #104 and close #119
(Sorry, should have notice that difference earlier)
Additional Improvement
Make subprocess encoding configurable.
nerdvegas/rezenforcedencoding="utf-8"ifuniversal_newlines=Trueandencodingis not in kwarg. In some cases you may want to set the encoding you preferred ?Add UnicodeDecodeError handler (Python>=3.6 only)
Since Allzpark has the duty to listen to subprocess and displaying logs continually, adding a custom error handler that will firstly try to decode bytes with
locale.getpreferredencoding, if still failing, usebackslashreplaceas final option.