Guido van Rossum [Sat, 27 Mar 1999 13:34:01 +0000 (13:34 +0000)]
Tim Peters writes:
Attached is a cleaned-up version of ndiff (added useful module
docstring, now echo'ed in case of cmd line mistake); added -q option
to suppress initial file identification lines; + other minor cleanups,
& a slightly faster match engine.
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.
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'
Add an .unused_data attribute to decompressor objects. If .unused_data
is not an empty string, this means that you have arrived at the
end of the stream of compressed data, and the contents of .unused_data are
whatever follows the compressed stream.
Guido van Rossum [Wed, 24 Mar 1999 19:09:00 +0000 (19:09 +0000)]
Added Samuel Bayer's new webchecker.
Unfortunately his code breaks wcgui.py in a way that's not easy
to fix. I expect that this is a temporary situation --
eventually Sam's changes will be merged back in.
(The changes add a -t option to specify exceptions to the -x
option, and explicit checking for #foo style fragment ids.)
Guido van Rossum [Wed, 24 Mar 1999 17:24:33 +0000 (17:24 +0000)]
Implement two suggestions by Jonathan Giddy: (1) in AIX, clear the
data struct before calling gethostby{name,addr}_r(); (2) ignore the
3/5/6 args determinations made by the configure script and switch on
platform identifiers instead:
AIX, OSF have 3 args
Sun, SGI have 5 args
Linux has 6 args
On all other platforms, undef HAVE_GETHOSTBYNAME_R altogether.
Guido van Rossum [Wed, 24 Mar 1999 16:20:45 +0000 (16:20 +0000)]
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.
Greg Ward [Tue, 23 Mar 1999 14:00:06 +0000 (14:00 +0000)]
Changes to allow passing an open file to the constructor (to support
ProcessHierarchy's changes to support reading from a remote URL in
ProcessDatabase).
Guido van Rossum [Mon, 22 Mar 1999 21:44:51 +0000 (21:44 +0000)]
Clean up pass for the previous patches.
- Use HAVE_GETHOSTBYNAME_R_6_ARG instead of testing for Linux and
glibc2.
- If gethostbyname takes 3 args, undefine HAVE_GETHOSTBYNAME_R --
don't know what code should be used.
- New symbol USE_GETHOSTBYNAME_LOCK defined iff the lock should be used.
- Modify the gethostbyaddr() code to also hold on to the lock until
after it is safe to release, overlapping with the Python lock.
(Note: I think that it could in theory be possible that Python code
executed while gethostbyname_lock is held could attempt to reacquire
the lock -- e.g. in a signal handler or destructor. I will simply say
"don't do that then.")
Guido van Rossum [Mon, 22 Mar 1999 20:14:53 +0000 (20:14 +0000)]
Jonathan Giddy writes:
Here's a patch to fix the race condition, which wasn't fixed by Rob's
patch. It holds the gethostbyname lock until the results are copied out,
which means that this lock and the Python global lock are held at the same
time. This shouldn't be a problem as long as the gethostbyname lock is
always acquired when the global lock is not held.
Fixed the flush() method of compression objects; the test for
the end of loop was incorrect, and failed when the flushmode != Z_FINISH.
Logic cleaned up and commented.
Greg Ward [Mon, 22 Mar 1999 14:54:09 +0000 (14:54 +0000)]
Obsolete source file -- command options are actually implemented in
a much less formalistic way. Just keeping this around for possible
future reference.
Guido van Rossum [Fri, 19 Mar 1999 20:59:40 +0000 (20:59 +0000)]
Fix a problem with Vladimir's PyFloat_Fini code: clear the free list; if
a block cannot be freed, add its free items back to the free list.
This is necessary to avoid leaking when Python is reinitialized later.
Guido van Rossum [Fri, 19 Mar 1999 20:30:39 +0000 (20:30 +0000)]
Fix a problem with Vladimir's PyInt_Fini code: clear the free list; if
a block cannot be freed, add its free items back to the free list, and
add its valid ints back to the small_ints array if they are in range.
This is necessary to avoid leaking when Python is reinitialized later.
Fred Drake [Thu, 18 Mar 1999 16:18:27 +0000 (16:18 +0000)]
Add some (commented out) macros to change the page size to the size of
typical published manuals, so people can more easily see what they're
really asking for. ;-)
Revise the verbatim environment: simple implementation, but more
compatible if a document also add \usepackage{verbatim} at the
beginning.
Declare \modindex, \bimodindex, \exmodindex, and \stmodindex
obsolete. These still work just fine, but \declaremodule should be
used instead. The obsolete macros will print a warning on standard
out.
Guido van Rossum [Thu, 18 Mar 1999 15:10:44 +0000 (15:10 +0000)]
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.
Guido van Rossum [Thu, 18 Mar 1999 14:21:41 +0000 (14:21 +0000)]
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.
Jack Jansen [Wed, 17 Mar 1999 22:57:55 +0000 (22:57 +0000)]
Remove all owner resources from template, and if no owner resource contained in
applet-specific rsrc file we add a "Pyta" owner resource. Owner resources have both id=0 and name="Owner resource" (is this always true?).
Guido van Rossum [Wed, 17 Mar 1999 22:30:10 +0000 (22:30 +0000)]
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.
Guido van Rossum [Tue, 16 Mar 1999 21:54:50 +0000 (21:54 +0000)]
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.
Guido van Rossum [Mon, 15 Mar 1999 20:27:53 +0000 (20:27 +0000)]
Rob Riggs wrote:
"""
Spec says that on success pthread_create returns 0. It does not say
that an error code will be < 0. Linux glibc2 pthread_create() returns
ENOMEM (12) when one exceed process limits. (It looks like it should
return EAGAIN, but that's another story.)
For reference, see:
http://www.opengroup.org/onlinepubs/7908799/xsh/pthread_create.html
"""
[I have a feeling that similar bugs were fixed before; perhaps someone
could check that all error checks no check for != 0?]
Guido van Rossum [Mon, 15 Mar 1999 16:37:54 +0000 (16:37 +0000)]
New mixin class that defines cmp and hash that use
the ob_itself pointer. This allows (when using the mixin)
different Python objects pointing to the same C object and
behaving well as dictionary keys.
Jack Jansen [Sat, 13 Mar 1999 23:07:32 +0000 (23:07 +0000)]
If a control has no refcon pointing back to the Python object we create a new
Python object. This needs a new bgenObjectDefinition.py, which implements
compare and hash functions.
Guido van Rossum [Fri, 12 Mar 1999 22:07:05 +0000 (22:07 +0000)]
Bug submitted by Wayne Knowles, who writes:
Under Windows, python freeze.py -o hello hello.py
creates all the correct files in the hello subdirectory, but the
Makefile has the directory prefix in it for frozen_extensions.c
nmake fails because it tries to locate hello/frozen_extensions.c
(His fix adds a call to os.path.basename() in the appropriate place.)
Guido van Rossum [Fri, 12 Mar 1999 19:43:17 +0000 (19:43 +0000)]
Vladimir has restructured his code somewhat so that the blocks are now
represented by an explicit structure. (There are still too many casts
in the code, but that may be unavoidable.)
Also added code so that with -vv it is very chatty about what it does.