Steaming PDF from Python Script to IE

Robin Becker robin at jessikat.fsnet.co.uk
Sun Jun 22 03:20:31 EDT 2003


In article <Xns93A249FD8260CJanC at 213.118.38.73>, JanC
<usenet_spam at janc.invalid> writes
>Stephen Thorne <stephen at thorne.id.au> schreef:
>
>> Also windows likes \r\n for CRLF, whereas you were just sending LF
>> (which is sufficient for unixes). 
>
>This has nothing to do with Windows vs. unix, the HTTP standard defines 
>CRLF as the only valid EOL marker for everything except the body.
>
>
>From RFC-2616 "Hypertext Transfer Protocol -- HTTP/1.1":
>
>| 2.2 Basic Rules
>| 
>| [...]
>|    HTTP/1.1 defines the sequence CR LF as the end-of-line marker for all
>|    protocol elements except the entity-body (see appendix 19.3 for
>|    tolerant applications). The end-of-line marker within an entity-body
>|    is defined by its associated media type, as described in section 3.7.
>
>Appendix 19.3 recommends tolerance for broken applications that send only 
>LF as EOF-marker.
>
it would also be wise to remember that PDF is a binary format itself
although to the casual eye it can look like ascii. Acrobat reader is
pretty clever at allowing for mistakes in this assumption, but many
printers are more picky.

ReportLab's cgi scripts routinely run with the shebang lines of the form

#!/mybin/python -u

to demand unbuffered binary i/o. 
-- 
Robin Becker




More information about the Python-list mailing list