You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you try python3?
From: AndresQ <notifications@github.com>
Reply-To: facebook/PathPicker <reply@reply.github.com>
Date: Wednesday, January 22, 2020 at 7:43 AM
To: facebook/PathPicker <PathPicker@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: [facebook/PathPicker] UnicodeDecodeError parsing results (#312)
I get the following error when piping to fpp, apparently some files are binary and it's breaking
Traceback (most recent call last):
File "/home/tulsi/PathPicker/src/processInput.py", line 84, in <module>
doProgram(flags)
File "/home/tulsi/PathPicker/src/processInput.py", line 53, in doProgram
lineObjs = getLineObjs(flags)
File "/home/tulsi/PathPicker/src/processInput.py", line 20, in getLineObjs
inputLines = sys.stdin.readlines()
File "/usr/lib/python3.7/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc1 in position 1191: invalid start byte
python version: 2.7.17
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#312>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAIVDH4ZOTS722FB42HF77LQ7BLPNANCNFSM4KKG6GMA>.
Ah ok that's a helpful piece of context. Do you mind adding the most minimal stdout that repros the issue? I presume its some kind of binary output that's piped straight into fpp?
Activity
pcottle commentedon Jan 24, 2020
tulsidas commentedon Jan 24, 2020
Same error :(
$ python --version
Python 3.7.6
Traceback (most recent call last):
File "/home/tulsi/PathPicker/src/processInput.py", line 84, in
doProgram(flags)
File "/home/tulsi/PathPicker/src/processInput.py", line 53, in doProgram
lineObjs = getLineObjs(flags)
File "/home/tulsi/PathPicker/src/processInput.py", line 20, in getLineObjs
inputLines = sys.stdin.readlines()
File "/usr/lib/python3.7/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 4397: invalid start byte
pcottle commentedon Jan 24, 2020
Ah ok that's a helpful piece of context. Do you mind adding the most minimal
stdoutthat repros the issue? I presume its some kind of binary output that's piped straight intofpp?tulsidas commentedon Jan 24, 2020
Indeed it's binary ouput being piped directly. I don't know if this is useful, but it's a use case
same output if piped to fpp throws the previously mentioned error
pcottle commentedon Jan 27, 2020
Hrm I wasn't able to reproduce, but I imagine some of the binary data got lost between our pastes:
tulsidas commentedon Jan 27, 2020
Yes, there are surely many non-printable characters.
I was able to create a simple file, since the error states that it can parse the char 0x8b
See attached a.txt file
cat a.txt | fppreproduces the error
pcottle commentedon Jan 29, 2020
Hrm the file input has an errors parameter:
https://stackoverflow.com/questions/35028683/python3-unicodedecodeerror-with-readlines-method/41652865
do you know if there's an equivalent for
sys.stdin.readlines? Seems like that would solve our issuestulsidas commentedon Jan 29, 2020
I know very little python, apparently the trick is to read from stdin in binary mode, like this
pcottle commentedon Jan 29, 2020