mirror of https://github.com/aristocratos/bpytop
Added: Ignore input unicode decode errors
parent
cc9c7dcc29
commit
b9b47126c8
|
@ -17,7 +17,7 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import os, sys, threading, signal, re, subprocess, logging, logging.handlers, argparse
|
import os, sys, io, threading, signal, re, subprocess, logging, logging.handlers, argparse
|
||||||
import urllib.request
|
import urllib.request
|
||||||
from time import time, sleep, strftime, localtime
|
from time import time, sleep, strftime, localtime
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
@ -5339,6 +5339,8 @@ def main():
|
||||||
if CONFIG.show_init:
|
if CONFIG.show_init:
|
||||||
Draw.buffer("+init!", f'{Mv.restore}{Fx.trans("Starting input reader thread... ")}{Mv.save}')
|
Draw.buffer("+init!", f'{Mv.restore}{Fx.trans("Starting input reader thread... ")}{Mv.save}')
|
||||||
try:
|
try:
|
||||||
|
if isinstance(sys.stdin, io.TextIOWrapper) and sys.version_info >= (3, 7):
|
||||||
|
sys.stdin.reconfigure(errors="ignore") # type: ignore
|
||||||
Key.start()
|
Key.start()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Init.fail(e)
|
Init.fail(e)
|
||||||
|
|
Loading…
Reference in New Issue