Staging
v0.5.1
https://github.com/python/cpython
Revision 066af1074dfed4f7a6538692433ba04995dd7509 authored by Greg Ward on 22 March 2000, 00:30:54 UTC, committed by Greg Ward on 22 March 2000, 00:30:54 UTC
these must come from the 'build' command.  This means we no longer need
the misconceived 'set_peer_option()' method in Command and, more importantly,
sweeps away a bunch of potential future complexity to handle this tricky
case.
1 parent 1b4ede5
Raw File
Tip revision: 066af1074dfed4f7a6538692433ba04995dd7509 authored by Greg Ward on 22 March 2000, 00:30:54 UTC
Dropped any notion of allowing the user to specify the build directories:
Tip revision: 066af10
test_gzip.py

import sys, os
import gzip, tempfile

filename = tempfile.mktemp()

data1 = """  int length=DEFAULTALLOC, err = Z_OK;
  PyObject *RetVal;
  int flushmode = Z_FINISH;
  unsigned long start_total_out;

"""

data2 = """/* zlibmodule.c -- gzip-compatible data compression */
/* See http://www.cdrom.com/pub/infozip/zlib/ */
/* See http://www.winimage.com/zLibDll for Windows */
"""

f = gzip.GzipFile(filename, 'wb') ; f.write(data1) ; f.close()

f = gzip.GzipFile(filename, 'rb') ; d = f.read() ; f.close()
assert d == data1

# Append to the previous file
f = gzip.GzipFile(filename, 'ab') ; f.write(data2) ; f.close()

f = gzip.GzipFile(filename, 'rb') ; d = f.read() ; f.close()
assert d == data1+data2

os.unlink( filename )
back to top