]> granicus.if.org Git - python/log
python
23 years agoAdd correction from /F about SRE
Andrew M. Kuchling [Mon, 22 Oct 2001 14:11:06 +0000 (14:11 +0000)]
Add correction from /F about SRE
\filename{} should be \file{}

23 years agosre.split should return the last segment, even if empty
Fredrik Lundh [Mon, 22 Oct 2001 06:01:56 +0000 (06:01 +0000)]
sre.split should return the last segment, even if empty
(sorry, barry)

23 years agoMake the error message for unsupported operand types cleaner, in
Guido van Rossum [Mon, 22 Oct 2001 04:12:44 +0000 (04:12 +0000)]
Make the error message for unsupported operand types cleaner, in
response to a message by Laura Creighton on c.l.py.  E.g.

    >>> 0+''
    TypeError: unsupported operand types for +: 'int' and 'str'

(previously this did not mention the operand types)

    >>> ''+0
    TypeError: cannot concatenate 'str' and 'int' objects

23 years agoPartly fill out the PEP 252 section
Andrew M. Kuchling [Mon, 22 Oct 2001 02:03:40 +0000 (02:03 +0000)]
Partly fill out the PEP 252 section

23 years agoA bunch of minor rewordings
Andrew M. Kuchling [Mon, 22 Oct 2001 02:00:11 +0000 (02:00 +0000)]
A bunch of minor rewordings

23 years agoFix for SF bug #472940: can't getattr() attribute shown by dir()
Guido van Rossum [Mon, 22 Oct 2001 02:00:09 +0000 (02:00 +0000)]
Fix for SF bug #472940: can't getattr() attribute shown by dir()

There really isn't a good reason for instance method objects to have
their own __dict__, __doc__ and __name__ properties that just delegate
the request to the function (callable); the default attribute behavior
already does this.

The test suite had to be fixed because the error changes from
TypeError to AttributeError.

23 years agoFix some typos
Andrew M. Kuchling [Mon, 22 Oct 2001 01:47:26 +0000 (01:47 +0000)]
Fix some typos

23 years agoMethods of built-in types now properly check for keyword arguments
Guido van Rossum [Mon, 22 Oct 2001 00:43:43 +0000 (00:43 +0000)]
Methods of built-in types now properly check for keyword arguments
(formerly these were silently ignored).  The only built-in methods
that take keyword arguments are __call__, __init__ and __new__.

23 years agoMake tabnanny happy. (Piers, please run the test suite before
Guido van Rossum [Mon, 22 Oct 2001 00:42:26 +0000 (00:42 +0000)]
Make tabnanny happy.  (Piers, please run the test suite before
checking in changes.  The test suite requires consistent use of spaces
and tabs.)

23 years agoupdate version number
Piers Lauder [Sun, 21 Oct 2001 22:37:28 +0000 (22:37 +0000)]
update version number

23 years agoinstall on HP-UX does not support the -d option. Using the install-sh instead.
Neil Schemenauer [Sun, 21 Oct 2001 22:32:04 +0000 (22:32 +0000)]
install on HP-UX does not support the -d option.  Using the install-sh instead.
This fixes SF bug: [ #473491 ] "install -d" doesn't work on HP-UX.

23 years agoAdd missing "static" declarations (found by "make smelly").
Neil Schemenauer [Sun, 21 Oct 2001 22:28:58 +0000 (22:28 +0000)]
Add missing "static" declarations (found by "make smelly").

23 years agoAdding missing "static" declarations (found by "make smelly").
Neil Schemenauer [Sun, 21 Oct 2001 22:26:43 +0000 (22:26 +0000)]
Adding missing "static" declarations (found by "make smelly").

23 years ago- Build dbm module using libdb1 if it's available. This fixes SF bug "[
Neil Schemenauer [Sun, 21 Oct 2001 22:14:44 +0000 (22:14 +0000)]
- Build dbm module using libdb1 if it's available.  This fixes SF bug "[
  #230075 ] dbmmodule build fails on Debian GNU/Linux unstable (Sid)".

- Build bsddb module with libdb3 if it's available.  It also fixes a bug that
  causes the build of bsddb to fail on Debian if bsddb3-dev is installed.

23 years agofixed character set description in docstring (SRE uses Python
Fredrik Lundh [Sun, 21 Oct 2001 21:48:30 +0000 (21:48 +0000)]
fixed character set description in docstring (SRE uses Python
strings, not C strings)

removed USE_PYTHON defines, and related sre.py helpers

skip calling the subx helper if the template is callable.
interestingly enough, this means that

def callback(m):
    return literal
result = pattern.sub(callback, string)

is much faster than

result = pattern.sub(literal, string)

23 years agofix send method not noticing when partial sends happen
Piers Lauder [Sun, 21 Oct 2001 20:26:37 +0000 (20:26 +0000)]
fix send method not noticing when partial sends happen

23 years agosre.Scanner fixes (from Greg Chapman). also added a Scanner sanity
Fredrik Lundh [Sun, 21 Oct 2001 18:04:11 +0000 (18:04 +0000)]
sre.Scanner fixes (from Greg Chapman).  also added a Scanner sanity
check to the test suite.

added a few missing exception checks in the _sre module

23 years agorewrote the pattern.sub and pattern.subn methods in C
Fredrik Lundh [Sun, 21 Oct 2001 16:47:57 +0000 (16:47 +0000)]
rewrote the pattern.sub and pattern.subn methods in C

removed (conceptually flawed) getliteral helper; the new sub/subn code
uses a faster code path for literal replacement strings, but doesn't
(yet) look for literal patterns.

added STATE_OFFSET macro, and use it to convert state.start/ptr to
char indexes

23 years agoChange clear_handlers argument to indicate whether this is an initialization.
Martin v. Löwis [Sun, 21 Oct 2001 08:53:52 +0000 (08:53 +0000)]
Change clear_handlers argument to indicate whether this is an initialization.
Do not set the Expat handlers if it is. Fixes PyXML bug #473195.

23 years agoBig internal change that should have no external effects: unify the
Guido van Rossum [Sun, 21 Oct 2001 00:44:31 +0000 (00:44 +0000)]
Big internal change that should have no external effects: unify the
'slotdef' structure typedef and 'struct wrapperbase'.  By adding the
wrapper docstrings to the slotdef structure, the slotdefs array can
serve as the data structure that drives add_operators(); the wrapper
descriptor contains a pointer to slotdef structure.  This replaces
lots of custom code from add_operators() by a loop over the slotdefs
array, and does away with all the tab_xxx tables.

23 years agorewrote the pattern.split method in C
Fredrik Lundh [Sat, 20 Oct 2001 17:48:46 +0000 (17:48 +0000)]
rewrote the pattern.split method in C

also restored SRE Unicode support for 1.6/2.0/2.1

23 years agoUpdate description of border()
Andrew M. Kuchling [Sat, 20 Oct 2001 16:07:41 +0000 (16:07 +0000)]
Update description of border()

23 years agoAdd two forgotten 'break' statements
Andrew M. Kuchling [Sat, 20 Oct 2001 16:05:52 +0000 (16:05 +0000)]
Add two forgotten 'break' statements
Allow passing strings to the .border() method
Correct some error messages ("1 or 4" -> "1 to 4")
Bump version number
Tweak code formatting
Update my e-mail address

23 years agoPatch from SF bug #472956: UMR when there is a syntax error (Neal Norwitz)
Guido van Rossum [Sat, 20 Oct 2001 14:27:56 +0000 (14:27 +0000)]
Patch from SF bug #472956: UMR when there is a syntax error (Neal Norwitz)

    perrdetail.token is unitialized when there is a syntax
    error in a file.

23 years agoPatch from SF bug #473150: configure weaknesses on HP-UX (Michael Piotrowski)
Guido van Rossum [Sat, 20 Oct 2001 14:21:45 +0000 (14:21 +0000)]
Patch from SF bug #473150: configure weaknesses on HP-UX (Michael Piotrowski)

    1. configure doesn't handle HP-UX release numbers
    (e.g., B.11.00), resulting in MACHDEP = "hpuxB".

    2. After checking for wchar.h, configure doesn't
    include it when checking the size of wchar_t.

    (Python 2.2b1 on HP-UX 11.00)

23 years agoUse the \note and \warning macros where appropriate.
Fred Drake [Sat, 20 Oct 2001 04:24:09 +0000 (04:24 +0000)]
Use the \note and \warning macros where appropriate.

23 years agoDescribe the content given as the parameter to the \note and \warning macros
Fred Drake [Sat, 20 Oct 2001 04:18:14 +0000 (04:18 +0000)]
Describe the content given as the parameter to the \note and \warning macros
in more detail, and use them where appropriate.

23 years agoAdditional rules to support the iSilo conversion.
Fred Drake [Fri, 19 Oct 2001 21:12:57 +0000 (21:12 +0000)]
Additional rules to support the iSilo conversion.

23 years agoHush up CVS.
Fred Drake [Fri, 19 Oct 2001 21:09:19 +0000 (21:09 +0000)]
Hush up CVS.

23 years agoSupport for the iSilo conversion.
Fred Drake [Fri, 19 Oct 2001 21:08:36 +0000 (21:08 +0000)]
Support for the iSilo conversion.

23 years agoThe usual post-release fiddling.
Tim Peters [Fri, 19 Oct 2001 17:55:30 +0000 (17:55 +0000)]
The usual post-release fiddling.

23 years agoWhen stating that some parameters to makefile() are similar to the open()
Fred Drake [Fri, 19 Oct 2001 17:22:29 +0000 (17:22 +0000)]
When stating that some parameters to makefile() are similar to the open()
parameters, given a hyperlink to the right part of the documentation to
make it easier to look those up.  Also, refer to the file() function/
constructor instead of open() now that that is where the actual docs for
those parameters live.
This closes SF bug #472004.

23 years agoUpdated version numbers for post 2.2b1 development.
Barry Warsaw [Fri, 19 Oct 2001 17:11:58 +0000 (17:11 +0000)]
Updated version numbers for post 2.2b1 development.

23 years agoadded tests for long ints and ints where they are > 32 bits.
Skip Montanaro [Fri, 19 Oct 2001 16:06:52 +0000 (16:06 +0000)]
added tests for long ints and ints where they are > 32 bits.
should have been checked in as part of patch #470254.

23 years agoFix for Bug #216405:
Thomas Heller [Fri, 19 Oct 2001 13:49:35 +0000 (13:49 +0000)]
Fix for Bug #216405:
use the correct base for a buffer object in _PyBuffer_FromObject.

23 years ago(Hopefully) fix SF bug #472675: CVS socketmodule now doesn't compile
Guido van Rossum [Fri, 19 Oct 2001 12:40:40 +0000 (12:40 +0000)]
(Hopefully) fix SF bug #472675: CVS socketmodule now doesn't compile

This appears to be a case of a missing \n\ in a multiline string
literal.

23 years agoAdditional test and documentation for the unicode() changes.
Marc-André Lemburg [Fri, 19 Oct 2001 12:02:29 +0000 (12:02 +0000)]
Additional test and documentation for the unicode() changes.

This patch should also be applied to the 2.2b1 trunk.

23 years agoLast minute updates for changes since 2.2a4. Unless Fred wants to add
Barry Warsaw [Fri, 19 Oct 2001 05:35:40 +0000 (05:35 +0000)]
Last minute updates for changes since 2.2a4.  Unless Fred wants to add
anything about the hotshot profiler, this file is ready for the 2.2b1
Windows build.

23 years agoAdded a note about the somewhat kludgey behavior of the message
Barry Warsaw [Fri, 19 Oct 2001 04:34:42 +0000 (04:34 +0000)]
Added a note about the somewhat kludgey behavior of the message
epilogue, based on the discussion in this SF bug report:

https://sourceforge.net/tracker/index.php?func=detail&aid=472481&group_id=25568&atid=384678

23 years agoAnother merge from mimelib:
Barry Warsaw [Fri, 19 Oct 2001 04:08:59 +0000 (04:08 +0000)]
Another merge from mimelib:

    TestMIMEMessage.test_epilogue(), TestIdempotent.test_preamble_epilogue():
    Test cases for SF bug #472481.

23 years agoAnother email package test file
Barry Warsaw [Fri, 19 Oct 2001 04:07:27 +0000 (04:07 +0000)]
Another email package test file

23 years agoAnother merge from mimelib:
Barry Warsaw [Fri, 19 Oct 2001 04:06:39 +0000 (04:06 +0000)]
Another merge from mimelib:

    _handle_multipart(): If there is an epilogue and the epilogue does
    not itself start with a newline, add a newline before writing the
    epilogue.  Closes SF bug #472481.

23 years agoAdd entry for RAND_xxx() functions in socket module.
Jeremy Hylton [Fri, 19 Oct 2001 03:40:19 +0000 (03:40 +0000)]
Add entry for RAND_xxx() functions in socket module.

23 years agoNote the Unicode changes from SF patch #470578.
Guido van Rossum [Fri, 19 Oct 2001 02:05:35 +0000 (02:05 +0000)]
Note the Unicode changes from SF patch #470578.

23 years agoSF patch #470578: Fixes to synchronize unicode() and str()
Guido van Rossum [Fri, 19 Oct 2001 02:01:31 +0000 (02:01 +0000)]
SF patch #470578: Fixes to synchronize unicode() and str()

    This patch implements what we have discussed on python-dev late in
    September: str(obj) and unicode(obj) should behave similar, while
    the old behaviour is retained for unicode(obj, encoding, errors).

    The patch also adds a new feature with which objects can provide
    unicode(obj) with input data: the __unicode__ method. Currently no
    new tp_unicode slot is implemented; this is left as option for the
    future.

    Note that PyUnicode_FromEncodedObject() no longer accepts Unicode
    objects as input. The API name already suggests that Unicode
    objects do not belong in the list of acceptable objects and the
    functionality was only needed because
    PyUnicode_FromEncodedObject() was being used directly by
    unicode(). The latter was changed in the discussed way:

    * unicode(obj) calls PyObject_Unicode()
    * unicode(obj, encoding, errors) calls PyUnicode_FromEncodedObject()

    One thing left open to discussion is whether to leave the
    PyUnicode_FromObject() API as a thin API extension on top of
    PyUnicode_FromEncodedObject() or to turn it into a (macro) alias
    for PyObject_Unicode() and deprecate it. Doing so would have some
    surprising consequences though, e.g.  u"abc" + 123 would turn out
    as u"abc123"...

[Marc-Andre didn't have time to check this in before the deadline.  I
hope this is OK, Marc-Andre!  You can still make changes and commit
them on the trunk after the branch has been made, but then please mail
Barry a context diff if you want the change to be merged into the
2.2b1 release branch.  GvR]

23 years agoAnother.
Guido van Rossum [Fri, 19 Oct 2001 01:51:11 +0000 (01:51 +0000)]
Another.

23 years agoSF patch #470393 (Jim Ahlstrom): Add missing marshal function
Guido van Rossum [Fri, 19 Oct 2001 01:46:21 +0000 (01:46 +0000)]
SF patch #470393 (Jim Ahlstrom): Add missing marshal function

    In Include/, marshal.h declares both
    PyMarshal_ReadLongFromFile()
    and PyMarshal_ReadShortFromFile(),
    but the second is missing from marshal.c.

[Shouldn't the return type be declared as 'short' instead of 'int'?
But 'int' is what was in marshal.h all those years...  --Guido]

23 years agoSF patch #460805 by Chris Gonnerman: Support for unsetenv()
Guido van Rossum [Fri, 19 Oct 2001 01:31:59 +0000 (01:31 +0000)]
SF patch #460805 by Chris Gonnerman: Support for unsetenv()

This adds unsetenv to posix, and uses it in the __delitem__ method of
os.environ.

(XXX Should we change the preferred name for putenv to setenv, for
consistency?)

23 years agoSF patch #443759: Add Interface to readline's add_history
Guido van Rossum [Fri, 19 Oct 2001 01:18:43 +0000 (01:18 +0000)]
SF patch #443759: Add Interface to readline's add_history

This was submitted by Moshe, but apparently he's too busy to check it
in himself.  He wrote:

    Here is a function in GNU readline called add_history,
    which is used to manage the history list. Though Python
    uses this function internally, it does not expose it to
    the Python programmer. This patch adds direct interface
    to this function with documentation.

    This could be used by friendly modules to "seed" the
    history with commands.

23 years agoAssume a 64-bit start and len if O_LARGEFILE is available.
Martin v. Löwis [Thu, 18 Oct 2001 22:07:48 +0000 (22:07 +0000)]
Assume a 64-bit start and len if O_LARGEFILE is available.

23 years agoExpose O_LARGEFILE, O_DIRECT, O_DIRECTORY, and O_NOFOLLOW.
Martin v. Löwis [Thu, 18 Oct 2001 22:05:36 +0000 (22:05 +0000)]
Expose O_LARGEFILE, O_DIRECT, O_DIRECTORY, and O_NOFOLLOW.

23 years agoWhitespace normalization.
Tim Peters [Thu, 18 Oct 2001 21:57:37 +0000 (21:57 +0000)]
Whitespace normalization.

23 years agoMove dlfcn.h block out of NetBSD block, assuming that NetBSD before
Martin v. Löwis [Thu, 18 Oct 2001 21:24:04 +0000 (21:24 +0000)]
Move dlfcn.h block out of NetBSD block, assuming that NetBSD before
199712 didn't have dlfcn.h, or that it wouldn't conflict with the other
stuff defined.

23 years agoThe assignment to result.st_rdev can raise AttributeError as well as
Guido van Rossum [Thu, 18 Oct 2001 21:19:31 +0000 (21:19 +0000)]
The assignment to result.st_rdev can raise AttributeError as well as
TypeError (on systems where it's not defined at all, it raises
AttributeError; when it's defined, assignment to it raises TypeError).

23 years agochanged misleading argument name
Fredrik Lundh [Thu, 18 Oct 2001 20:58:25 +0000 (20:58 +0000)]
changed misleading argument name

23 years agoDon't leave bare newlines in long strings -- VC doesn't like that.
Guido van Rossum [Thu, 18 Oct 2001 20:53:15 +0000 (20:53 +0000)]
Don't leave bare newlines in long strings -- VC doesn't like that.

23 years agoadd structseq.c to project
Guido van Rossum [Thu, 18 Oct 2001 20:51:32 +0000 (20:51 +0000)]
add structseq.c to project

23 years agoSF Patch (but with no patch) 472555 Remove trailing common in enumeration.
Tim Peters [Thu, 18 Oct 2001 20:49:35 +0000 (20:49 +0000)]
SF Patch (but with no patch) 472555 Remove trailing common in enumeration.
Some AIX compiler didn't like the trailing comma at the end of the
why_code enum decl.

23 years agoMissing file structseq.c for SF patch #462296
Guido van Rossum [Thu, 18 Oct 2001 20:47:51 +0000 (20:47 +0000)]
Missing file structseq.c for SF patch  #462296

23 years agoSF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
Guido van Rossum [Thu, 18 Oct 2001 20:34:25 +0000 (20:34 +0000)]
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.

This is a big one, touching lots of files.  Some of the platforms
aren't tested yet.  Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences.  When accessed as a sequence, they behave exactly as
before.  But they also have attributes like st_mtime or tm_year.  The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there).  If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.

(Still missing is a documentation update.)

23 years agoSF bug [#472347] pydoc and properties.
Tim Peters [Thu, 18 Oct 2001 19:56:17 +0000 (19:56 +0000)]
SF bug [#472347] pydoc and properties.
The GUI-mode code to display properties blew up if the property functions
(get, set, etc) weren't simply methods (or functions).

"The problem" here is really that the generic document() method dispatches
to one of .doc{routine, class, module, other}(), but all of those require
a different(!) number of arguments.  Thus document isn't general-purpose
at all:  you have to know exactly what kind of thing is it you're going
to document first, in order to pass the correct number of arguments to
.document for it to pass on.  As an expedient hack, just tacked "*ignored"
on to the end of the formal argument lists for the .docXXX routines so
that .document's caller doesn't have to know in advance which path
.document is going to take.

23 years agoShut up warnings for setgroups() on Linux -- you have to #include
Guido van Rossum [Thu, 18 Oct 2001 19:44:10 +0000 (19:44 +0000)]
Shut up warnings for setgroups() on Linux -- you have to #include
<grp.h> it seems.  This requires yet another configure test.

23 years agoSome minor clarifications for find()'s arguments based on SF bug
Barry Warsaw [Thu, 18 Oct 2001 19:41:48 +0000 (19:41 +0000)]
Some minor clarifications for find()'s arguments based on SF bug
#463572.  Closing.

23 years agoDo not expect line number events when running under "python -O".
Fred Drake [Thu, 18 Oct 2001 19:34:00 +0000 (19:34 +0000)]
Do not expect line number events when running under "python -O".
The right fix is to generate line number events anyway ;-), but this will
have to do for now.

23 years agoSRE bug #441409:
Fredrik Lundh [Thu, 18 Oct 2001 19:30:16 +0000 (19:30 +0000)]
SRE bug #441409:
    compile should raise error for non-strings
SRE bug #432570, 448951:
    reset group after failed match

also bumped version number to 2.2.0

23 years agoAdd a test for calling a weakref proxy with a dictionary of keyword args.
Fred Drake [Thu, 18 Oct 2001 19:28:29 +0000 (19:28 +0000)]
Add a test for calling a weakref proxy with a dictionary of keyword args.

23 years agoRemove an unnecessary check for NULL.
Fred Drake [Thu, 18 Oct 2001 19:21:46 +0000 (19:21 +0000)]
Remove an unnecessary check for NULL.

23 years agoNote stricter tp_compare return value requirements.
Guido van Rossum [Thu, 18 Oct 2001 19:20:25 +0000 (19:20 +0000)]
Note stricter tp_compare return value requirements.

23 years agoPart 2/2 of SF patch #416704: More robust freeze, by Toby Dickenson.
Guido van Rossum [Thu, 18 Oct 2001 19:15:32 +0000 (19:15 +0000)]
Part 2/2 of SF patch #416704: More robust freeze, by Toby Dickenson.

(With slight cosmetic improvements to shorten lines and a grammar fix
to a docstring.)

This addes -X and -E options to freeze.  From the docstring:

-X module     Like -x, except the module can never be imported by
              the frozen binary.

-E:           Freeze will fail if any modules can't be found (that
              were not excluded using -x or -X).

23 years agoStraighten out the exec*() function descriptions a bit, and clarify a few
Fred Drake [Thu, 18 Oct 2001 18:58:30 +0000 (18:58 +0000)]
Straighten out the exec*() function descriptions a bit, and clarify a few
points in the spawn*() description.

23 years agoSquash compiler wng about signed/unsigned mismatch.
Tim Peters [Thu, 18 Oct 2001 18:57:31 +0000 (18:57 +0000)]
Squash compiler wng about signed/unsigned mismatch.

23 years agoFirst part of SF patch #416704: More robust freeze, by Toby Dickenson.
Guido van Rossum [Thu, 18 Oct 2001 18:54:11 +0000 (18:54 +0000)]
First part of SF patch #416704: More robust freeze, by Toby Dickenson.
This fixes the behavior reported by SF bug #404545, where a file
x.y.py could be imported by the statement "import x.y" when there's a
frozen package x (I believe even if x.y also exists as a frozen
module).

23 years agoFix the frozen bytecode for __hello__ (betcha didn't know that existed
Guido van Rossum [Thu, 18 Oct 2001 18:49:37 +0000 (18:49 +0000)]
Fix the frozen bytecode for __hello__ (betcha didn't know that existed
:-).

Add a test that prevents the __hello__ bytecode from going stale
unnoticed again.

The test also tests the loophole noted in SF bug #404545.  This test
will fail right now; I'll check in the fix in a minute.

23 years agoBump version number.
Fred Drake [Thu, 18 Oct 2001 18:46:22 +0000 (18:46 +0000)]
Bump version number.
Remove inconsistent use of HTMLDIR.

23 years agoBump release information.
Fred Drake [Thu, 18 Oct 2001 18:41:12 +0000 (18:41 +0000)]
Bump release information.

23 years agoAdd a note about changes related to the weak reference objects.
Fred Drake [Thu, 18 Oct 2001 18:18:06 +0000 (18:18 +0000)]
Add a note about changes related to the weak reference objects.

23 years agoMake sure we do not core dump when using proxies with the binary slot
Fred Drake [Thu, 18 Oct 2001 18:06:05 +0000 (18:06 +0000)]
Make sure we do not core dump when using proxies with the binary slot
handlers.  This was fixed in Objects/weakrefobject.c 1.2.

23 years agoWhen weakref proxies are involved in binary & ternary slot operations,
Fred Drake [Thu, 18 Oct 2001 18:04:18 +0000 (18:04 +0000)]
When weakref proxies are involved in binary & ternary slot operations,
the left-hand operand may not be the proxy in all cases.  If it isn't,
we end up doing two things: a) unwrapping something that isn't a
PyWeakReference (later resulting in a core dump) and b) passing a
proxy as the right-hand operand anyway, even though that can't be
handled by the actual handler (maybe eventually causing a core dump).

This is fixed by always unwrapping all the proxies involved before
passing anything to the actual handler.

23 years agoSF bug #471720: ThreadingMixIn/TCPServer forgets close
Guido van Rossum [Thu, 18 Oct 2001 18:02:07 +0000 (18:02 +0000)]
SF bug #471720: ThreadingMixIn/TCPServer forgets close

Solved with a helper method that calls finish_request() and then
close_request().  The code is by Max Neunhöffer.

23 years agoReindent __repr__.
Martin v. Löwis [Thu, 18 Oct 2001 17:33:19 +0000 (17:33 +0000)]
Reindent __repr__.

23 years agoAdd test for local assigned to only in a nested list comp
Jeremy Hylton [Thu, 18 Oct 2001 16:23:11 +0000 (16:23 +0000)]
Add test for local assigned to only in a nested list comp

23 years agoFix for SF bug [ #471928 ] global made w/nested list comprehensions
Jeremy Hylton [Thu, 18 Oct 2001 16:15:10 +0000 (16:15 +0000)]
Fix for SF bug [ #471928 ] global made w/nested list comprehensions

The symbol table pass didn't have an explicit case for the list_iter
node which is used only for a nested list comprehension.  As a result,
the target of the list comprehension was treated as a use instead of
an assignment.  Fix is to add a case to symtable_node() to handle
list_iter.

Also, rework and document a couple of the subtler implementation
issues in the symbol table pass.  The symtable_node() switch statement
depends on falling through the last several cases, in order to handle
some of the more complicated nodes like atom.  Add a comment
explaining the behavior before the first fall through case.  Add a
comment /* fall through */ at the end of case so that it is explicitly
marked as such.

Move the for_stmt case out of the fall through logic, which simplifies
both for_stmt and default.  (The default used the local variable start
to skip the first three nodes of a for_stmt when it fell through.)

Rename the flag argument to symtable_assign() to def_flag and add a
comment explaining its use:

   The third argument to symatble_assign() is a flag to be passed to
   symtable_add_def() if it is eventually called.  The flag is useful
   to specify the particular type of assignment that should be
   recorded, e.g. an assignment caused by import.

23 years agoFix SF bug #472234: type(obj) calls type->tp_init (Roeland Rengelink)
Guido van Rossum [Thu, 18 Oct 2001 15:49:21 +0000 (15:49 +0000)]
Fix SF bug #472234: type(obj) calls type->tp_init (Roeland Rengelink)

The fix is a band-aid: type_call() now makes the same exception for a
single-argument call to type() as type_new() was already making.

23 years agoUse CXX in LINKCC if CXX is used to build main() and the system requires
Martin v. Löwis [Thu, 18 Oct 2001 15:35:38 +0000 (15:35 +0000)]
Use CXX in LINKCC if CXX is used to build main() and the system requires
to link a C++ main using the C++ compiler. Fixes #472007.

23 years agoFix typo reported by Michael Soulier.
Fred Drake [Thu, 18 Oct 2001 15:22:23 +0000 (15:22 +0000)]
Fix typo reported by Michael Soulier.

23 years agoBump Windows build # for 2.2b1.
Tim Peters [Thu, 18 Oct 2001 15:19:38 +0000 (15:19 +0000)]
Bump Windows build # for 2.2b1.

23 years agoFunction descriptions must end as well as start!
Fred Drake [Thu, 18 Oct 2001 14:26:08 +0000 (14:26 +0000)]
Function descriptions must end as well as start!

23 years agoElaborate on types and meaning of the setgroups arguments.
Martin v. Löwis [Thu, 18 Oct 2001 14:07:12 +0000 (14:07 +0000)]
Elaborate on types and meaning of the setgroups arguments.

23 years agoPatch to bug #472202: Correctly recognize NetBSD before 199712.
Martin v. Löwis [Thu, 18 Oct 2001 11:45:19 +0000 (11:45 +0000)]
Patch to bug #472202: Correctly recognize NetBSD before 199712.

23 years agoPatch #470744: Simplify __repr__ error handling.
Martin v. Löwis [Thu, 18 Oct 2001 11:39:34 +0000 (11:39 +0000)]
Patch #470744: Simplify __repr__ error handling.

23 years agoExpose setgroups. Fixes feature request #468116.
Martin v. Löwis [Thu, 18 Oct 2001 04:06:00 +0000 (04:06 +0000)]
Expose setgroups. Fixes feature request #468116.

23 years agoFix error checking done by abstract_issubclass and abstract_isinstance.
Neil Schemenauer [Thu, 18 Oct 2001 03:18:43 +0000 (03:18 +0000)]
Fix error checking done by abstract_issubclass and abstract_isinstance.
isinstance() now allows any object as the first argument and a class, a
type or something with a __bases__ tuple attribute for the second
argument.  This closes SF patch #464992.

23 years agoAdd trivial test cases for RAND_add() and RAND_status().
Jeremy Hylton [Thu, 18 Oct 2001 00:30:14 +0000 (00:30 +0000)]
Add trivial test cases for RAND_add() and RAND_status().

(The rest of the test cases are trivial, so I don't feel too bad.)

23 years agoExpose three OpenSSL API calls for dealing with the PRNG.
Jeremy Hylton [Thu, 18 Oct 2001 00:28:50 +0000 (00:28 +0000)]
Expose three OpenSSL API calls for dealing with the PRNG.

Quoth the OpenSSL RAND_add man page:

    OpenSSL makes sure that the PRNG state is unique for each
    thread. On systems that provide /dev/urandom, the
    randomness device is used to seed the PRNG transparently.
    However, on all other systems, the application is
    responsible for seeding the PRNG by calling RAND_add(),
    RAND_egd(3) or RAND_load_file(3).

I decided to expose RAND_add() because it's general and RAND_egd()
because it's a useful special case.  RAND_load_file() didn't seem to
offer much over RAND_add(), so I skipped it.  Also supplied
RAND_status() which returns true if the PRNG is seeded and false if
not.

23 years agotest for int and long int overflow (allows operation on 64-bit platforms)
Skip Montanaro [Wed, 17 Oct 2001 22:53:33 +0000 (22:53 +0000)]
test for int and long int overflow (allows operation on 64-bit platforms)
closes patch 470254

23 years agoTwo merges from the mimelib project:
Barry Warsaw [Wed, 17 Oct 2001 20:52:26 +0000 (20:52 +0000)]
Two merges from the mimelib project:

    test_no_semis_header_splitter(): This actually should still split.

    test_no_split_long_header(): An example of an unsplittable line.

    test_no_semis_header_splitter(): Test for SF bug # 471918, Generator
    splitting long headers.

23 years agoTwo merges from the mimelib project:
Barry Warsaw [Wed, 17 Oct 2001 20:51:42 +0000 (20:51 +0000)]
Two merges from the mimelib project:

    _split_header(): Split on folding whitespace if the attempt to split
    on semi-colons failed.

    _split_header(): Patch by Matthew Cowles for fixing SF bug # 471918,
    Generator splitting long headers.

23 years agoProtect references to tp_descr_get and tp_dict with the appropriate test:
Guido van Rossum [Wed, 17 Oct 2001 20:26:38 +0000 (20:26 +0000)]
Protect references to tp_descr_get and tp_dict with the appropriate test:
PyType_HasFeature(t, Py_TPFLAGS_HAVE_CLASS).

23 years agoOops. Catching OverflowError from int() doesn't help, since it raises
Guido van Rossum [Wed, 17 Oct 2001 17:21:47 +0000 (17:21 +0000)]
Oops.  Catching OverflowError from int() doesn't help, since it raises
ValueError on too-large inputs.

23 years agoRemove a bunch of stuff that's no longer needed now that update_slot()
Guido van Rossum [Wed, 17 Oct 2001 13:59:09 +0000 (13:59 +0000)]
Remove a bunch of stuff that's no longer needed now that update_slot()
and fixup_slot_dispatchers() always select the proper slot dispatcher.
This affects slot_sq_item(), slot_tp_getattro(), and
slot_tp_getattr_hook().