Commit Graph

1886 Commits

Author SHA1 Message Date
Greg Ward 787451b65f Added 'linestart' array and 'unreadline()' method (makes parsing a lot easier). 1999-03-26 21:48:59 +00:00
Guido van Rossum 447b4a0652 Test suite for UserList. 1999-03-26 16:20:45 +00:00
Guido van Rossum 2a340b3889 Use isinstance() where appropriate.
Reformatted with 4-space indent.
1999-03-26 16:20:18 +00:00
Guido van Rossum 3eccc48b5b Test suite for UserDict 1999-03-26 15:32:05 +00:00
Guido van Rossum 1697b9cdf6 Improved a bunch of things.
The constructor now takes an optional dictionary.
Use isinstance() where appropriate.
1999-03-26 15:31:12 +00:00
Guido van Rossum aa3828aa35 Basic regr tests for pickle/cPickle 1999-03-25 22:38:49 +00:00
Guido van Rossum 397032aa46 Don't use "exec" in find_class(). It's slow, unnecessary, and (as AMK
points out) it doesn't work in JPython Applets.
1999-03-25 21:58:59 +00:00
Andrew M. Kuchling 605ebddbea Added a simple test suite for gzip. It simply opens a temp file,
writes a chunk of compressed data, closes it, writes another chunk, and
reads the contents back to verify that they are the same.
1999-03-25 21:50:27 +00:00
Andrew M. Kuchling f4f119c055 Based on a suggestion from bruce@hams.com, make a trivial change to
allow using the 'a' flag as a mode for opening a GzipFile.  gzip
files, surprisingly enough, can be concatenated and then decompressed;
the effect is to concatenate the two chunks of data.

If we support it on writing, it should also be supported on reading.
This *wasn't* trivial, and required rearranging the code in the
reading path, particularly the _read() method.

Raise IOError instead of RuntimeError in two cases, 'Not a gzipped file'
and 'Unknown compression method'
1999-03-25 21:49:14 +00:00
Guido van Rossum 52a0d7d802 Add tests for float() and complex() with string args (Nick/Stephanie
Lockwood).
1999-03-25 21:25:01 +00:00
Guido van Rossum a6386ce1eb Added Jeremy's test code for the sha module. 1999-03-24 19:04:32 +00:00
Guido van Rossum 4ec2698725 Remove the temp file when we're done. 1999-03-24 19:03:01 +00:00
Guido van Rossum e256a0feed Add readlines() to _Subfile class. Not clear who would need it, but
Chris Lawrence sent me a broken version; this one is a tad simpler and
more conforming to the standard.
1999-03-24 16:20:45 +00:00
Jeremy Hylton c19f9972a1 use struct instead of bit-manipulate in Python 1999-03-23 23:05:34 +00:00
Greg Ward 782cdfe9f3 Changes to allow passing an open file to the constructor (to support
ProcessHierarchy's changes to support reading from a remote URL in
ProcessDatabase).
1999-03-23 14:00:06 +00:00
Andrew M. Kuchling dca7e00fd5 Added simple test for the flush() method of compression objects, trying the
different flush values Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH.
1999-03-22 19:23:17 +00:00
Guido van Rossum f247d75507 Bug reported by Tobias Thelen: missing "self." in assignment target. 1999-03-22 15:28:08 +00:00
Greg Ward 13ae1c8ff8 First checkin of real Distutils command modules. 1999-03-22 14:55:25 +00:00
Greg Ward 03f8c3cdd0 Obsolete source file -- command options are actually implemented in
a much less formalistic way.  Just keeping this around for possible
future reference.
1999-03-22 14:54:09 +00:00
Greg Ward 2689e3ddce First checkin of real Distutils code. 1999-03-22 14:52:19 +00:00
Guido van Rossum 8f0fa9e47f New code for split() by Tim Peters, behaves more like posixpath.split(). 1999-03-19 21:05:12 +00:00
Guido van Rossum 36561c5de4 Added BufferType, the type returned by the new builtin buffer(). Greg Stein. 1999-03-19 19:08:03 +00:00
Guido van Rossum f3963b1269 Sjoerd Mullender writes:
If a filename on Windows starts with \\, it is converted to a URL
which starts with ////.  If this URL is passed to urlparse.urlparse
you get a path that starts with // (and an empty netloc).  If you pass
the result back to urlparse.urlunparse, you get a URL that starts with
//, which is parsed differently by urlparse.urlparse.  The fix is to
add the (empty) netloc with accompanying slashes if the path in
urlunparse starts with //.  Do this for all schemes that use a netloc.
1999-03-18 15:10:44 +00:00
Guido van Rossum a0fec1637b Sjoerd Mullender writes:
Pathnames of files on other hosts in the same domain
(\\host\path\to\file) are not translated correctly to URLs and back.
The URL should be something like file:////host/path/to/file.
Note that a combination of drive letter and remote host is not
possible.
1999-03-18 14:21:41 +00:00
Guido van Rossum a2e18051b7 Delete non-standard-conforming code in urljoin() that would use the
netloc from the base url as the default netloc for the resulting url
even if the schemes differ.

Once upon a time, when the web was wild, this was a valuable hack
because some people had a URL referencing an ftp server colocated with
an http server without having the host in the ftp URL (so they could
replicate it or change the hostname easily).

More recently, after the file: scheme got added back to the list of
schemes that accept a netloc, it turns out that this caused weirdness
when joining an http: URL with a file: URL -- the resulting file: URL
would always inherit the host from the http: URL because the file:
scheme supports a netloc but in practice never has one.

There are two reasons to get rid of the old, once-valuable hack,
instead of removing the file: scheme from the uses_netloc list.  One,
the RFC says that file: uses the netloc syntax, and does not endorse
the old hack.  Two, neither netscape 4.5 nor IE 4.0 support the old
hack.
1999-03-17 22:30:10 +00:00
Guido van Rossum eb354b31e5 Bug reported by Jim Robinson:
An attempt to execute grid_slaves with arguments (0,0) results in
*all* of the slaves being returned, not just the slave associated with
row 0, column 0.  This is because the test for arguments in the method
does not test to see if row (and column) does not equal None, but
rather just whether is evaluates to non-false.  A value of 0 fails
this test.
1999-03-16 21:54:50 +00:00
Guido van Rossum 3764595c98 Yet another patch by Sjoerd Mullender:
Don't convert URLs to URLs using pathname2url.
1999-03-15 16:16:29 +00:00
Guido van Rossum d5138caba5 Patch by Michael Scharf. He writes:
The module cmd requires for each do_xxx command a help_xxx
    function. I think this is a little old fashioned.

    Here is a patch: use the docstring as help if no help_xxx
    function can be found.

[I'm tempted to rip out all the help_* functions from pdb, but I'll
resist it.  Any takers?  --Guido]
1999-03-12 22:15:43 +00:00
Guido van Rossum 4edf656402 Remove stuff with unsure copyright status 1999-03-12 19:31:51 +00:00
Guido van Rossum 367ac80d3b From: Sjoerd Mullender
The filename to URL conversion didn't properly quote special
characters.
The URL to filename didn't properly unquote special chatacters.
1999-03-12 14:31:10 +00:00
Fred Drake cbd987040e Added .rdf and .xsl as application/xml types. (.rdf is for the
Resource Description Framework, a metadata encoding, and .xsl is for
the Extensible Stylesheet Language.)
1999-03-11 16:04:04 +00:00
Guido van Rossum 59e4f37d76 Test for popen2 module, by Chris Tismer. 1999-03-11 13:26:23 +00:00
Guido van Rossum 29aab7582f open_http also had the 'data is None' test backwards. don't call with the
extra argument if data is None.
1999-03-09 19:31:21 +00:00
Greg Ward db75afe6e5 Added collapse_ws option. 1999-03-08 21:46:11 +00:00
Jeremy Hylton b30f52a471 http_error had the 'data is None' test backwards. don't call with the
extra argument if data is None.
1999-02-25 16:14:58 +00:00
Jeremy Hylton f90b002e31 change indentation from 8 spaces to 4 spaces 1999-02-25 16:12:12 +00:00
Jeremy Hylton 547c3f1c13 pleasing the tabnanny 1999-02-25 15:59:54 +00:00
Fred Drake bff3ae1f75 Oops, one more "x, y, z" to convert... 1999-02-25 14:26:02 +00:00
Fred Drake 87209172f0 Adjusted comment at the top to be less confusing, following Fredrik
Lundh's example.

Converted comment to docstring.
1999-02-25 14:24:22 +00:00
Fred Drake e1c717bd9b Moved whatsound to lib-old/, since it was declared obsolete and is documented
as such.
1999-02-24 18:59:24 +00:00
Fred Drake 0652a4e7d5 Use sndhdr instead of the obsolete whatsound module. 1999-02-24 18:49:15 +00:00
Jeremy Hylton dbc8364e1f When performing a POST request, i.e. when the second argument to
urlopen is used to specify form data, make sure the second argument is
threaded through all of the http_error_NNN calls.  This allows error
handlers like the redirect and authorization handlers to properly
re-start the connection.
1999-02-24 18:42:38 +00:00
Guido van Rossum 4fe6caaaf0 Patch by Lars Wirzenius:
o the initial comment is wrong: creating messages is already
	  implemented

	o Message.getbodytext: if the mail or it's part contains an
	  empty content-transfer-encoding header, the code used to
	  break; the change below treats an empty encoding value the same
	  as the other types that do not need decoding

	o SubMessage.getbodytext was missing the decode argument; the
	  change below adds it; I also made it unconditionally return
	  the raw text if decoding was not desired, because my own
	  routines needed that (and it was easier than rewriting my
	  own routines ;-)
1999-02-24 16:25:17 +00:00
Barry Warsaw 40db48c5ec Document the correct class hierarchy for SystemExit. It is not an
error and so it derives from Exception and not SystemError.  The
docstring was incorrect but the implementation was fine.
1999-02-24 00:27:39 +00:00
Guido van Rossum 83c03e2d94 Add import sys, needed by reference to sys.exc_info() in rmtree().
Discovered by Mitch Chapman.
1999-02-23 23:07:51 +00:00
Guido van Rossum 74ee886409 1. Print the error message (carefully) when a dl.open() fails in verbose mode.
2. When no test case worked, raise ImportError instead of failing.
1999-02-23 17:58:48 +00:00
Guido van Rossum 027188a382 According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the
list (of bsd variants that have a different lock structure).
1999-02-23 04:14:32 +00:00
Guido van Rossum 5ef8f0c3c7 According to Jeffrey Honig, bsd/os 4.0 should be added to the list. 1999-02-23 04:13:37 +00:00
Guido van Rossum 4505895e68 As Des Barry points out, we need to call pathname2url(file) in two
calls to addinfourl() in open_file().
1999-02-22 19:01:42 +00:00
Guido van Rossum fb801e7d33 As Finn Bock points out, _P_WAIT etc. don't have a leading underscore
so they don't need to be treated specially here.
1999-02-22 15:40:34 +00:00