Tim Peters [Sun, 12 Aug 2001 00:41:33 +0000 (00:41 +0000)]
_Condition.wait(): never sleep longer than the timeout time remaining,
and even if we have a long time left to wait, try the lock at least 20
times/second.
Jack Jansen [Sat, 11 Aug 2001 23:22:43 +0000 (23:22 +0000)]
The test assumed that the local pathname convention for "foo" would sort before "foo/bar", which is not true on the mac (where they are "foo" and ":foo:bar", respectively; ":foo" would be fine too, but "foo" is the preferred spelling). Fixed by sorting the output.
Jack Jansen [Sat, 11 Aug 2001 23:18:55 +0000 (23:18 +0000)]
test_glob found a nasty bug in GUSI opendir(): it will not fail when called on files, but in stead open the parent directory! We now explicitly test for the argument being a directory and simulate ENOTDIR otherwise.
Jack Jansen [Sat, 11 Aug 2001 21:54:11 +0000 (21:54 +0000)]
Patch by Jonathan Wight (slightly reformatted) to forestall loading the
same module twice, which apparently crashes Python. I could not test the
error condition, but in normal life it seems to have no adverse effects.
Also removed an unsued variable, and corrected 2 glaring errors (missing
'case' in front of a label).
Guido van Rossum [Sat, 11 Aug 2001 04:37:07 +0000 (04:37 +0000)]
Finally fix SF bug #441172, using a variant of patch ##443626:
canceling an edit operation would not revert the value of the field.
The fix takes care to destroy the Entry object, as suggested in the
patch.
Tim Peters [Sat, 11 Aug 2001 04:01:31 +0000 (04:01 +0000)]
Now that the dialogs have some breathing room, split the combo of Tcl/Tk,
IDLE and pydoc into a separate component. That's almost as big as the
rest of Python (excl. docs and test suite) combined.
Pop up a confimation box if they choose to install at least one of
{Tcl/Tk/IDLE/pydoc, Tools, Test suite} but do not choose to install
Python -- doesn't make much sense, so ask whether that's really what they
want.
Fred Drake [Sat, 11 Aug 2001 03:28:41 +0000 (03:28 +0000)]
For the escape() function, added a reference to the quoteattrs() function
in xml.sax.saxutils, since that is the right function to use for quoting
attribute values.
This closes SF bug #444707.
Cleaned up a variety of other minor markup errors.
Jeremy Hylton [Fri, 10 Aug 2001 21:41:33 +0000 (21:41 +0000)]
Refactor future feature handling
Replace uses of PyCF_xxx with CO_xxx.
Replace individual feature slots in PyFutureFeatures with single
bitmask ff_features.
When flags must be transfered among the three parts of the interpreter
that care about them -- the pythonrun layer, the compiler, and the
future feature parser -- can simply or (|) the definitions.
Jeremy Hylton [Fri, 10 Aug 2001 21:38:04 +0000 (21:38 +0000)]
Refactor future feature handling
Replace individual slots in PyFutureFeatures with a single bitmask
with one field per feature. The flags for this bitmask are the same
as the flags used in the co_flags slot of a code object.
XXX This means we waste several bits, because they are used
for co_flags but have no meaning for future statements. Don't
think this is an issue.
Remove the NESTED_SCOPES_DEFAULT define and others. Not sure what
they were for anyway.
Remove all the PyCF_xxx flags, but define PyCF_MASK in terms of the
CO_xxx flags that are relevant for this release.
Change definition of PyCompilerFlags so that cf_flags matches
co_flags.
Guido van Rossum [Fri, 10 Aug 2001 21:24:08 +0000 (21:24 +0000)]
- Big changes to fix SF bug #442833 (a nasty multiple inheritance
problem). inherit_slots() is split in two parts: inherit_special()
which inherits the flags and a few very special members from the
dominant base; inherit_slots() which inherits only regular slots,
and is now called for each base in the MRO in turn. These are now
both void functions since they don't have error returns.
- Added object.__setitem__() back -- for the same reason as
object.__new__(): a subclass of object should be able to call
object.__new__().
- add_wrappers() was moved around to be closer to where it is used (it
was defined together with add_methods() etc., but has nothing to do
with these).
Guido van Rossum [Fri, 10 Aug 2001 20:28:28 +0000 (20:28 +0000)]
Add PyDict_Merge(a, b, override):
PyDict_Merge(a, b, 1) is the same as PyDict_Update(a, b).
PyDict_Merge(a, b, 0) does something similar but leaves existing items
unchanged.
[Bug #414032] Make the 'sdist' command work when the distribution contains
libraries. This is done by adding a .get_source_files() method,
contributed by Rene Liebscher and slightly modified.
Remove an unused local variable spotted by PyChecker
Fred Drake [Fri, 10 Aug 2001 19:47:41 +0000 (19:47 +0000)]
Added this LaTeX style file to the package since not all LaTeX installations
have it, especially on non-Unix platforms. (MikTeX in particular does not
have it.)
[Bug #412271, bug #449009] Use 'license' as the attribute name,
though 'licence' is still supported for backward-compatibility
(Should I add a warning to get_licence(), or not bother?)
Also fixes an UnboundLocalError noticed by PyChecker
Guido van Rossum [Fri, 10 Aug 2001 17:39:49 +0000 (17:39 +0000)]
Change PyType_Ready() to use the READY and READYING flags. This makes
it possible to detect recursive calls early (as opposed to when the
stack overflows :-).
Patch #441091 from Finn Bock: the more advanced flush options are not
available in java, so only use the advanced flush options if they
are defined in the zlib module.
Guido van Rossum [Fri, 10 Aug 2001 14:56:54 +0000 (14:56 +0000)]
Disable the sub() optimization until Fredrik has time to look into SF
bug #449000, "re.sub(r'\n', ...) broke". This was Fredrik's
suggestion -- he's on vacation and said he wouldn't be able to work on
this until next week.
Tim Peters [Thu, 9 Aug 2001 22:21:55 +0000 (22:21 +0000)]
SF patch #438013 Remove 2-byte Py_UCS2 assumptions
Removed all instances of Py_UCS2 from the codebase, and so also (I hope)
the last remaining reliance on the platform having an integral type
with exactly 16 bits.
PyUnicode_DecodeUTF16() and PyUnicode_EncodeUTF16() now read and write
one byte at a time.
Sigh. Strengthen the resriction of the previous checkin: tp_new is
inherited unless *both*: (a) the base type is 'object', and (b) the
subtype is not a "heap" type.
Thinking back to the 2.22 revision, I didn't like what I did there one
bit. For one, this class:
class C(object):
def __new__(myclass, ...): ...
would have no way to call the __new__ method of its base class, and
the workaround (to create an intermediate base class whose __new__ you
can call) is ugly.
So, I've come up with a better solution that restores object.__new__,
but still solves the original problem, which is that built-in and
extension types shouldn't inherit object.__new__. The solution is
simple: only "heap types" inherit tp_new. Simpler, less code,
perfect!
Previously, f.read() and f.readlines() checked for
errors on their file object and possibly raised an
IOError, but f.readline() didn't. This patch makes
f.readline() behave like the others.
Note that I've added a call to clearerr() since the other calls to
ferror() include that too.
For local files urllib.py doesn't return the MIME
headers that the documentation says it does:
http://www.python.org/doc/current/lib/module-
urllib.html#l2h-2187 states that "When the method is
local-file, returned headers will include a Date
representing the file's last-modified time, a Content-
Length giving file size, and a Content-Type containing
a guess at the file's type"
But in Python 2.1 the only header that gets returned
is the Content-Type:
Python's logolike module turtle.py did not display
the turtle except when actually drawing lines.
This patch changes the turtle.py module so that
it displays the turtle at all times when tracing is
on. This is similar to the the way that logo works.
When tracing is off the turtle will not be displayed.
Add get_objects function. This is a low level function (like
get_referents, and is not yet documented in the library manual).
Suggestions for a better name welcome.
Martin v. Löwis [Thu, 9 Aug 2001 12:24:38 +0000 (12:24 +0000)]
Patch #437683: Use re instead of regex.
If multiple header files are processed simultaneously which include each
other, the corresponding modules mport each other. Specifically, if h2py
is invoked with sys/types.h first, later header files won't contain the
complete contents of TYPES.py.
Thomas Wouters [Thu, 9 Aug 2001 09:53:00 +0000 (09:53 +0000)]
Michael Hudson correctly pointed out we should cvsignore pyconfig.h, not
config.h (anymore). People will still have to delete config.h from their
source trees manually :)