A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/069347.html below:

Apache/Win 95 Irregularity

Apache/Win 95 Irregularity Apache/Win 95 IrregularityFredrik Lundh fredrik at pythonware.com
Mon Apr 16 12:31:26 EDT 2001
Steve Holden wrote:
> Under Windows 95 using Apache/1.3.19 and ActivePython (original build) I get
> something which IE 5.5 reports as being a 2326-byte GIF file containing a
> 259 x 32-pixel image whose appearance bears no relation to the Apache logo:

    http://www.python.org/doc/FAQ.html#7.12
    Q. cgi.py (or other CGI programming) doesn't work
    sometimes on NT or win95!

summary: the output stream is opened in text mode under Windows.  to get
binary mode, run the interpreter with the -u option.

> #!C:\Python20\python

this might work:

    #!C:\Python20\python -u

> ##
> ##  image.py: serve a GIF image
> ##
> import sys, base64
> o = open("C:/Program Files/Apache
> Group/Apache/htdocs/apache_pb.gif","rb").read()
> sys.stdout.write('Content-Type: image/gif\r\n')
> sys.stdout.write('Content-Length: %d\r\n\r\n' % len(o))
> sys.stdout.write(o)

Cheers /F



More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4