Skip to content

fpb should detect when given binary input #76

@chriskuehl

Description

@chriskuehl

This isn't so great:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions