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

Error using --stdout in a win32 box - CR + LF instead LF #112

Closed
odicha opened this issue Dec 23, 2012 · 1 comment
Closed

Error using --stdout in a win32 box - CR + LF instead LF #112

odicha opened this issue Dec 23, 2012 · 1 comment

Comments

@odicha
Copy link

odicha commented Dec 23, 2012

-example from console: "python unoconv -f pdf --stdout myfile.odt >> result.pdf
result.pdf is unusable because of bad end of line (in windows text style).
It works fine forcing "binary output" before write to stdout on win32 platforms
Tested & working ok with this ugly patch on def writeBytes( self, seq ):

def writeBytes( self, seq ):
+    if sys.platform == "win32":
+        import os, msvcrt
+        msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
    sys.stdout.write( seq.value )

same as http://stackoverflow.com/questions/2374427/python-2-x-write-binary-output-to-stdout

@dagwieers dagwieers added this to the Release 0.7 milestone Jul 5, 2015
@dagwieers
Copy link
Member

Merged. Thanks !

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

No branches or pull requests

2 participants