[reportlab-users] Ok to ask a simple z3c.rml question?
Aaron Spike
aaron at ekips.org
Tue Mar 11 11:30:53 EDT 2008
Werner Thie wrote:
> Hmm, there is aboslutely no reference to LINEEND in sight in the whole
> z3c.rml package, I found the place in pdfutils.py in replab though and
> it's preset to '\015\012'. It might be that the file to be written to is
> opened in text instead of binary mode, we see therefore a superfluous
> '\015' before the LINEEND. I'll try to drill down a bit further and
> locate the offending code.
That sounds like the problem. Who is opening the file? I'm not sure if
it is the best method, but I've used the following code in the past to
make sure that stdin and stdout use binary mode.
import sys
if sys.platform == 'win32':
import os, msvcrt
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
Aaron Spike
More information about the reportlab-users
mailing list