Commit Graph

1864 Commits

Author SHA1 Message Date
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
Guido van Rossum 974e32d910 Steve Clift pointed out that 'file' allows a netloc. 1999-02-22 15:38:46 +00:00
Guido van Rossum 11a8d0b684 Dang. Even though this is obsolete code, somebody found a bug, and I
fix it.  Oh well.
1999-02-22 15:19:47 +00:00
Fred Drake 3d199af40d Bow to font-lock at the end of the docstring, since it throws stuff
off.

Make sure the path paramter to readmodule() is a list before adding it
with sys.path, or the addition could fail.
1999-02-18 20:51:50 +00:00
Fred Drake d804f4eea0 _safe_repr(): Simplify the condition tests in the first possible
return path.
1999-02-17 17:30:52 +00:00
Guido van Rossum 5d856fcd0f The usual 1999-02-16 20:05:35 +00:00
Guido van Rossum ed52a20c6e In open_ftp(), check that retrlen is not None before using it in a %d format! 1999-02-16 15:10:12 +00:00
Guido van Rossum 72ce85823c Fix by Chris Petrilli (to his own code) to limit the number of
iterations looking for expansions to 10.
1999-02-12 14:13:10 +00:00
Guido van Rossum c731723730 Mod by Jack Jansen: on Macintosh, use EasyDialogs.GetPassword if it
exists.
1999-02-11 14:41:46 +00:00
Guido van Rossum 00f7da4f1e Patch by Steve Clift -- fix the indices now that f_fsid is no longer returned! 1999-02-10 13:12:07 +00:00
Guido van Rossum 2e7840fe8f The usual. 1999-02-09 18:40:13 +00:00
Guido van Rossum 9e1721fa79 Tim Peters:
+ Implements a put_nowait method.
+ Adds a corresponding Queue.Full exception.
+ Simplifies the implementation by adding optional "block" args to get() and
put(), and makes the old get_nowait() and new put_nowait() one-line
redirections to get() and put().
+ Uses (much) simpler logic for the nowait cases.
+ Regularizes the doc strings to something closer to "Guido style" <wink>.
+ Converts two stray tabs into spaces.
+ Removes confusing verbiage about the queue "not being available" from the
docstrings -- never knew what that meant as a user, and after digging into
the implementation still didn't know what it was trying to say.
1999-02-08 18:34:01 +00:00
Guido van Rossum c55b0ca601 Put a try-except around the "image delete" call in Image.__del__ to
avoid tracebacks when the root is destroyed before the image object.
1999-02-08 15:26:49 +00:00
Guido van Rossum d42e46ead5 Ehm, when we don't need to byteswap the data, don't go through an
array object at all.
1999-02-05 22:32:11 +00:00
Guido van Rossum ebb9c922cb Two important fixes:
(1) on a little-endian platform, don't byteswap;

(2) in _patchheader(), there was a missing self._file argument to a
_write_long() call.
1999-02-05 22:28:17 +00:00
Guido van Rossum 14162abf6e The encoding type was wrong, I think. 1999-02-05 20:57:44 +00:00
Guido van Rossum 2013ba48a6 Should open files in binary mode!
Also finally get rid of some obsolete commented-out access statements.

A note about the previous checkin: I believe it's correct, but I found
something strange: the file Lib/test/audiotest.au in the Python
distribution was evidently encoded in u-LAW format but had its
encoding set to 2, i.e. linear-8.  I hope that this is a mistake
caused by some conversion program that produced this .au file; I just
found it on a website.
1999-02-05 20:55:16 +00:00
Guido van Rossum 5ebeea0467 Shouldn't be treating linear-8 as u-law! 1999-02-05 19:59:27 +00:00
Guido van Rossum ead9d8d2d7 New test for ntpath module 1999-02-03 17:21:21 +00:00
Guido van Rossum 534972bce2 New splitdrive() that knows about UNC paths (e.g., network paths like
\\host\mountpoint\dir\file).  By Larry Hastings.

Also cleaned up some docstrings.
1999-02-03 17:20:50 +00:00
Guido van Rossum 2e3f7bece0 Fredrik Lundh fixes Sjoerd's patch...
"""Sjoerd's version stores unbound methods.  that's not good enough ;-)
Here's an alternative implementation of fixdict."""
1999-02-02 22:15:24 +00:00
Guido van Rossum cc2c291b7f Patch by Sjoerd Mullender to placate /F:
Fix leaking of instances by removing the elements variable that we
created on closing the parser.  The elements variable is now created
in the reset() method, so that the sequence close(); reset();
... works.
Also, add the name of the entity reference that wasn't found to the
error message.
1999-02-02 17:54:38 +00:00
Guido van Rossum 67c65b2954 Special-case _P_WAIT etc. for NT. 1999-02-01 23:52:29 +00:00