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
baisang@redacted ~> fpb logs.zip
Traceback (most recent call last):
File "/usr/bin/fpb", line 11, in <module>
sys.exit(paste_main())
File "/opt/venvs/fluffy/lib/python3.6/site-packages/fluffy_cli/main.py", line 200, in paste_main
return paste(args.server, args.file, args.language, args.regex, auth, args.direct_link, args.tee)
File "/opt/venvs/fluffy/lib/python3.6/site-packages/fluffy_cli/main.py", line 95, in paste
content = f.read()
File "/opt/venvs/fluffy/lib/python3.6/codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x91 in position 12: invalid start byte
Let's detect when given a binary file and either upload it as a file automatically, or suggest using fput instead. It definitely shouldn't crash like this.
The text was updated successfully, but these errors were encountered:
Using identify doesn't work (unless we copy the function inline) since we don't want to add any additional dependencies to the cli. Maybe just check if it can be decoded?
I could imagine something like:
$ fpb some-file.bin
This file can't be decoded using UTF-8! This may indicate that it's a binary file, or using an unusual encoding.
What do you want to do?
(1) Upload it as text, decoded using latin-1. This may produce garbled text.
(2) Upload it as a binary file.
This isn't so great:
Let's detect when given a binary file and either upload it as a file automatically, or suggest using
fput
instead. It definitely shouldn't crash like this.The text was updated successfully, but these errors were encountered: