Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Python 3 to read binary data from stdin #309

Merged
merged 2 commits into from Mar 22, 2016

Conversation

kaysersoze
Copy link
Contributor

@kaysersoze
Copy link
Contributor Author

This fixes an issue I encountered when trying to pass a file in via stdin.

Traceback (most recent call last):
  File "/usr/local/bin/unoconv", line 1349, in <module>
    main()
  File "/usr/local/bin/unoconv", line 1259, in main
    inputfn = sys.stdin.read()
  File "/Applications/LibreOffice.app/Contents/MacOS/LibreOfficePython.framework/Versions/3.3/lib/python3.3/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 14: ordinal not in range(128)

@dagwieers
Copy link
Member

I am personally not for if-else constructs on a single line.
In my opinion they break readability (but maybe I am getting old ;-))

If you don't want/know how to update the PR, let me know and I will merge and fix it myself.

Thanks !

@dagwieers dagwieers added the bug label Jan 19, 2016
@dagwieers dagwieers added this to the Release 0.8 milestone Jan 19, 2016
@kaysersoze
Copy link
Contributor Author

@dagwieers I've restructured the ternary into an if-else. Let me know if that looks good.

@dagwieers dagwieers merged commit 260b815 into unoconv:master Mar 22, 2016
@dagwieers
Copy link
Member

Perfect, thanks ! Merged !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants