]> granicus.if.org Git - python/log
python
23 years agoAdded notes to clarify that binascii.crc32(), zlib.crc32(), and
Fred Drake [Mon, 15 Oct 2001 13:45:49 +0000 (13:45 +0000)]
Added notes to clarify that binascii.crc32(), zlib.crc32(), and
zlib.adler32() are not suitable as general hash functions.

23 years agoCheck whether pthreads are available without any options before checking
Martin v. Löwis [Mon, 15 Oct 2001 08:06:29 +0000 (08:06 +0000)]
Check whether pthreads are available without any options before checking
that -Kpthread is supported. Fixes #470781.
Port to autoconf 2.52.

23 years agotest_typed_subpart_iterator_default_type(): Test for when the message
Barry Warsaw [Mon, 15 Oct 2001 04:39:02 +0000 (04:39 +0000)]
test_typed_subpart_iterator_default_type(): Test for when the message
has no Content-Type: header, it should be treated as text/plain.

23 years agotyped_subpart_iterator(): When getting the main type use 'text' as the
Barry Warsaw [Mon, 15 Oct 2001 04:38:22 +0000 (04:38 +0000)]
typed_subpart_iterator(): When getting the main type use 'text' as the
failobj, and when getting the subtype use 'plain' as the failobj.
text/plain is supposed to be the default if the message contains no
Content-Type: header.

23 years agoAdded documentation for the functions listed in marshal.h.
Fred Drake [Sun, 14 Oct 2001 04:45:51 +0000 (04:45 +0000)]
Added documentation for the functions listed in marshal.h.
Prompted by Jim Ahlstrom.  This closes SF patch #470614.

23 years agoAn MSVC makefile to rebuild the grammar files (graminit.[ch]) manually.
Tim Peters [Sat, 13 Oct 2001 20:16:17 +0000 (20:16 +0000)]
An MSVC makefile to rebuild the grammar files (graminit.[ch]) manually.
Ugly, but it works.

23 years agoRedid the slot computation. The initial slot assignments are now done
Guido van Rossum [Sat, 13 Oct 2001 20:02:41 +0000 (20:02 +0000)]
Redid the slot computation.  The initial slot assignments are now done
using the same algorithm as the slot updates.  The slotdefs array is
now sorted by slot offset and has an interned string object corresponding
to the name added to each item.  More can be done but I need to commit
this first as a working intermediate stage.

23 years ago"ib" should be "boundary"; reported by Neal Norwitz.
Fred Drake [Sat, 13 Oct 2001 18:38:53 +0000 (18:38 +0000)]
"ib" should be "boundary"; reported by Neal Norwitz.

23 years agoAdded missing parameter in call to http_error_default();
Fred Drake [Sat, 13 Oct 2001 18:37:07 +0000 (18:37 +0000)]
Added missing parameter in call to http_error_default();
reported by Neal Norwitz.

23 years agoSMTPError should be SMTPException; reported by Neal Norwitz.
Fred Drake [Sat, 13 Oct 2001 18:35:32 +0000 (18:35 +0000)]
SMTPError should be SMTPException; reported by Neal Norwitz.

23 years agoIgnore execfile() return value; reported by Neal Norwitz.
Fred Drake [Sat, 13 Oct 2001 18:34:42 +0000 (18:34 +0000)]
Ignore execfile() return value; reported by Neal Norwitz.

23 years ago"f" should be "self"; reported by Neal Norwitz.
Fred Drake [Sat, 13 Oct 2001 18:33:51 +0000 (18:33 +0000)]
"f" should be "self"; reported by Neal Norwitz.

23 years ago_os should be os; reported by Neal Norwitz.
Fred Drake [Sat, 13 Oct 2001 16:00:52 +0000 (16:00 +0000)]
_os should be os; reported by Neal Norwitz.

23 years agoRemove extra param from call to self.error().
Fred Drake [Sat, 13 Oct 2001 15:59:47 +0000 (15:59 +0000)]
Remove extra param from call to self.error().
Reported by Neal Norwitz.

23 years agoRemove extra "]" in splitlines() docstring.
Fred Drake [Sat, 13 Oct 2001 15:57:55 +0000 (15:57 +0000)]
Remove extra "]" in splitlines() docstring.
Reported by Neal Norwitz.

23 years agoMove grid_location into Misc. Fixes bug #426892.
Martin v. Löwis [Sat, 13 Oct 2001 09:33:51 +0000 (09:33 +0000)]
Move grid_location into Misc. Fixes bug #426892.

23 years agoCheck for term.h and include it on non-ncurses system to get a declaration
Martin v. Löwis [Sat, 13 Oct 2001 09:12:41 +0000 (09:12 +0000)]
Check for term.h and include it on non-ncurses system to get a declaration
for tigetstr.

23 years agoTest for __sun instead of __sun__, since SUNWspro only defines the latter;
Martin v. Löwis [Sat, 13 Oct 2001 09:00:42 +0000 (09:00 +0000)]
Test for __sun instead of __sun__, since SUNWspro only defines the latter;
gcc defines both.

23 years agoCast argument to set_panel_userptr to void*. Fixes bug #417240.
Martin v. Löwis [Sat, 13 Oct 2001 08:50:10 +0000 (08:50 +0000)]
Cast argument to set_panel_userptr to void*. Fixes bug #417240.

23 years agoSpeed the Windows code by using native 64-bit int compiler support instead
Tim Peters [Sat, 13 Oct 2001 07:37:52 +0000 (07:37 +0000)]
Speed the Windows code by using native 64-bit int compiler support instead
of calling external functions.

23 years agoSuppress a bunch of "value computed is not used" warnings when building in
Fred Drake [Sat, 13 Oct 2001 06:11:28 +0000 (06:11 +0000)]
Suppress a bunch of "value computed is not used" warnings when building in
debug mode (--with-pydebug).

23 years agoRemove some unused imports.
Fred Drake [Sat, 13 Oct 2001 03:00:11 +0000 (03:00 +0000)]
Remove some unused imports.
Remove the log file after we are done with it.  This should clean up after
the test even on Windows, since the file is now closed before we attempt
removal.

23 years agoWhen we reach the end of the log file, close the logreader object.
Fred Drake [Sat, 13 Oct 2001 02:55:40 +0000 (02:55 +0000)]
When we reach the end of the log file, close the logreader object.

23 years agoAdded new hotshot pkg to the Windows installer.
Tim Peters [Sat, 13 Oct 2001 00:26:25 +0000 (00:26 +0000)]
Added new hotshot pkg to the Windows installer.
Rearranged the growing number of Lib packages into alphabetical order.

23 years agoYou can't unlink open files on Windows.
Tim Peters [Sat, 13 Oct 2001 00:19:39 +0000 (00:19 +0000)]
You can't unlink open files on Windows.
Simply commented it out, and then test_hotshot passes on Windows.
Leaving to Fred to fix "the right way" (it seems to be a feature of
unittest that all unittests try to unlink open files <wink>).

23 years agoThis compiles on Windows now.
Tim Peters [Sat, 13 Oct 2001 00:14:28 +0000 (00:14 +0000)]
This compiles on Windows now.

23 years agoMy editor can't deal with long backslash-continued strings. Changed 'em.
Tim Peters [Sat, 13 Oct 2001 00:11:10 +0000 (00:11 +0000)]
My editor can't deal with long backslash-continued strings.  Changed 'em.
This still doesn't compile on Windows, but at least I have a shot at
fixing that now.

23 years agoCorrect __repr__: include module name, avoid extra space for empty status,
Martin v. Löwis [Fri, 12 Oct 2001 22:39:20 +0000 (22:39 +0000)]
Correct __repr__: include module name, avoid extra space for empty status,
use 0x format for id. Proposed by Cesar Eduardo Barros in patch #470680.

23 years agoSF patch #467455 : Enhanced environment variables, by Toby Dickenson.
Guido van Rossum [Fri, 12 Oct 2001 22:17:56 +0000 (22:17 +0000)]
SF patch #467455 : Enhanced environment variables, by Toby Dickenson.

   This patch changes to logic to:

   if env.var. set and non-empty:
       if env.var. is an integer:
           set flag to that integer
   if flag is zero: # [actually, <= 0 --GvR]
       set flag to 1

   Under this patch, anyone currently using
   PYTHONVERBOSE=yes will get the same output as before.

   PYTHONVERBNOSE=2 will generate more verbosity than
   before.

   The only unusual case that the following three are
   still all equivalent:
   PYTHONVERBOSE=yespleas
   PYTHONVERBOSE=1
   PYTHONVERBOSE=0

23 years agoGet hotshot closer to compiling on Windows.
Tim Peters [Fri, 12 Oct 2001 22:08:39 +0000 (22:08 +0000)]
Get hotshot closer to compiling on Windows.
Still broken:  GETTIMEOFDAY.  This macro obviously isn't being defined
on Windows, so there's logic errors here I'd rather Fred untangled.

23 years agoJason Lowe
Guido van Rossum [Fri, 12 Oct 2001 21:54:29 +0000 (21:54 +0000)]
Jason Lowe

23 years agoAdd SF patch #468347 -- mask signals for non-main pthreads, by Jason Lowe:
Guido van Rossum [Fri, 12 Oct 2001 21:49:17 +0000 (21:49 +0000)]
Add SF patch #468347 -- mask signals for non-main pthreads, by Jason Lowe:

   This patch updates Python/thread_pthread.h to mask all
   signals for any thread created. This will keep all
   signals masked for any thread that isn't the initial
   thread. For Solaris and Linux, the two platforms I was
   able to test it on, it solves bug #465673 (pthreads
   need signal protection) and probably will solve bug
   #219772 (Interactive InterPreter+ Thread -> core dump
   at exit).

   I'd be great if this could get some testing on other
   platforms, especially HP-UX pre 11.00 and post 11.00,
   as I had to make some guesses for the DCE thread case.
   AIX is also a concern as I saw some mention of using
   sigthreadmask() as a pthread_sigmask() equivalent, but
   this patch doesn't use sigthreadmask(). I don't have
   access to AIX.

23 years agoAdd entry for HotShot.
Fred Drake [Fri, 12 Oct 2001 21:00:48 +0000 (21:00 +0000)]
Add entry for HotShot.

23 years agoThe HotShot core: look, ma, no hands!
Fred Drake [Fri, 12 Oct 2001 20:57:55 +0000 (20:57 +0000)]
The HotShot core:  look, ma, no hands!

23 years agoPreliminary user-level interface to HotShot. We still need the analysis
Fred Drake [Fri, 12 Oct 2001 20:56:29 +0000 (20:56 +0000)]
Preliminary user-level interface to HotShot.  We still need the analysis
tool; look for that on Monday.

23 years agoA most trivial test for HotShot -- make sure we get reasonable events
Fred Drake [Fri, 12 Oct 2001 20:53:59 +0000 (20:53 +0000)]
A most trivial test for HotShot -- make sure we get reasonable events
reported and can read the log back in.

23 years agoUse double curly braces for the generation0/1/2 initializers, to shut
Guido van Rossum [Fri, 12 Oct 2001 20:52:48 +0000 (20:52 +0000)]
Use double curly braces for the generation0/1/2 initializers, to shut
up GCC warnings.

23 years agoBand-aid solution to SF bug #470634: readlines() on linux requires 2 ^D's.
Guido van Rossum [Fri, 12 Oct 2001 20:01:53 +0000 (20:01 +0000)]
Band-aid solution to SF bug #470634: readlines() on linux requires 2 ^D's.

The problem is that if fread() returns a short count, we attempt
another fread() the next time through the loop, and apparently glibc
clears or ignores the eof condition so the second fread() requires
another ^D to make it see the eof condition.

According to the man page (and the C std, I hope) fread() can only
return a short count on error or eof.  I'm using that in the band-aid
solution to avoid calling fread() a second time after a short read.

Note that xreadlines() still has this problem: it calls
readlines(sizehint) until it gets a zero-length return.  Since
xreadlines() is mostly used for reading real files, I won't worry
about this until we get a bug report.

23 years agoAdd entries for the newly split C API manual.
Fred Drake [Fri, 12 Oct 2001 19:02:35 +0000 (19:02 +0000)]
Add entries for the newly split C API manual.

23 years agoBreak the Python/C API manual into smaller files by chapter. This manual
Fred Drake [Fri, 12 Oct 2001 19:01:43 +0000 (19:01 +0000)]
Break the Python/C API manual into smaller files by chapter.  This manual
has grown beyond what font-lock will work with using the default (X)Emacs
settings.

Indentation of the description has been made consistent, and a number of
smaller markup adjustments have been made as well.

23 years agoPySocket_getaddrinfo(): fix two refcount bugs, both having to do with
Guido van Rossum [Fri, 12 Oct 2001 18:59:27 +0000 (18:59 +0000)]
PySocket_getaddrinfo(): fix two refcount bugs, both having to do with
a misunderstanding of the refcont behavior of the 'O' format code in
PyArg_ParseTuple() and Py_BuildValue(), respectively.

- pobj is only a borrowed reference, so should *not* be DECREF'ed at
  the end.  This was the cause of SF bug #470635.

- The Py_BuildValue() call would leak the object produced by
  makesockaddr().  (I found this by eyeballing the code.)

23 years agoThe dynamic performance hack is (mostly) done.
Guido van Rossum [Fri, 12 Oct 2001 17:43:43 +0000 (17:43 +0000)]
The dynamic performance hack is (mostly) done.

23 years agoSuggestion from SF patch #470433 to avoid clobbering TCL_LIBRARY et
Guido van Rossum [Fri, 12 Oct 2001 15:34:29 +0000 (15:34 +0000)]
Suggestion from SF patch #470433 to avoid clobbering TCL_LIBRARY et
al. if already set.  Also adds TIX_LIBRARY (just in case).
(Note that this is entirely Windows specific.)

23 years agoNow that COPYBUF is a new local macro, add #undef COPYBUF.
Guido van Rossum [Fri, 12 Oct 2001 14:13:21 +0000 (14:13 +0000)]
Now that COPYBUF is a new local macro, add #undef COPYBUF.

23 years agoProgress on SF bug #466175 and general cleanup.
Jeremy Hylton [Fri, 12 Oct 2001 04:11:06 +0000 (04:11 +0000)]
Progress on SF bug #466175 and general cleanup.

Add a fast_container member to Picklerobject.  If fast is true, then
fast_container counts the depth of nested container calls.  If the
depth exceeds FAST_LIMIT (2000), the fast flag is ignored and the
normal checks occur.  This approach is much like the approach for
prevent stack overflow for comparison and reprs of recursive objects
(e.g. [[...]]).

    - Fast container used for save_list(), save_dict(), and
      save_inst().

      XXX Not clear which other save_xxx() functions should use it.

Make Picklerobject into new-style types, using PyObject_GenericGetAttr()
and PyObject_GenericSetAttr().

    - Use PyMemberDef for binary and fast members

    - Use PyGetSetDef for persistent_id, inst_persistent_id, memo, and
      PicklingError.

      XXX Not all of these seem like they need to use getset, but it's
      not clear why the old getattr() and setattr() had such odd
      semantics.  One change is that the getvalue() attribute will
      exist on all Picklers, not just list-based picklers; I think
      this is a more rationale interface.

There is a long laundry list of other changes:

    - Remove unused #defines for PyList_SET_ITEM() etc.

    - Make some of the indentation consistent

    - Replace uses of cPickle_PyMapping_HasKey() where the first
      argument is self->memo with calls to PyDict_GetItem(), because
      self->memo must be a dictionary.

    - Don't bother to check if cPickle_PyMapping_HasKey() returns < 0,
      because it can only return 0 or 1.

    - Replace uses of PyObject_CallObject() with PyObject_Call(), when
      we can guarantee that the argument tuple is really a tuple.

Performance impacts of these changes:

    - 5% speedup for normal pickling

    - No change to fast-mode pickling.

XXX Really need tests for all the features in cPickle that aren't in
pickle.

23 years agoSF bug [#470040] ParseTuple t# vs subclasses.
Tim Peters [Fri, 12 Oct 2001 02:38:24 +0000 (02:38 +0000)]
SF bug [#470040] ParseTuple t# vs subclasses.
inherit_slots():  tp_as_buffer was getting inherited as if it were a
method pointer, rather than a pointer to a vector of method pointers.  As
a result, inheriting from a type that implemented buffer methods was
ineffective, leaving all the tp_as_buffer slots NULL in the subclass.

23 years agoPatch #469517: Info about rpcgen compilers.
Martin v. Löwis [Thu, 11 Oct 2001 19:23:28 +0000 (19:23 +0000)]
Patch #469517: Info about rpcgen compilers.

23 years agoAnother step in the right direction: when a new class's attribute
Guido van Rossum [Thu, 11 Oct 2001 18:33:53 +0000 (18:33 +0000)]
Another step in the right direction: when a new class's attribute
corresponding to a dispatch slot (e.g. __getitem__ or __add__) is set,
calculate the proper dispatch slot and propagate the change to all
subclasses.  Because of multiple inheritance, there's no easy way to
avoid always recursing down the tree of subclasses.  Who cares?

(There's more to do, but this works.  There's also a test for this now.)

23 years agoSF bug [#467145] Python 2.2a4 build problem on HPUX 11.0.
Tim Peters [Thu, 11 Oct 2001 18:31:31 +0000 (18:31 +0000)]
SF bug [#467145] Python 2.2a4 build problem on HPUX 11.0.
The platform requires 8-byte alignment for doubles, but the GC header
was 12 bytes and that threw off the natural alignment of the double
members of a subtype of complex.  The fix puts the GC header into a
union with a double as the other member, to force no-looser-than
double alignment of GC headers.  On boxes that require 8-byte alignment
for doubles, this may add pad bytes to the GC header accordingly; ditto
for platforms that *prefer* 8-byte alignment for doubles.  On platforms
that don't care, it shouldn't change the memory layout (because the
size of the old GC header is certainly greater than the size of a double
on all platforms, so unioning with a double shouldn't change size or
alignment on such boxes).

23 years agoSomebody checked in a version of httplib that doesn't even compile --
Tim Peters [Thu, 11 Oct 2001 18:15:51 +0000 (18:15 +0000)]
Somebody checked in a version of httplib that doesn't even compile --
SyntaxError.  Fix it.

23 years agoFix for SF buf #458835
Jeremy Hylton [Thu, 11 Oct 2001 17:47:22 +0000 (17:47 +0000)]
Fix for SF buf #458835

Try to be systematic about dealing with socket and ssl exceptions in
FakeSocket.makefile().  The previous version of the code caught all
ssl errors and treated them as EOF, even though most of the errors
don't mean EOF.

An SSL error can mean on of three things:

    1. The SSL/TLS connection was closed.
    2. The operation should be retried.
    3. An error occurred.

Also, if a socket error occurred and the error was EINTR, retry the
call.  Otherwise, it was a legitimate error and the caller should
receive the exception.

23 years agoUse PySocket_Err() instead of PyErr_SetFromErrno().
Jeremy Hylton [Thu, 11 Oct 2001 17:27:58 +0000 (17:27 +0000)]
Use PySocket_Err() instead of PyErr_SetFromErrno().

The former does the right thing on Windows, the latter does not.

23 years agoCommit parts of SF patch #462759
Jeremy Hylton [Thu, 11 Oct 2001 17:23:34 +0000 (17:23 +0000)]
Commit parts of SF patch #462759

Use #define X509_NAME_MAXLEN for server/issuer length on an SSL
object.

Update doc strings for socket.ssl() and ssl methods read() and
write().

PySSL_SSLwrite(): Check return value and raise exception on error.
Use int for len instead of size_t.  (All the function the size_t obj
was passed to our from expected an int!)

PySSL_SSLread(): Check return value of PyArg_ParseTuple()!  More
robust checks of return values from SSL_read().

23 years agoConvert socket methods to use METH_O and METH_NOARGS where possible.
Jeremy Hylton [Thu, 11 Oct 2001 16:36:35 +0000 (16:36 +0000)]
Convert socket methods to use METH_O and METH_NOARGS where possible.

23 years agoDocument that keyfile and certfile are now optional.
Jeremy Hylton [Thu, 11 Oct 2001 16:17:22 +0000 (16:17 +0000)]
Document that keyfile and certfile are now optional.

XXX Forgot to mention this in the last socketmodule.c checkin.

23 years agoDescribe the HeaderParser class.
Barry Warsaw [Thu, 11 Oct 2001 15:45:05 +0000 (15:45 +0000)]
Describe the HeaderParser class.

23 years agoAdd a test for the HeaderParser class.
Barry Warsaw [Thu, 11 Oct 2001 15:44:50 +0000 (15:44 +0000)]
Add a test for the HeaderParser class.

23 years agoHeaderParser: A new subclass of Parser which only parses the message
Barry Warsaw [Thu, 11 Oct 2001 15:43:00 +0000 (15:43 +0000)]
HeaderParser: A new subclass of Parser which only parses the message
headers.  It does not parse the body of the message, instead simply
assigning it as a string to the container's payload.  This can be much
faster when you're only interested in a message's header.

23 years agoUndo part of 2.59: 't' case of convertsimple() should not use convertbuffer().
Jeremy Hylton [Thu, 11 Oct 2001 14:40:37 +0000 (14:40 +0000)]
Undo part of 2.59: 't' case of convertsimple() should not use convertbuffer().

convertbuffer() uses the buffer interface's getreadbuffer(), but 't'
should use getcharbuffer().

23 years agoAdd test of hexlify on Unicode strings
Jeremy Hylton [Thu, 11 Oct 2001 14:09:03 +0000 (14:09 +0000)]
Add test of hexlify on Unicode strings

23 years agoAdd a bunch of SSL error constants
Jeremy Hylton [Thu, 11 Oct 2001 00:00:17 +0000 (00:00 +0000)]
Add a bunch of SSL error constants

23 years agoLots of code reorganization with a few small API changes.
Jeremy Hylton [Wed, 10 Oct 2001 23:55:43 +0000 (23:55 +0000)]
Lots of code reorganization with a few small API changes.

Change all the local names that start with SSL to start with PySSL.
The OpenSSL library defines lots of calls that start with "SSL_".  The
calls for Python's SSL objects also started with "SSL_".  This choice
made it really confusing to figure out which calls were to the library
and which calls were local to the file.

Add PySSL_SetError() that sets an exception based on the information
from SSL_get_error().  This function will eventually replace all the
calls that set it with an error message that is based on the name of
the call that failed rather than the reason it failed.  (Example: If
SSL_connect() failed it used to report "SSL_connect error" now it will
offer a specific message about why SSL_connect failed.)

    XXX It might be helpful to augment the error message generated
    below with the name of the SSL function that generated the error.
    I expect it's obvious most of the time.

Remove several unnecessary INCREFs in the module's constructor call.
PyDict_SetItem() and friends do the INCREF for you.

23 years agoDo simple error checking before doing any SSL calls.
Jeremy Hylton [Wed, 10 Oct 2001 22:37:48 +0000 (22:37 +0000)]
Do simple error checking before doing any SSL calls.

23 years agoUSe PyObject_SetString() instead of PyObject_SetObject() in newSSLObject().
Jeremy Hylton [Wed, 10 Oct 2001 22:33:32 +0000 (22:33 +0000)]
USe PyObject_SetString() instead of PyObject_SetObject() in newSSLObject().

23 years agoRather gross workaround for a bug in the mac GUSI I/O library:
Jack Jansen [Wed, 10 Oct 2001 22:03:27 +0000 (22:03 +0000)]
Rather gross workaround for a bug in the mac GUSI I/O library:
lseek(fp, 0L, SEEK_CUR) can make a filedescriptor unusable.
This workaround is expected to last only a few weeks (until GUSI
is fixed), but without it test_email fails.

23 years agoSome of the lesser used targets still used FMADD/FMSUB instructions. Fixed.
Jack Jansen [Wed, 10 Oct 2001 21:59:08 +0000 (21:59 +0000)]
Some of the lesser used targets still used FMADD/FMSUB instructions. Fixed.

23 years agoallow long ints to be marshalled as ints - no check is made to the incoming
Skip Montanaro [Wed, 10 Oct 2001 15:56:34 +0000 (15:56 +0000)]
allow long ints to be marshalled as ints - no check is made to the incoming
value, so the programmer will have to catch OverflowError.  I'm not sure
what /F's perspective is on this.  Perhaps it should be caught and mapped to
an xmlrpclib-specific exception.  None of the other type-specific dump
methods seem to do any exception handling though.

23 years agoFred's done with weakrefs
Guido van Rossum [Wed, 10 Oct 2001 14:28:58 +0000 (14:28 +0000)]
Fred's done with weakrefs

23 years agoSF bug [#469732] os.path.walk docstring inconsistent.
Tim Peters [Wed, 10 Oct 2001 04:16:20 +0000 (04:16 +0000)]
SF bug [#469732] os.path.walk docstring inconsistent.
We have 5 implementations of walk(), and 5 different docstrings.  Combined
'em.  Let's see how long it takes before they're all different again!

23 years agoIn newSSLObject(), initialize the various members of an SSLObject to NULL.
Jeremy Hylton [Wed, 10 Oct 2001 03:37:05 +0000 (03:37 +0000)]
In newSSLObject(), initialize the various members of an SSLObject to NULL.
In SSL_dealloc(), free/dealloc them only if they're non-NULL.

Fixes some obvious core dumps, but not sure yet if there are more
semantics to the SSL calls that would affect the dealloc.

23 years agoA bit of reformatting to match the standard style
Jeremy Hylton [Wed, 10 Oct 2001 03:33:24 +0000 (03:33 +0000)]
A bit of reformatting to match the standard style

23 years agoFix two memory leaks in socket.ssl().
Jeremy Hylton [Wed, 10 Oct 2001 03:19:39 +0000 (03:19 +0000)]
Fix two memory leaks in socket.ssl().

XXX [1] These changes aren't tested very thoroughly, because regrtest
doesn't do any SSL tests.  I've done some trivial tests on my own, but
don't really know how to use the key and cert files.  In one case, an
SSL-level error causes Python to dump core.  I'll get the fixed in the
next round of changes.

XXX [2] The checkin removes the x_attr member of the SSLObject struct.
I'm not sure if this is kosher for backwards compatibility at the
binary level.  Perhaps its safer to keep the member but keep it
assigned to NULL.

And the leaks?

newSSLObject() called PyDict_New(), stored the result in x_attr
without checking it, and later stored NULL in x_attr without doing
anything to the dict.  So the dict always leaks.  There is no further
reference to x_attr, so I just removed it completely.

The error cases in newSSLObject() passed the return value of
PyString_FromString() directly to PyErr_SetObject().
PyErr_SetObject() expects a borrowed reference, so the string leaked.

23 years agoOne more place where PyString_AsString() was used after a
Jeremy Hylton [Wed, 10 Oct 2001 02:51:57 +0000 (02:51 +0000)]
One more place where PyString_AsString() was used after a
PyString_Check() had already succeeded.

23 years agoUse AS_STRING() following the check and avoid an extra call.
Jeremy Hylton [Wed, 10 Oct 2001 02:51:08 +0000 (02:51 +0000)]
Use AS_STRING() following the check and avoid an extra call.

23 years agoSF patch [ #468662 ] Allow jython to complete test_grammar
Jeremy Hylton [Wed, 10 Oct 2001 01:45:02 +0000 (01:45 +0000)]
SF patch [ #468662 ] Allow jython to complete test_grammar

The behavior of co_varnames in the presence of nested argument tuples
is not consistent across Python and Jython.  Test each platform
separately.

23 years agoUpdated, and added a very terse description of PyMac_SetConsoleHandler().
Jack Jansen [Tue, 9 Oct 2001 23:14:06 +0000 (23:14 +0000)]
Updated, and added a very terse description of PyMac_SetConsoleHandler().

23 years agoFixed the embedding demo to correctly show the use of
Jack Jansen [Tue, 9 Oct 2001 23:09:00 +0000 (23:09 +0000)]
Fixed the embedding demo to correctly show the use of
overriding the console writer.

23 years agoAdd item about new "Edit with IDLE" menu entry created by Windows installer.
Tim Peters [Tue, 9 Oct 2001 22:39:40 +0000 (22:39 +0000)]
Add item about new "Edit with IDLE" menu entry created by Windows installer.

23 years agoIf all of Python, IDLE and Tcl/Tk are being installed, and the user has
Tim Peters [Tue, 9 Oct 2001 22:22:36 +0000 (22:22 +0000)]
If all of Python, IDLE and Tcl/Tk are being installed, and the user has
not disabled file-extension registration, arrange for .py and .pyw files
to have an "Edit with IDLE" context (right-click) menu entry, selecting
which executes IDLE w/ the -e switch followed by the selected file's path.

23 years agoRepair key stutter + auto-complete ugliness.
Tim Peters [Tue, 9 Oct 2001 21:01:31 +0000 (21:01 +0000)]
Repair key stutter + auto-complete ugliness.

23 years agoA copy-and-paste job forget the "paste" half.
Tim Peters [Tue, 9 Oct 2001 20:54:23 +0000 (20:54 +0000)]
A copy-and-paste job forget the "paste" half.

23 years agoRemove obsolete email address.
Fred Drake [Tue, 9 Oct 2001 20:53:48 +0000 (20:53 +0000)]
Remove obsolete email address.

23 years agoAllow the profiler's calibration constant to be specified in the constructor
Tim Peters [Tue, 9 Oct 2001 20:51:19 +0000 (20:51 +0000)]
Allow the profiler's calibration constant to be specified in the constructor
call, or via setting an instance or class vrbl.
Rewrote the calibration docs.
Modern boxes are so friggin' fast, and a profiler event does so much work
anyway, that the cost of looking up an instance vrbl (the bias constant)
per profile event just isn't a big deal.

23 years agoAdd a bunch of tests for a list subclass that would have caught the
Guido van Rossum [Tue, 9 Oct 2001 20:36:44 +0000 (20:36 +0000)]
Add a bunch of tests for a list subclass that would have caught the
previous embarrassment (typeobject.c checking crashing minidom).

23 years agoThe slot definition table entry for mp_getitem had a bogus wrapper
Guido van Rossum [Tue, 9 Oct 2001 20:17:57 +0000 (20:17 +0000)]
The slot definition table entry for mp_getitem had a bogus wrapper
function, which caused test_minidom to fail.  Fixed this.

23 years agoAn audio/* class, like MIMEImage, contributed by Anthony Baxter.
Barry Warsaw [Tue, 9 Oct 2001 19:41:18 +0000 (19:41 +0000)]
An audio/* class, like MIMEImage, contributed by Anthony Baxter.
Rewritten for style and the email package naming conventions by
Barry.

23 years agoHalfway checkin. This is still messy, but it's beginning to address
Guido van Rossum [Tue, 9 Oct 2001 19:39:46 +0000 (19:39 +0000)]
Halfway checkin.  This is still messy, but it's beginning to address
the problem that slots weren't inherited properly.  override_slots()
no longer exists; in its place comes fixup_slot_dispatchers() which
does more and different work and is table-based.  (Eventually I want
this table also to replace all the little tab_foo tables.)

Also add a wrapper for __delslice__; this required a change in
test_descrtut.py.

23 years agoFix minor cut-and-paste typo.
Barry Warsaw [Tue, 9 Oct 2001 19:37:51 +0000 (19:37 +0000)]
Fix minor cut-and-paste typo.

23 years agoUpdate the documentation for the isinstance() function to reflect recent
Fred Drake [Tue, 9 Oct 2001 19:31:08 +0000 (19:31 +0000)]
Update the documentation for the isinstance() function to reflect recent
changes in the implementation.
Indented all descriptions consistently.

23 years agoAdded tests for MIMEAudio class/module
Barry Warsaw [Tue, 9 Oct 2001 19:23:57 +0000 (19:23 +0000)]
Added tests for MIMEAudio class/module

23 years agoFix __all__ to the current list of exported modules (must pass the
Barry Warsaw [Tue, 9 Oct 2001 19:14:59 +0000 (19:14 +0000)]
Fix __all__ to the current list of exported modules (must pass the
tests in test_email.py).

23 years agoAdd documentation for the MIMEAudio class/module, contributed by
Barry Warsaw [Tue, 9 Oct 2001 19:14:17 +0000 (19:14 +0000)]
Add documentation for the MIMEAudio class/module, contributed by
Anthony Baxter.

23 years agoImprove the documentation for the os.P_* constants used with the os.spawn*()
Fred Drake [Tue, 9 Oct 2001 18:07:04 +0000 (18:07 +0000)]
Improve the documentation for the os.P_* constants used with the os.spawn*()
functions to include information about how they affect the operation of
those functions when used as the "mode" parameter.
This closes SF bug #468384.

Added warnings to the os.tempnam() and os.tmpnam() functions regarding their
security problem.  These warning mirror the warnings added to the runtime
by Skip Montanaro.

23 years agoNew markup: \note{...} and \warning{...}
Fred Drake [Tue, 9 Oct 2001 18:01:23 +0000 (18:01 +0000)]
New markup:  \note{...} and \warning{...}

23 years agoFix [ #465502 ] urllib2: urlopen unicode problem
Jeremy Hylton [Tue, 9 Oct 2001 16:18:45 +0000 (16:18 +0000)]
Fix [ #465502 ] urllib2: urlopen unicode problem

When checking for strings use,
!         if isinstance(uri, (types.StringType, types.UnicodeType)):

Also get rid of some dodgy code that tried to guess whether attributes
were callable or not.

23 years agoAdd a test for get_all() returning failobj. msg_20.txt is a sample
Barry Warsaw [Tue, 9 Oct 2001 15:49:35 +0000 (15:49 +0000)]
Add a test for get_all() returning failobj.  msg_20.txt is a sample
message with multiple CC: fields, used in the get_all() test.

23 years agoget_all(): We never returned failobj if we found no matching headers.
Barry Warsaw [Tue, 9 Oct 2001 15:48:29 +0000 (15:48 +0000)]
get_all(): We never returned failobj if we found no matching headers.
Fix that, and also make the docstring describe failobj.

23 years agoSMTPServer.__init__(): The asyncore.dispatcher base class has a method
Barry Warsaw [Tue, 9 Oct 2001 15:46:31 +0000 (15:46 +0000)]
SMTPServer.__init__(): The asyncore.dispatcher base class has a method
set_reuse_addr() that does the setsockopt fiddling.  Use it instead.

23 years agoNote that the values for Boolean options are case-insensitive.
Fred Drake [Tue, 9 Oct 2001 14:58:24 +0000 (14:58 +0000)]
Note that the values for Boolean options are case-insensitive.

23 years agoAdd Cesar Eduardo Barros, for asyncore patches.
Martin v. Löwis [Tue, 9 Oct 2001 11:53:47 +0000 (11:53 +0000)]
Add Cesar Eduardo Barros, for asyncore patches.