]> granicus.if.org Git - python/log
python
22 years agofixed refcount leak in CreateNewWindow() and CreateWindowFromResource().
Just van Rossum [Wed, 5 Jun 2002 17:41:03 +0000 (17:41 +0000)]
fixed refcount leak in CreateNewWindow() and CreateWindowFromResource().

22 years agoBetter isinstance error message.
Thomas Heller [Wed, 5 Jun 2002 12:55:19 +0000 (12:55 +0000)]
Better isinstance error message.

Closes SF patch # 560250.

Bugfix candidate IMO.

22 years agoMove warning about directory not on sys.path to debug level.
Jeremy Hylton [Tue, 4 Jun 2002 21:20:08 +0000 (21:20 +0000)]
Move warning about directory not on sys.path to debug level.

Fix a bunch of multiline string constants that used +.

22 years agoTest changes before checking them in.
Jeremy Hylton [Tue, 4 Jun 2002 21:11:56 +0000 (21:11 +0000)]
Test changes before checking them in.

22 years agoTrack extra arg to option_table to all uses of it
Jeremy Hylton [Tue, 4 Jun 2002 21:10:35 +0000 (21:10 +0000)]
Track extra arg to option_table to all uses of it

22 years agoReplace bogus bare variables with attribute access.
Jeremy Hylton [Tue, 4 Jun 2002 21:06:16 +0000 (21:06 +0000)]
Replace bogus bare variables with attribute access.

22 years agoDefine DEBUG as early as possible to avoid import problems.
Jeremy Hylton [Tue, 4 Jun 2002 21:05:05 +0000 (21:05 +0000)]
Define DEBUG as early as possible to avoid import problems.

22 years agoAdd missing import of log.
Jeremy Hylton [Tue, 4 Jun 2002 21:04:03 +0000 (21:04 +0000)]
Add missing import of log.

22 years agoUse module-level import of DEBUG instead of many function-level imports.
Jeremy Hylton [Tue, 4 Jun 2002 21:02:26 +0000 (21:02 +0000)]
Use module-level import of DEBUG instead of many function-level imports.

22 years agoRemove unused imports
Jeremy Hylton [Tue, 4 Jun 2002 21:00:33 +0000 (21:00 +0000)]
Remove unused imports

22 years agoMake None return explicit
Jeremy Hylton [Tue, 4 Jun 2002 21:00:20 +0000 (21:00 +0000)]
Make None return explicit

22 years agoimport base64 at the top to avoid two different imports at other times
Jeremy Hylton [Tue, 4 Jun 2002 20:55:10 +0000 (20:55 +0000)]
import base64 at the top to avoid two different imports at other times

22 years agoensure_filename() only takes one argument.
Jeremy Hylton [Tue, 4 Jun 2002 20:45:17 +0000 (20:45 +0000)]
ensure_filename() only takes one argument.

Call ensure_string() with one arg too, since the second value passed
was the default.

22 years agoReindent lines to improve readability
Jeremy Hylton [Tue, 4 Jun 2002 20:42:41 +0000 (20:42 +0000)]
Reindent lines to improve readability

22 years agoRemove (commented out) options that have moved into the distribution.
Jeremy Hylton [Tue, 4 Jun 2002 20:40:03 +0000 (20:40 +0000)]
Remove (commented out) options that have moved into the distribution.

22 years agoget_script() implicitly returned None and also had explicit returns.
Jeremy Hylton [Tue, 4 Jun 2002 20:39:34 +0000 (20:39 +0000)]
get_script() implicitly returned None and also had explicit returns.

Make all returns explicit and rearrange logic to avoid extra
indentation.

22 years agoglobal _option_order is not used
Jeremy Hylton [Tue, 4 Jun 2002 20:35:10 +0000 (20:35 +0000)]
global _option_order is not used

22 years agoFix bug in recent change to logging code.
Jeremy Hylton [Tue, 4 Jun 2002 20:30:10 +0000 (20:30 +0000)]
Fix bug in recent change to logging code.

mode is not computed in dry_run mode, so it can't be included in the
log message.

22 years agoFix unused local variables caught by pychecker.
Jeremy Hylton [Tue, 4 Jun 2002 20:26:44 +0000 (20:26 +0000)]
Fix unused local variables caught by pychecker.

Fixes a bug for Solaris pkgtool (bdist_pkgtool) that would have
prevented it from building subpackages.

22 years agoSet repeat metadata for an option based on repeat local var not
Jeremy Hylton [Tue, 4 Jun 2002 20:24:05 +0000 (20:24 +0000)]
Set repeat metadata for an option based on repeat local var not
constant.

22 years agoRemove unused imports caught by pychecker
Jeremy Hylton [Tue, 4 Jun 2002 20:18:24 +0000 (20:18 +0000)]
Remove unused imports caught by pychecker

22 years agoMake setup.py less chatty by default.
Jeremy Hylton [Tue, 4 Jun 2002 20:14:43 +0000 (20:14 +0000)]
Make setup.py less chatty by default.

This is a conservative version of SF patch 504889.  It uses the log
module instead of calling print in various places, and it ignores the
verbose argument passed to many functions and set as an attribute on
some objects.  Instead, it uses the verbosity set on the logger via
the command line.

The log module is now preferred over announce() and warn() methods
that exist only for backwards compatibility.

XXX This checkin changes a lot of modules that have no test suite and
aren't exercised by the Python build process.  It will need
substantial testing.

22 years agoA simple log mechanism styled after the proposed std library module
Jeremy Hylton [Tue, 4 Jun 2002 20:00:26 +0000 (20:00 +0000)]
A simple log mechanism styled after the proposed std library module

22 years agoAddress SF bug 519621: slots weren't traversed by GC.
Guido van Rossum [Tue, 4 Jun 2002 19:52:53 +0000 (19:52 +0000)]
Address SF bug 519621: slots weren't traversed by GC.

While I was at it, I added a tp_clear handler and changed the
tp_dealloc handler to use the clear_slots helper for the tp_clear
handler.

Also tightened the rules for slot names: they must now be proper
identifiers (ignoring the dirty little fact that <ctype.h> is locale
sensitive).

Also set mp->flags = READONLY for the __weakref__ pseudo-slot.

Most of this is a 2.2 bugfix candidate; I'll apply it there myself.

22 years agoThe comment said:
Jeremy Hylton [Tue, 4 Jun 2002 18:55:54 +0000 (18:55 +0000)]
The comment said:

 # XXX this isn't used anywhere, and worse, it has the same name as a method
 # in Command with subtly different semantics.  (This one just has one
 # source -> one dest; that one has many sources -> one dest.)  Nuke it?

Yes.  Nuke it.

22 years agoInverted test for small speedup
Raymond Hettinger [Tue, 4 Jun 2002 18:45:50 +0000 (18:45 +0000)]
Inverted test for small speedup

22 years agoFiddle wording.
Michael W. Hudson [Tue, 4 Jun 2002 18:27:35 +0000 (18:27 +0000)]
Fiddle wording.

22 years agoFix SF bug #557436, TclError is a str should be an Exception
Neal Norwitz [Tue, 4 Jun 2002 17:14:07 +0000 (17:14 +0000)]
Fix SF bug #557436, TclError is a str should be an Exception

Make Tkinter.TclError derive from Exception, it was a string.

22 years agoFix up Guido's markup.
Fred Drake [Tue, 4 Jun 2002 16:25:57 +0000 (16:25 +0000)]
Fix up Guido's markup.

22 years agoWhen using a Python that has not been installed to build 3rd-party
Fred Drake [Tue, 4 Jun 2002 15:28:21 +0000 (15:28 +0000)]
When using a Python that has not been installed to build 3rd-party
modules, distutils does not understand that the build version of the
source tree is needed.

This patch fixes distutils.sysconfig to understand that the running
Python is part of the build tree and needs to use the appropriate
"shape" of the tree. This does not assume anything about the current
directory, so can be used to build 3rd-party modules using Python's
build tree as well.

This is useful since it allows us to use a non-installed debug-mode
Python with 3rd-party modules for testing. It as the side-effect that
set_python_build() is no longer needed (the hack which was added to
allow distutils to be used to build the "standard" extension modules).

This closes SF patch #547734.

22 years agoAdd constants BOM_UTF8, BOM_UTF16, BOM_UTF16_LE, BOM_UTF16_BE,
Walter Dörwald [Tue, 4 Jun 2002 15:16:29 +0000 (15:16 +0000)]
Add constants BOM_UTF8, BOM_UTF16, BOM_UTF16_LE, BOM_UTF16_BE,
BOM_UTF32, BOM_UTF32_LE and BOM_UTF32_BE that represent the Byte
Order Mark in UTF-8, UTF-16 and UTF-32 encodings for little and
big endian systems.

The old names BOM32_* and BOM64_* were off by a factor of 2.

This closes SF bug http://www.python.org/sf/555360

22 years agoPatch #555929: Cygwin AH_BOTTOM cleanup patch (*** version 2 ***)
Jason Tishler [Tue, 4 Jun 2002 15:07:08 +0000 (15:07 +0000)]
Patch #555929: Cygwin AH_BOTTOM cleanup patch (*** version 2 ***)

This patch complies with the following request found
near the top of configure.in:

# This is for stuff that absolutely must end up in pyconfig.h.
# Please use pyport.h instead, if possible.

I tested this patch under Cygwin, Win32, and Red
Hat Linux. Python built and ran successfully on
each of these platforms.

22 years agoTest repair now that module.__init__ requires a name and initializes
Guido van Rossum [Tue, 4 Jun 2002 06:10:37 +0000 (06:10 +0000)]
Test repair now that module.__init__ requires a name and initializes
__name__ and __doc__.

22 years agoRepair the test (adding a docstring to the module type changed the
Guido van Rossum [Tue, 4 Jun 2002 06:06:54 +0000 (06:06 +0000)]
Repair the test (adding a docstring to the module type changed the
docstring for an uninitialized module object).

22 years agoAdd a docstring to the module type.
Guido van Rossum [Tue, 4 Jun 2002 06:02:35 +0000 (06:02 +0000)]
Add a docstring to the module type.

22 years agoSurprising fix for SF bug 563060: module can be used as base class.
Guido van Rossum [Tue, 4 Jun 2002 05:58:34 +0000 (05:58 +0000)]
Surprising fix for SF bug 563060: module can be used as base class.

Change the module constructor (module_init) to have the signature
__init__(name:str, doc=None); this prevents the call from type_new()
to succeed.  While we're at it, prevent repeated calling of
module_init for the same module from leaking the dict, changing the
semantics so that __dict__ is only initialized if NULL.

Also adding a unittest, test_module.py.

This is an incompatibility with 2.2, if anybody was instantiating the
module class before, their argument list was probably empty; so this
can't be backported to 2.2.x.

22 years agoSurprising fix for SF bug 563060: module can be used as base class.
Guido van Rossum [Tue, 4 Jun 2002 05:52:47 +0000 (05:52 +0000)]
Surprising fix for SF bug 563060: module can be used as base class.

Change the module constructor (module_init) to have the signature
__init__(name:str, doc=None); this prevents the call from type_new()
to succeed.  While we're at it, prevent repeated calling of
module_init for the same module from leaking the dict, changing the
semantics so that __dict__ is only initialized if NULL.

Also adding a unittest, test_module.py.

This is an incompatibility with 2.2, if anybody was instantiating the
module class before, their argument list was probably empty; so this
can't be backported to 2.2.x.

22 years agoReplace .keys() with .iteritems(). Second review and test by Alex.
Raymond Hettinger [Tue, 4 Jun 2002 02:17:04 +0000 (02:17 +0000)]
Replace .keys() with .iteritems().  Second review and test by Alex.

22 years agoAddress the residual issue with the fix for SF 551412 in
Guido van Rossum [Mon, 3 Jun 2002 19:52:41 +0000 (19:52 +0000)]
Address the residual issue with the fix for SF 551412 in
_PyType_Lookup().  Decided to clear the error condition in the
unfortunate but unlikely case that PyType_Ready() fails.

Will fix in 2.2.x too.

22 years agoThe warning filter was ineffective when this module was invoked as a
Guido van Rossum [Mon, 3 Jun 2002 19:45:32 +0000 (19:45 +0000)]
The warning filter was ineffective when this module was invoked as a
script.

22 years agoAddressed SF bug 421973 (finally).
Guido van Rossum [Mon, 3 Jun 2002 19:06:41 +0000 (19:06 +0000)]
Addressed SF bug 421973 (finally).

Rewrote the subsection on coercion rules (and made it a proper
subsection, with a label).  The new section is much less precise,
because precise rules would be too hard to give (== I don't know what
they are any more :-).  OTOH, the new section gives much more
up-to-date information.

Also noted that __coerce__ may return NotImplemented, with the same
meaning as None.

I beg Fred forgiveness: my use of \code{} is probably naive.  Please
fix this and other markup nits.  An index entry would be nice.

This could be a 2.2 bugfix candidate, if we bother about old docs
(Fred?)

22 years agoFix HTTPError __init__ for cases where fp is None.
Jeremy Hylton [Mon, 3 Jun 2002 16:53:00 +0000 (16:53 +0000)]
Fix HTTPError __init__ for cases where fp is None.

The HTTPError class tries to act as a regular response objects for
HTTP protocol errors that include full responses.  If the failure is
more basic, like no valid response, the __init__ choked when it tried
to initialize its superclasses in addinfourl hierarchy that requires a
valid response.

The solution isn't elegant but seems to be effective.  Do not
initialize the base classes if there isn't a file object containing
the response.  In this case, user code expecting to use the addinfourl
methods will fail; but it was going to fail anyway.

It might be cleaner to factor out HTTPError into two classes, only one
of which inherits from addinfourl.  Not sure that the extra complexity
would lead to any improved functionality, though.

Partial fix for SF bug # 563665.

Bug fix candidate for 2.1 and 2.2.

22 years agoRemove uses of the string and types modules:
Walter Dörwald [Mon, 3 Jun 2002 15:58:32 +0000 (15:58 +0000)]
Remove uses of the string and types modules:

x in string.whitespace => x.isspace()
type(x) in types.StringTypes => isinstance(x, basestring)
isinstance(x, types.StringTypes) => isinstance(x, basestring)
type(x) is types.StringType => isinstance(x, str)
type(x) == types.StringType => isinstance(x, str)
string.split(x, ...) => x.split(...)
string.join(x, y) => y.join(x)
string.zfill(x, ...) => x.zfill(...)
string.count(x, ...) => x.count(...)
hasattr(types, "UnicodeType") => try: unicode except NameError:
type(x) != types.TupleTuple => not isinstance(x, tuple)
isinstance(x, types.TupleType) => isinstance(x, tuple)
type(x) is types.IntType => isinstance(x, int)

Do not mention the string module in the rlcompleter docstring.

This partially applies SF patch http://www.python.org/sf/562373
(with basestring instead of string). (It excludes the changes to
unittest.py and does not change the os.stat stuff.)

22 years agoFix a regression from the 1.68->1.69 checkin:
Walter Dörwald [Mon, 3 Jun 2002 10:41:45 +0000 (10:41 +0000)]
Fix a regression from the 1.68->1.69 checkin:

string.split(foo, bar) must be foo.split(bar) instead of bar.split(foo).

22 years agoregrtest has a new
Tim Peters [Sun, 2 Jun 2002 21:42:01 +0000 (21:42 +0000)]
regrtest has a new
   -f/--fromfile <filename>
option.  This runs all and only the tests named in the file, in the
order given (although -x may weed that list, and -r may shuffle it).
Lines starting with '#' are ignored.

This goes a long way toward helping to automate the binary-search-like
procedure I keep reinventing by hand when a test fails due to interaction
among tests (no failure in isolation, and some unknown number of
predecessor tests need to run first -- now you can stick all the test
names in a file, and comment/uncomment blocks of lines until finding a
minimal set of predecessors).

22 years ago_parsebody(): Fix for the new message/rfc822 tree structure (the
Barry Warsaw [Sun, 2 Jun 2002 19:12:03 +0000 (19:12 +0000)]
_parsebody(): Fix for the new message/rfc822 tree structure (the
parent is now a multipart with one element, the sub-message object).

22 years agoGenerator.__call__() => Generator.flatten()
Barry Warsaw [Sun, 2 Jun 2002 19:09:27 +0000 (19:09 +0000)]
Generator.__call__() => Generator.flatten()

Also, adjust to the new message/rfc822 tree layout.

22 years agoheader_encode(), encode(): Use _floordiv() from the appropriate
Barry Warsaw [Sun, 2 Jun 2002 19:08:31 +0000 (19:08 +0000)]
header_encode(), encode(): Use _floordiv() from the appropriate
compatibility module.

22 years agoUse absolute import paths for intrapackage imports.
Barry Warsaw [Sun, 2 Jun 2002 19:07:16 +0000 (19:07 +0000)]
Use absolute import paths for intrapackage imports.

22 years agoUse absolute import paths for intrapackage imports.
Barry Warsaw [Sun, 2 Jun 2002 19:05:51 +0000 (19:05 +0000)]
Use absolute import paths for intrapackage imports.

as_string(): Use Generator.flatten() for better performance.

22 years agoUse absolute import paths for intrapackage imports.
Barry Warsaw [Sun, 2 Jun 2002 19:05:08 +0000 (19:05 +0000)]
Use absolute import paths for intrapackage imports.

Use MIMENonMultipart as the base class so that you can't attach() to
these non-multipart message types.

22 years agoflatten(): Renamed from __call__() which is (silently) deprecated.
Barry Warsaw [Sun, 2 Jun 2002 19:02:37 +0000 (19:02 +0000)]
flatten(): Renamed from __call__() which is (silently) deprecated.
__call__() can be 2-3x slower than the equivalent normal method.

_handle_message(): The structure of message/rfc822 message has
changed.  Now parent's payload is a list of length 1, and the zeroth
element is the Message sub-object.  Adjust the printing of such
message trees to reflect this change.

22 years ago_intdiv2() -> _floordiv(), merge of uncommitted changes.
Barry Warsaw [Sun, 2 Jun 2002 18:59:06 +0000 (18:59 +0000)]
_intdiv2() -> _floordiv(), merge of uncommitted changes.

22 years agoReplaced .keys() with dictionary iterators
Raymond Hettinger [Sun, 2 Jun 2002 18:55:56 +0000 (18:55 +0000)]
Replaced .keys() with dictionary iterators

22 years agoGet email test to pass. Barry, hope this is what you had in mind
Neal Norwitz [Sun, 2 Jun 2002 16:38:14 +0000 (16:38 +0000)]
Get email test to pass.  Barry, hope this is what you had in mind

22 years agoMake test_mhlib run again.
Michael W. Hudson [Sun, 2 Jun 2002 16:12:06 +0000 (16:12 +0000)]
Make test_mhlib run again.

There's some wierdness here, but the test ran before and not after,
so I'm just hacking the change out.  Someone more motivated than
me can work out what's really happening.

Raymond: *PLEASE* run the test suite before checking things like
this in!

22 years agoPatch #552060: Add SSLFakeSocket.sendall. Also committed for 2.2 maint.
Martin v. Löwis [Sun, 2 Jun 2002 12:33:22 +0000 (12:33 +0000)]
Patch #552060: Add SSLFakeSocket.sendall. Also committed for 2.2 maint.

22 years agoReplaced boolean tests with is None.
Raymond Hettinger [Sun, 2 Jun 2002 03:04:52 +0000 (03:04 +0000)]
Replaced boolean tests with is None.

22 years agoReplace boolean test with is None.
Raymond Hettinger [Sun, 2 Jun 2002 00:40:05 +0000 (00:40 +0000)]
Replace boolean test with is None.

22 years agoUse somewhat longer C++ program to detect whether linking requires the C++
Martin v. Löwis [Sat, 1 Jun 2002 21:39:58 +0000 (21:39 +0000)]
Use somewhat longer C++ program to detect whether linking requires the C++
compiler. Fixes #559429. 2.2 bugfix candidate.

22 years agoReplaced obsolete stat module constants with equivalent attributes
Raymond Hettinger [Sat, 1 Jun 2002 19:51:15 +0000 (19:51 +0000)]
Replaced obsolete stat module constants with equivalent attributes

22 years agoReplace boolean test with is None.
Raymond Hettinger [Sat, 1 Jun 2002 16:07:16 +0000 (16:07 +0000)]
Replace boolean test with is None.

22 years agoSF 563203. Replaced 'has_key()' with 'in'.
Raymond Hettinger [Sat, 1 Jun 2002 14:25:41 +0000 (14:25 +0000)]
SF 563203. Replaced 'has_key()' with 'in'.

22 years agoSF 563203. Replaced 'has_key()' with 'in'.
Raymond Hettinger [Sat, 1 Jun 2002 14:18:47 +0000 (14:18 +0000)]
SF 563203. Replaced 'has_key()' with 'in'.

22 years agoBump to version 2.0.5, and also use absolute import paths.
Barry Warsaw [Sat, 1 Jun 2002 06:03:09 +0000 (06:03 +0000)]
Bump to version 2.0.5, and also use absolute import paths.

22 years agoThese two classes provide bases for more specific content type
Barry Warsaw [Sat, 1 Jun 2002 05:59:12 +0000 (05:59 +0000)]
These two classes provide bases for more specific content type
subclasses.

MIMENonMultipart: Base class for non-multipart/* content type subclass
specializations, e.g. image/gif.  This class overrides attach() which
raises an exception, since it makes no sense to attach a subpart to
e.g. an image/gif message.

MIMEMultipart: Base class for multipart/* content type subclass
specializations, e.g. multipart/mixed.  Does little more than provide
a useful constructor.

22 years agoThe _compat modules now export _floordiv() instead of _intdiv2() for
Barry Warsaw [Sat, 1 Jun 2002 05:49:17 +0000 (05:49 +0000)]
The _compat modules now export _floordiv() instead of _intdiv2() for
better code reuse.

_split() Use _floordiv().

22 years agoSlightly better docstring
Barry Warsaw [Sat, 1 Jun 2002 05:45:37 +0000 (05:45 +0000)]
Slightly better docstring

22 years agoA bogus assert in the new listiter code prevented starting Python in a
Tim Peters [Sat, 1 Jun 2002 05:22:55 +0000 (05:22 +0000)]
A bogus assert in the new listiter code prevented starting Python in a
debug build.  Repaired that, and rewrote other parts to reduce
long-winded casting.

22 years ago_is_unicode(): Use UnicodeType instead of the unicode builtin for
Barry Warsaw [Sat, 1 Jun 2002 03:56:07 +0000 (03:56 +0000)]
_is_unicode(): Use UnicodeType instead of the unicode builtin for
Python 2.1 compatibility.

22 years agoReplaced boolean test with is None
Raymond Hettinger [Sat, 1 Jun 2002 03:06:31 +0000 (03:06 +0000)]
Replaced boolean test with is None

22 years agoReplace boolean test with is None
Raymond Hettinger [Sat, 1 Jun 2002 01:29:16 +0000 (01:29 +0000)]
Replace boolean test with is None

22 years agoReplaced boolean test with 'is None'
Raymond Hettinger [Sat, 1 Jun 2002 00:57:55 +0000 (00:57 +0000)]
Replaced boolean test with 'is None'

22 years agoUse is None rather than general boolean
Raymond Hettinger [Sat, 1 Jun 2002 00:06:20 +0000 (00:06 +0000)]
Use is None rather than general boolean

22 years agoUse is None rather than general boolean
Raymond Hettinger [Fri, 31 May 2002 23:54:44 +0000 (23:54 +0000)]
Use is None rather than general boolean

22 years agoUse is None rather than general boolean
Raymond Hettinger [Fri, 31 May 2002 23:03:33 +0000 (23:03 +0000)]
Use is None rather than general boolean

22 years agoRemove unused static function
Neal Norwitz [Fri, 31 May 2002 21:47:02 +0000 (21:47 +0000)]
Remove unused static function

22 years agoSF 560736. Optimize list iteration by filling the tp_iter slot.
Raymond Hettinger [Fri, 31 May 2002 21:40:38 +0000 (21:40 +0000)]
SF 560736.  Optimize list iteration by filling the tp_iter slot.

22 years agoSF bug 533625 (Armin Rigo). rexec: potential security hole
Guido van Rossum [Fri, 31 May 2002 21:12:53 +0000 (21:12 +0000)]
SF bug 533625 (Armin Rigo). rexec: potential security hole

If a rexec instance allows writing in the current directory (a common
thing to do), there's a way to execute bogus bytecode.  Fix this by
not allowing imports from .pyc files (in a way that allows a site to
configure things so that .pyc files *are* allowed, if writing is not
allowed).

I'll apply this to 2.2 and 2.1 too.

22 years agoExplain that tp_basicsize must provide alignment for the items.
Guido van Rossum [Fri, 31 May 2002 21:00:18 +0000 (21:00 +0000)]
Explain that tp_basicsize must provide alignment for the items.

22 years agoUse string methods, remove import string
Neal Norwitz [Fri, 31 May 2002 20:51:31 +0000 (20:51 +0000)]
Use string methods, remove import string

22 years agoUse more string methods, remove import string
Neal Norwitz [Fri, 31 May 2002 20:46:39 +0000 (20:46 +0000)]
Use more string methods, remove import string

22 years agoFix typo
Neal Norwitz [Fri, 31 May 2002 20:23:33 +0000 (20:23 +0000)]
Fix typo

22 years agoImplement the intention of SF patch 472523 (but coded differently).
Guido van Rossum [Fri, 31 May 2002 20:03:54 +0000 (20:03 +0000)]
Implement the intention of SF patch 472523 (but coded differently).

In the past, an object's tp_compare could return any value.  In 2.2
the docs were tightened to require it to return -1, 0 or 1; and -1 for
an error.

We now issue a warning if the value is not in this range.  When an
exception is raised, we allow -1 or -2 as return value, since -2 will
the recommended return value for errors in the future.  (Eventually
tp_compare will also be allowed to return +2, to indicate
NotImplemented; but that can only be implemented once we know all
extensions return a value in [-2...1].  Or perhaps it will require the
type to set a flag bit.)

I haven't decided yet whether to backport this to 2.2.x.  The patch
applies fine.  But is it fair to start warning in 2.2.2 about code
that worked flawlessly in 2.2.1?

22 years agoChange name from string to basestring
Neal Norwitz [Fri, 31 May 2002 19:58:02 +0000 (19:58 +0000)]
Change name from string to basestring

22 years agoUpdate links and information on PyQt/PyKDE.
Fred Drake [Fri, 31 May 2002 18:21:56 +0000 (18:21 +0000)]
Update links and information on PyQt/PyKDE.

22 years agoReplace '== None' with 'is None'
Raymond Hettinger [Fri, 31 May 2002 17:49:10 +0000 (17:49 +0000)]
Replace '==  None' with 'is None'

22 years agoAdd definition of Py_IgnoreEnvironmentFlag (needed at least in debug
Guido van Rossum [Fri, 31 May 2002 14:32:07 +0000 (14:32 +0000)]
Add definition of Py_IgnoreEnvironmentFlag (needed at least in debug
mode).

22 years agoFix printing plural (s or "").
Neal Norwitz [Fri, 31 May 2002 14:15:11 +0000 (14:15 +0000)]
Fix printing plural (s or "").

22 years agoRemove import of re, it is not used
Neal Norwitz [Fri, 31 May 2002 14:14:06 +0000 (14:14 +0000)]
Remove import of re, it is not used

22 years agoUse string methods where possible, and remove import string
Neal Norwitz [Fri, 31 May 2002 14:13:04 +0000 (14:13 +0000)]
Use string methods where possible, and remove import string

22 years agoFix SF bug [ 561825 ] Confusing error for "del f()"
Jeremy Hylton [Fri, 31 May 2002 14:08:29 +0000 (14:08 +0000)]
Fix SF bug [ 561825 ] Confusing error for "del f()"

In the error message, say del for del and assign for everything else.

22 years agoPy_IgnoreEnvironmentFlag should be extern, since it is declared in pythonrun.c
Neal Norwitz [Fri, 31 May 2002 13:11:40 +0000 (13:11 +0000)]
Py_IgnoreEnvironmentFlag should be extern, since it is declared in pythonrun.c

22 years agoRemove unneeded import
Andrew M. Kuchling [Thu, 30 May 2002 19:15:16 +0000 (19:15 +0000)]
Remove unneeded import

22 years agoimp_load_module(): correct and comment the sense of the test for '+'
Guido van Rossum [Thu, 30 May 2002 17:33:07 +0000 (17:33 +0000)]
imp_load_module(): correct and comment the sense of the test for '+'
in the mode (it's forbidden).

22 years agoCover a few corners in the 'U' mode integration to make imp work.
Jeremy Hylton [Thu, 30 May 2002 17:15:25 +0000 (17:15 +0000)]
Cover a few corners in the 'U' mode integration to make imp work.

get_file() must convert 'U' to "r" PY_STDIOTEXTMODE before calling
fopen().

imp_load_module() must accept 'r' or 'U' or something with '+'.

Also reflow some long lines.

22 years agoVerify that the imp can find and load .py files.
Jeremy Hylton [Thu, 30 May 2002 17:10:20 +0000 (17:10 +0000)]
Verify that the imp can find and load .py files.

22 years agoTypo fixes.
Fred Drake [Thu, 30 May 2002 16:41:14 +0000 (16:41 +0000)]
Typo fixes.

22 years agoAdd the pymemcompat.h header as discussed on python-dev.
Michael W. Hudson [Thu, 30 May 2002 16:22:29 +0000 (16:22 +0000)]
Add the pymemcompat.h header as discussed on python-dev.

Now we just need to make sure people know about it...

22 years agoHolger Krekel.
Guido van Rossum [Thu, 30 May 2002 15:42:58 +0000 (15:42 +0000)]
Holger Krekel.