]> granicus.if.org Git - python/log
python
22 years agoSF patch #577031, remove PyArg_NoArgs() since it's deprecated
Neal Norwitz [Sun, 28 Jul 2002 15:23:23 +0000 (15:23 +0000)]
SF patch #577031, remove PyArg_NoArgs() since it's deprecated
Explicitly use METH_OLDARGS

22 years agoSF patch #577031, remove PyArg_Parse() since it's deprecated
Neal Norwitz [Sun, 28 Jul 2002 15:19:47 +0000 (15:19 +0000)]
SF patch #577031, remove PyArg_Parse() since it's deprecated

22 years agoSF patch #577031, remove PyArg_Parse() since it's deprecated
Neal Norwitz [Sun, 28 Jul 2002 15:12:10 +0000 (15:12 +0000)]
SF patch #577031, remove PyArg_Parse() since it's deprecated

22 years agoFix SF bug 587012, doc mentions inexistent builtin unistr
Neal Norwitz [Sun, 28 Jul 2002 13:55:20 +0000 (13:55 +0000)]
Fix SF bug 587012, doc mentions inexistent builtin unistr

22 years agoFix last checkin, can't use " inside a string
Neal Norwitz [Sun, 28 Jul 2002 13:53:05 +0000 (13:53 +0000)]
Fix last checkin, can't use " inside a string

22 years agoPatch #571603: Refer to encodings package explicitly.
Martin v. Löwis [Sun, 28 Jul 2002 11:31:33 +0000 (11:31 +0000)]
Patch #571603: Refer to encodings package explicitly.

22 years agoPatch #543498: Use License: field instead of Copyright:.
Martin v. Löwis [Sun, 28 Jul 2002 10:49:37 +0000 (10:49 +0000)]
Patch #543498: Use License: field instead of Copyright:.

22 years agoPatch #552812: Better description in "python -h" for -u.
Martin v. Löwis [Sun, 28 Jul 2002 10:34:08 +0000 (10:34 +0000)]
Patch #552812: Better description in "python -h" for -u.

22 years agoPatch #554716: Use __va_copy where available.
Martin v. Löwis [Sun, 28 Jul 2002 10:23:27 +0000 (10:23 +0000)]
Patch #554716: Use __va_copy where available.

22 years agoPatch #575827: allow threads inside SSL creation.
Martin v. Löwis [Sun, 28 Jul 2002 09:57:45 +0000 (09:57 +0000)]
Patch #575827: allow threads inside SSL creation.

22 years agoPatch #581705: Catch OSError, termios.error in spawn. 2.2 bugfix candidate.
Martin v. Löwis [Sun, 28 Jul 2002 09:42:57 +0000 (09:42 +0000)]
Patch #581705: Catch OSError, termios.error in spawn. 2.2 bugfix candidate.

22 years agoReset the Python execution server environment to its initial value prior
Kurt B. Kaiser [Sun, 28 Jul 2002 03:35:31 +0000 (03:35 +0000)]
Reset the Python execution server environment to its initial value prior
to executing Run/F5 from an EditorWindow.

M ScriptBinding.py : add call to clear_the_environment()
M run.py           : implemented Executive.clear_the_environment()

22 years agoremove redundant import
Piers Lauder [Sat, 27 Jul 2002 07:10:14 +0000 (07:10 +0000)]
remove redundant import

22 years agoremove redundant code
Piers Lauder [Sat, 27 Jul 2002 07:08:38 +0000 (07:08 +0000)]
remove redundant code

22 years agoremove o/s dependancy from test
Piers Lauder [Sat, 27 Jul 2002 00:38:30 +0000 (00:38 +0000)]
remove o/s dependancy from test

22 years agotighten up the unicode object's docstring a tad
Skip Montanaro [Fri, 26 Jul 2002 16:22:46 +0000 (16:22 +0000)]
tighten up the unicode object's docstring a tad

22 years agoUse os.environ.get() in stead of os.getenv() (which is platform-dependent).
Jack Jansen [Fri, 26 Jul 2002 11:34:49 +0000 (11:34 +0000)]
Use os.environ.get() in stead of os.getenv() (which is platform-dependent).

22 years agoReorganized so the test is skipped if os.popen() doesn't exist (in stead of failing).
Jack Jansen [Fri, 26 Jul 2002 11:33:49 +0000 (11:33 +0000)]
Reorganized so the test is skipped if os.popen() doesn't exist (in stead of failing).

22 years agoAdded a __contains__ method.
Jack Jansen [Fri, 26 Jul 2002 11:32:03 +0000 (11:32 +0000)]
Added a __contains__ method.

22 years agoReverse the RPC socket connection: Python execution server connects to
Kurt B. Kaiser [Fri, 26 Jul 2002 00:06:42 +0000 (00:06 +0000)]
Reverse the RPC socket connection: Python execution server connects to
Idle client and localhost origin of connection is verified by client.
M PyShell.py
M rpc.py
M run.py

22 years agoSmall clarifications when referring to the sys.exc_* variables so that
Fred Drake [Thu, 25 Jul 2002 21:11:23 +0000 (21:11 +0000)]
Small clarifications when referring to the sys.exc_* variables so that
readers are not given the wrong impression that they should be using those
on a regualar basis.
This closes SF bug #585598.

22 years agoRemove duplicate checks of the Node.allnodes variable.
Fred Drake [Thu, 25 Jul 2002 20:40:28 +0000 (20:40 +0000)]
Remove duplicate checks of the Node.allnodes variable.

22 years agoAdd an XXX comment and a pointer to a full bug report.
Fred Drake [Thu, 25 Jul 2002 20:13:03 +0000 (20:13 +0000)]
Add an XXX comment and a pointer to a full bug report.

22 years agoDon't be so hasty. If PyInt_AsLong() raises an error, don't set ValueError.
Jeremy Hylton [Thu, 25 Jul 2002 16:43:29 +0000 (16:43 +0000)]
Don't be so hasty.  If PyInt_AsLong() raises an error, don't set ValueError.

22 years agoPut checks for error returns in the right place.
Jeremy Hylton [Thu, 25 Jul 2002 16:37:51 +0000 (16:37 +0000)]
Put checks for error returns in the right place.

22 years ago- Make number in comment match the targets in that section of the
Fred Drake [Thu, 25 Jul 2002 16:23:21 +0000 (16:23 +0000)]
- Make number in comment match the targets in that section of the
  Makefile.
- Update the Python version number so we're using the library built
  from the current working sources.

22 years agotypo
Skip Montanaro [Thu, 25 Jul 2002 16:10:38 +0000 (16:10 +0000)]
typo

22 years ago* runctx - fix a couple typos
Skip Montanaro [Thu, 25 Jul 2002 16:09:35 +0000 (16:09 +0000)]
* runctx - fix a couple typos
* globaltrace_lt - handle case where inspect.getmodulename doesn't return
  anything useful
* localtrace_trace - handle case where inspect.getframeinfo doesn't return
  any context info

I think both of the last two are caused by exec'd or eval'd code

22 years agoComplain if __len__() returns < 0, just like classic classes.
Jeremy Hylton [Thu, 25 Jul 2002 16:06:15 +0000 (16:06 +0000)]
Complain if __len__() returns < 0, just like classic classes.

Fixes SF bug #575773.

Bug fix candidate.

22 years agoExtended socket.htonl and ntohl to accept longs.
Jeremy Hylton [Thu, 25 Jul 2002 16:01:12 +0000 (16:01 +0000)]
Extended socket.htonl and ntohl to accept longs.

Fixes SF bug #568322.

The code should raise an OverflowError if the long is > 32 bits, even
on platforms where sizeof(long) > 4.

22 years agoRemove test that was none too picky about whether attributes exist.
Jeremy Hylton [Thu, 25 Jul 2002 15:37:23 +0000 (15:37 +0000)]
Remove test that was none too picky about whether attributes exist.

22 years agoremove spurious SET_LINENO from com_list_for and com_list_if. All they do
Skip Montanaro [Thu, 25 Jul 2002 06:18:42 +0000 (06:18 +0000)]
remove spurious SET_LINENO from com_list_for and com_list_if.  All they do
is slow things down unnecessarily and make tracing much more verbose.
Something like

    def f(n):
return [i for i in range(n) if i%2]

should have at most two SET_LINENO instructions, not four.  When tracing,
the current line number should be printed once, not 2*n+1 times.

22 years agoGet rid of _expand() altogether - the match object supports m.expand().
Guido van Rossum [Wed, 24 Jul 2002 19:13:08 +0000 (19:13 +0000)]
Get rid of _expand() altogether - the match object supports m.expand().

22 years agoFlesh out description of getlogin() and recommend against using it.
Jeremy Hylton [Wed, 24 Jul 2002 15:32:25 +0000 (15:32 +0000)]
Flesh out description of getlogin() and recommend against using it.

22 years agoThe test for re.engine was misfiring because re.engine is no longer
Guido van Rossum [Wed, 24 Jul 2002 01:49:16 +0000 (01:49 +0000)]
The test for re.engine was misfiring because re.engine is no longer
defined and the default was "pre" instead of "sre".  Give up on 1.5.2
compatibility, hardcode the sre solution.  However, this XXX comment
still applies, AFAIK:
        # XXX This code depends on internals of the regular expression
        # engine!  There's no standard API to do a substitution when you
        # have already found the match.  One should be added.

22 years agoUse full package paths in imports.
Barry Warsaw [Tue, 23 Jul 2002 20:35:58 +0000 (20:35 +0000)]
Use full package paths in imports.

22 years agoTaught the Windows installer about changes in the structure of the email
Tim Peters [Tue, 23 Jul 2002 19:56:30 +0000 (19:56 +0000)]
Taught the Windows installer about changes in the structure of the email
package, and the loss of the test/data directory.

22 years agoAdded a couple of more tests for Header charset handling.
Barry Warsaw [Tue, 23 Jul 2002 19:46:35 +0000 (19:46 +0000)]
Added a couple of more tests for Header charset handling.

22 years agoOops, missed an import of test_support.
Barry Warsaw [Tue, 23 Jul 2002 19:23:22 +0000 (19:23 +0000)]
Oops, missed an import of test_support.

22 years agoA few updates about how/where to import test_support from.
Barry Warsaw [Tue, 23 Jul 2002 19:13:45 +0000 (19:13 +0000)]
A few updates about how/where to import test_support from.

22 years agoGet rid of relative imports in all unittests. Now anything that
Barry Warsaw [Tue, 23 Jul 2002 19:04:11 +0000 (19:04 +0000)]
Get rid of relative imports in all unittests.  Now anything that
imports e.g. test_support must do so using an absolute package name
such as "import test.test_support" or "from test import test_support".

This also updates the README in Lib/test, and gets rid of the
duplicate data dirctory in Lib/test/data (replaced by
Lib/email/test/data).

Now Tim and Jack can have at it. :)

22 years agoReplace DL_IMPORT with PyMODINIT_FUNC and remove "/export:init..." link
Mark Hammond [Tue, 23 Jul 2002 06:31:15 +0000 (06:31 +0000)]
Replace DL_IMPORT with PyMODINIT_FUNC and remove "/export:init..." link
command line for Windows builds.  This should allow MSVC to import and
build the Python MSVC6 project files without error.

22 years agoappend(): Bite the bullet and let charset be the string name of a
Barry Warsaw [Tue, 23 Jul 2002 06:08:10 +0000 (06:08 +0000)]
append(): Bite the bullet and let charset be the string name of a
character set, which we'll convert to a Charset instance.  Sigh.

22 years agomake_header(): Watch out for charset is None, which decode_header()
Barry Warsaw [Tue, 23 Jul 2002 04:29:54 +0000 (04:29 +0000)]
make_header(): Watch out for charset is None, which decode_header()
will return as the charset if implicit us-ascii is used.

22 years agoNews about StopIteration as a "sink state".
Guido van Rossum [Tue, 23 Jul 2002 03:44:35 +0000 (03:44 +0000)]
News about StopIteration as a "sink state".

22 years agoAdd news about strptime and socket.setdefaulttimeout().
Guido van Rossum [Tue, 23 Jul 2002 03:32:08 +0000 (03:32 +0000)]
Add news about strptime and socket.setdefaulttimeout().

22 years agoSF patch #581396, Canvas "select_item" always returns None
Neal Norwitz [Tue, 23 Jul 2002 02:52:58 +0000 (02:52 +0000)]
SF patch #581396, Canvas "select_item" always returns None

Return the selected item, if there is any.

22 years ago[Bug #580462] Mention changes to GC API
Andrew M. Kuchling [Mon, 22 Jul 2002 19:21:06 +0000 (19:21 +0000)]
[Bug #580462] Mention changes to GC API
Mention portable strptime()
Move C-level sections farther down in the file

22 years agoSort changed modules into alphabetical order; no other changes
Andrew M. Kuchling [Mon, 22 Jul 2002 18:57:36 +0000 (18:57 +0000)]
Sort changed modules into alphabetical order; no other changes

22 years agoRewrite a paragraph, and use correct mark-up
Andrew M. Kuchling [Mon, 22 Jul 2002 18:50:11 +0000 (18:50 +0000)]
Rewrite a paragraph, and use correct mark-up

22 years agoRemove a strange single quote that didn't seem to upset the compilers!
Mark Hammond [Mon, 22 Jul 2002 13:28:21 +0000 (13:28 +0000)]
Remove a strange single quote that didn't seem to upset the compilers!

22 years agoNuke the only DL_* in this directory.
Mark Hammond [Mon, 22 Jul 2002 13:26:41 +0000 (13:26 +0000)]
Nuke the only DL_* in this directory.

22 years agoMove DL_IMPORT/DL_EXPORT to Build section, I think this is the correct place
Neal Norwitz [Mon, 22 Jul 2002 13:21:10 +0000 (13:21 +0000)]
Move DL_IMPORT/DL_EXPORT to Build section, I think this is the correct place

22 years agoSF bug #583894, add doc for DL_IMPORT/DL_EXPORT deprecation
Neal Norwitz [Mon, 22 Jul 2002 13:18:59 +0000 (13:18 +0000)]
SF bug #583894, add doc for DL_IMPORT/DL_EXPORT deprecation

22 years agoAdd note about DL_IMPORT deprecation.
Mark Hammond [Mon, 22 Jul 2002 12:53:16 +0000 (12:53 +0000)]
Add note about DL_IMPORT deprecation.
[ 583894 ] doc DL_IMPORT/DL_EXPORT changes

22 years agoFixed potential refcount problems with interned strings, adapted comments, added...
Jack Jansen [Mon, 22 Jul 2002 12:35:22 +0000 (12:35 +0000)]
Fixed potential refcount problems with interned strings, adapted comments, added a bit more trace output if verbose > 1.

22 years agoFinally found out why te cf project sometimes worked and someimes didn't. Fixed it.
Jack Jansen [Mon, 22 Jul 2002 12:32:31 +0000 (12:32 +0000)]
Finally found out why te cf project sometimes worked and someimes didn't. Fixed it.

22 years agoNew test "+sort", tacking 10 random floats on to the end of a sorted
Tim Peters [Sun, 21 Jul 2002 17:37:03 +0000 (17:37 +0000)]
New test "+sort", tacking 10 random floats on to the end of a sorted
array.  Our samplesort special-cases the snot out of this, running about
12x faster than *sort.  The experimental mergesort runs it about 8x
faster than *sort without special-casing, but should really do better
than that (when merging runs of different lengths, right now it only
does something clever about finding where the second run begins in
the first and where the first run ends in the second, and that's more
of a temp-memory optimization).

22 years agoChanged import from
Tim Peters [Sun, 21 Jul 2002 06:06:30 +0000 (06:06 +0000)]
Changed import from
    from test.test_support import TestSkipped, run_unittest
to
    from test_support import TestSkipped, run_unittest

Otherwise, if the Japanese codecs aren't installed, regrtest doesn't
believe the TestSkipped exception raised by this test matches the

    except (ImportError, test_support.TestSkipped), msg:

it's looking for, and reports the skip as a crash failure instead of
as a skipped test.

I suppose this will make it harder to run this test outside of
regrtest, but under the assumption only Barry does that, better to
make it skip cleanly for everyone else.

22 years agoBug: clearing the shell undo list after a prompt was allowing files to be
Kurt B. Kaiser [Sun, 21 Jul 2002 01:24:28 +0000 (01:24 +0000)]
Bug: clearing the shell undo list after a prompt was allowing files to be
opened on top of the shell instead of in a new window.

22 years agoGet popen test to work even if python is not in the path
Neal Norwitz [Sat, 20 Jul 2002 20:35:13 +0000 (20:35 +0000)]
Get popen test to work even if python is not in the path

22 years agoDefine _XOPEN_SOURCE and _GNU_SOURCE in pyconfig.h, to have them
Martin v. Löwis [Sat, 20 Jul 2002 08:51:52 +0000 (08:51 +0000)]
Define _XOPEN_SOURCE and _GNU_SOURCE in pyconfig.h, to have them
available in the configure tests already.

22 years agoAdded new test "3sort". This is sorted data but with 3 random exchanges.
Tim Peters [Sat, 20 Jul 2002 04:21:51 +0000 (04:21 +0000)]
Added new test "3sort".  This is sorted data but with 3 random exchanges.
It's a little better than average for our sort.

22 years agoadd versionadded to doc
Neal Norwitz [Sat, 20 Jul 2002 00:46:12 +0000 (00:46 +0000)]
add versionadded to doc

22 years agounpack_string(): avoid a compiler warning (about a real bug!) by
Guido van Rossum [Sat, 20 Jul 2002 00:38:01 +0000 (00:38 +0000)]
unpack_string(): avoid a compiler warning (about a real bug!) by
copying the result of fgetc() into an int variable before testing it
for EOF.

22 years agoMove the setting of os.environ['LANGUAGE'] to setup(), and reset it to
Guido van Rossum [Sat, 20 Jul 2002 00:36:38 +0000 (00:36 +0000)]
Move the setting of os.environ['LANGUAGE'] to setup(), and reset it to
'en' in teardown().  This way hopefully test_time.py won't fail.

22 years agoShut the test up and add a missing import
Barry Warsaw [Fri, 19 Jul 2002 22:44:23 +0000 (22:44 +0000)]
Shut the test up and add a missing import

22 years agoThe email package's tests live much better in a subpackage
Barry Warsaw [Fri, 19 Jul 2002 22:31:10 +0000 (22:31 +0000)]
The email package's tests live much better in a subpackage
(i.e. email.test), so move the guts of them here from Lib/test.  The
latter directory will retain stubs to run the email.test tests using
Python's standard regression test.

test_email_torture.py is a torture tester which will not run under
Python's test suite because I don't want to commit megs of data to
that project (it will fail cleanly there).  When run under the mimelib
project it'll stress test the package with megs of message samples
collected from various locations in the wild.

22 years agoThe email package's tests live much better in a subpackage
Barry Warsaw [Fri, 19 Jul 2002 22:29:49 +0000 (22:29 +0000)]
The email package's tests live much better in a subpackage
(i.e. email.test), so move the guts of them here from Lib/test.  The
latter directory will retain stubs to run the email.test tests using
Python's standard regression test.

test_email_torture.py is a torture tester which will not run under
Python's test suite because I don't want to commit megs of data to
that project (it will fail cleanly there).  When run under the mimelib
project it'll stress test the package with megs of message samples
collected from various locations in the wild.

email/test/data is a copy of Lib/test/data.  The fate of the latter is
still undecided.

22 years agomessage_from_string(), message_from_file(): The consensus on the
Barry Warsaw [Fri, 19 Jul 2002 22:26:01 +0000 (22:26 +0000)]
message_from_string(), message_from_file(): The consensus on the
mimelib-devel list is that non-strict parsing should be the default.
Make it so.

22 years agoParser.__init__(): The consensus on the mimelib-devel list is that
Barry Warsaw [Fri, 19 Jul 2002 22:25:34 +0000 (22:25 +0000)]
Parser.__init__(): The consensus on the mimelib-devel list is that
non-strict parsing should be the default.  Make it so.

22 years agoTo better support default content types, fix an API wart, and preserve
Barry Warsaw [Fri, 19 Jul 2002 22:24:55 +0000 (22:24 +0000)]
To better support default content types, fix an API wart, and preserve
backwards compatibility, we're silently deprecating get_type(),
get_subtype() and get_main_type().  We may eventually noisily
deprecate these.  For now, we'll just fix a bug in the splitting of
the main and subtypes.

get_content_type(), get_content_maintype(), get_content_subtype(): New
methods which replace the above.  These /always/ return a content type
string and do not take a failobj, because an email message always at
least has a default content type.

set_default_type(): Someday there may be additional default content
types, so don't hard code an assertion about the value of the ctype
argument.

22 years ago_structure(): Take an optional `fp' argument which would be the object
Barry Warsaw [Fri, 19 Jul 2002 22:21:47 +0000 (22:21 +0000)]
_structure(): Take an optional `fp' argument which would be the object
to print>> the structure to.  Defaults to sys.stdout.

22 years ago_dispatch(): Use the new Message.get_content_type() method as hashed
Barry Warsaw [Fri, 19 Jul 2002 22:21:02 +0000 (22:21 +0000)]
_dispatch(): Use the new Message.get_content_type() method as hashed
out on the mimelib-devel list.

22 years agoFollow PyXML: Remove all prints from successful tests. This means we can
Fred Drake [Fri, 19 Jul 2002 22:16:41 +0000 (22:16 +0000)]
Follow PyXML: Remove all prints from successful tests.  This means we can
also drop the output file.

22 years agoReturn NULL instead of 0 from function with a pointer return value.
Fred Drake [Fri, 19 Jul 2002 22:03:03 +0000 (22:03 +0000)]
Return NULL instead of 0 from function with a pointer return value.

22 years agoAlas, roll back the definition of _XOPEN_SOURCE. It breaks the tests
Guido van Rossum [Fri, 19 Jul 2002 19:32:30 +0000 (19:32 +0000)]
Alas, roll back the definition of _XOPEN_SOURCE.  It breaks the tests
for the time module, because somehow configure won't define the
symbols HAVE_STRUCT_TM_TM_ZONE, HAVE_TM_ZONE, and HAVE_TZNAME in this
case.

I've got no time to research this further, so I leave it in Jeremy and
Martin's capable hands to find a different solution for True64 (or to
devise a way to get the time tests to succeed while defining
_XOPEN_SOURCE).

22 years agoRemove a few lines that aren't used and cause problems on platforms
Guido van Rossum [Fri, 19 Jul 2002 19:23:54 +0000 (19:23 +0000)]
Remove a few lines that aren't used and cause problems on platforms
where recvfrom() on a TCP stream returns None for the address.
This should address the remaining problems on FreeBSD.

22 years agoPure Python strptime implementation by Brett Cannon. See SF patch 474274.
Neal Norwitz [Fri, 19 Jul 2002 18:38:25 +0000 (18:38 +0000)]
Pure Python strptime implementation by Brett Cannon.  See SF patch 474274.

22 years agoDoc patch from SF 474274 (pure Python strptime by Brett Cannon).
Guido van Rossum [Fri, 19 Jul 2002 17:09:36 +0000 (17:09 +0000)]
Doc patch from SF 474274 (pure Python strptime by Brett Cannon).

22 years agoPatch to call the Pure python strptime implementation if there's no
Guido van Rossum [Fri, 19 Jul 2002 17:06:47 +0000 (17:06 +0000)]
Patch to call the Pure python strptime implementation if there's no
C implementation.  See SF patch 474274, by Brett Cannon.

(As an experiment, I'm adding a line that #undefs HAVE_STRPTIME,
so that you'll always get the Python version.  This is so that it
gets some good exercise.  We should eventually delete that line.)

22 years agoPure Python strptime implementation by Brett Cannon. See SF patch 474274.
Guido van Rossum [Fri, 19 Jul 2002 17:04:46 +0000 (17:04 +0000)]
Pure Python strptime implementation by Brett Cannon.  See SF patch 474274.
Also adds tests.

22 years agoSilly typo. Not sure how that got in.
Michael W. Hudson [Fri, 19 Jul 2002 15:52:38 +0000 (15:52 +0000)]
Silly typo.  Not sure how that got in.

22 years agoSubstantially flesh out extended slice section. I think this is probably
Michael W. Hudson [Fri, 19 Jul 2002 15:48:56 +0000 (15:48 +0000)]
Substantially flesh out extended slice section.  I think this is probably
done now.

22 years agoA few days ago, Guido said (in the thread "[Python-Dev] Python
Michael W. Hudson [Fri, 19 Jul 2002 15:47:06 +0000 (15:47 +0000)]
A few days ago, Guido said (in the thread "[Python-Dev] Python
version of PySlice_GetIndicesEx"):

> OK.  Michael, if you want to check in indices(), go ahead.

Then I did what was needed, but didn't check it in.  Here it is.

22 years agoAdd test for previous core dump when sending on closed socket with
Guido van Rossum [Fri, 19 Jul 2002 12:46:46 +0000 (12:46 +0000)]
Add test for previous core dump when sending on closed socket with
timeout.

Added small sleeps to _testAccept() and _testRecv() in
NonBlockingTCPTests, to reduce race conditions (I know, this is not
the solution!)

22 years agoBail out early from internal_select() when socket file descriptor
Guido van Rossum [Fri, 19 Jul 2002 12:44:59 +0000 (12:44 +0000)]
Bail out early from internal_select() when socket file descriptor
closed.  Prevents core dump.

22 years agoMore sort cleanup: Moved the special cases from samplesortslice into
Tim Peters [Fri, 19 Jul 2002 07:05:44 +0000 (07:05 +0000)]
More sort cleanup:  Moved the special cases from samplesortslice into
listsort.  If the former calls itself recursively, they're a waste of
time, since it's called on a random permutation of a random subset of
elements.  OTOH, for exactly the same reason, they're an immeasurably
small waste of time (the odds of finding exploitable order in a random
permutation are ~= 0, so the special-case loops looking for order give
up quickly).  The point is more for conceptual clarity.
Also changed some "assert comments" into real asserts; when this code
was first written, Python.h didn't supply assert.h.

22 years agoLand Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT.
Mark Hammond [Fri, 19 Jul 2002 06:55:41 +0000 (06:55 +0000)]
Land Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT.

22 years agoAdd description for _XOPEN_SOURCE_ - needed to allow autoheader to succeed.
Mark Hammond [Fri, 19 Jul 2002 06:31:24 +0000 (06:31 +0000)]
Add description for _XOPEN_SOURCE_ - needed to allow autoheader to succeed.

22 years agobinarysort() cleanup: Documented the key invariants, explained why they
Tim Peters [Fri, 19 Jul 2002 06:12:32 +0000 (06:12 +0000)]
binarysort() cleanup:  Documented the key invariants, explained why they
imply this is a stable sort, and added some asserts.

22 years agolistreverse(): Don't call the new reverse_slice unless the list
Tim Peters [Fri, 19 Jul 2002 04:04:16 +0000 (04:04 +0000)]
listreverse():  Don't call the new reverse_slice unless the list
has something in it (else ob_item may be a NULL pointer).

22 years agoCleanup yielding a small speed boost: before rich comparisons were
Tim Peters [Fri, 19 Jul 2002 03:30:57 +0000 (03:30 +0000)]
Cleanup yielding a small speed boost:  before rich comparisons were
introduced, list.sort() was rewritten to use only the "< or not <?"
distinction.  After rich comparisons were introduced, docompare() was
fiddled to translate a Py_LT Boolean result into the old "-1 for <,
0 for ==, 1 for >" flavor of outcome, and the sorting code was left
alone.  This left things more obscure than they should be, and turns
out it also cost measurable cycles.

So:  The old CMPERROR novelty is gone.  docompare() is renamed to islt(),
and now has the same return conditinos as PyObject_RichCompareBool.  The
SETK macro is renamed to ISLT, and is even weirder than before (don't
complain unless you want to maintain the sort code <wink>).

Overall, this yields a 1-2% speedup in the usual (no explicit function
passed to list.sort()) case when sorting arrays of floats (as sortperf.py
does).  The boost is higher for arrays of ints.

22 years agoTrimmed trailing whitespace.
Tim Peters [Fri, 19 Jul 2002 02:35:45 +0000 (02:35 +0000)]
Trimmed trailing whitespace.

22 years agoCleanup: Define one internal utility for reversing a list slice, and
Tim Peters [Fri, 19 Jul 2002 02:33:08 +0000 (02:33 +0000)]
Cleanup:  Define one internal utility for reversing a list slice, and
use that everywhere.

22 years agoAnthony Baxter's cleanup patch. Python project SF patch # 583190,
Barry Warsaw [Thu, 18 Jul 2002 23:09:09 +0000 (23:09 +0000)]
Anthony Baxter's cleanup patch.  Python project SF patch # 583190,
quoting:

  in non-strict mode, messages don't require a blank line at the end
  with a missing end-terminator. A single newline is sufficient now.

  Handle trailing whitespace at the end of a boundary. Had to switch
  from using string.split() to re.split()

  Handle whitespace on the end of a parameter list for Content-type.

  Handle whitespace on the end of a plain content-type header.

Specifically,

get_type(): Strip the content type string.

_get_params_preserve(): Strip the parameter names and values on both
sides.

_parsebody(): Lots of changes as described above, with some stylistic
changes by Barry (who hopefully didn't screw things up ;).

22 years agoFix bug [ 549731 ] Unicode encoders appears to leak references.
Mark Hammond [Thu, 18 Jul 2002 23:06:17 +0000 (23:06 +0000)]
Fix bug [ 549731 ] Unicode encoders appears to leak references.

Python 2.2.1 bugfix candidate.

22 years agoDefine _XOPEN_SOURCE in configure and Python.h.
Jeremy Hylton [Thu, 18 Jul 2002 22:39:34 +0000 (22:39 +0000)]
Define _XOPEN_SOURCE in configure and Python.h.

This gets compilation of posixmodule.c to succeed on Tru64 and does no
harm on Linux.  We may need to undefine it on some platforms, but
let's wait and see.

Martin says:

> I think it is generally the right thing to define _XOPEN_SOURCE on
> Unix, providing a negative list of systems that cannot support this
> setting (or preferably solving whatever problems remain).
>
> I'd put an (unconditional) AC_DEFINE into configure.in early on; it
> *should* go into confdefs.h as configure proceeds, and thus be active
> when other tests are performed.

22 years agoA Python float is a C double; redeclare defaulttimeout as such; stops
Tim Peters [Thu, 18 Jul 2002 22:38:44 +0000 (22:38 +0000)]
A Python float is a C double; redeclare defaulttimeout as such; stops
compiler wngs on Windows.

22 years agoAnthony Baxter's patch to expose the parser's `strict' flag in these
Barry Warsaw [Thu, 18 Jul 2002 21:29:17 +0000 (21:29 +0000)]
Anthony Baxter's patch to expose the parser's `strict' flag in these
convenience functions.  Closes SF # 583188 (python project).