]> granicus.if.org Git - python/log
python
22 years agoPatch 550804: Make os.environ.copy() return a copy.
Martin v. Löwis [Thu, 2 May 2002 17:39:19 +0000 (17:39 +0000)]
Patch 550804: Make os.environ.copy() return a copy.

22 years agoAdded regression tests for xrange object attributes.
Fred Drake [Thu, 2 May 2002 16:07:44 +0000 (16:07 +0000)]
Added regression tests for xrange object attributes.
See SF bug #551285.

22 years agoFix attribute access for the xrange objects. The tp_getattr and tp_getattro
Fred Drake [Thu, 2 May 2002 16:05:27 +0000 (16:05 +0000)]
Fix attribute access for the xrange objects.  The tp_getattr and tp_getattro
handlers were both set, but were not compatible.  This change uses only the
tp_getattro handler with a more "modern" approach.
This fixes SF bug #551285.

22 years agoCorrect Moshe's e-mail address
Andrew M. Kuchling [Thu, 2 May 2002 14:48:26 +0000 (14:48 +0000)]
Correct Moshe's e-mail address
Point to PEP 100 for MAL's Unicode proposal
Fix URL for XML HOWTO
Bump version number

22 years agoNote that NameError's message also changed in 2.0
Andrew M. Kuchling [Thu, 2 May 2002 14:37:14 +0000 (14:37 +0000)]
Note that NameError's message also changed in 2.0

22 years agoMessage for NameError has changed
Andrew M. Kuchling [Thu, 2 May 2002 14:31:55 +0000 (14:31 +0000)]
Message for NameError has changed

22 years agoclarify message when raising TypeError to indicate that float() accepts
Skip Montanaro [Thu, 2 May 2002 13:03:22 +0000 (13:03 +0000)]
clarify message when raising TypeError to indicate that float() accepts
strings or numbers

22 years agoGuard gettext and friends with HAVE_LIBINTL_H. Fixes #549907.
Martin v. Löwis [Thu, 2 May 2002 12:16:29 +0000 (12:16 +0000)]
Guard gettext and friends with HAVE_LIBINTL_H. Fixes #549907.

22 years agoCorrect information on support for repietition & concatenation for buffer
Fred Drake [Thu, 2 May 2002 05:56:04 +0000 (05:56 +0000)]
Correct information on support for repietition & concatenation for buffer
and xrange objects.
This closes SF bug #550555.

22 years agoBuffer-object repitition and concatenation has worked all along; add a test
Fred Drake [Thu, 2 May 2002 04:27:20 +0000 (04:27 +0000)]
Buffer-object repitition and concatenation has worked all along; add a test
to make avoid regression.

22 years agoAdded some notes on setting up the documentation tools on Cygwin.
Fred Drake [Wed, 1 May 2002 22:05:30 +0000 (22:05 +0000)]
Added some notes on setting up the documentation tools on Cygwin.

22 years agoAdded more style for major warnings.
Fred Drake [Wed, 1 May 2002 22:03:40 +0000 (22:03 +0000)]
Added more style for major warnings.

22 years agoPickler_clear_memo(): convert to METH_NOARGS.
Fred Drake [Wed, 1 May 2002 20:36:39 +0000 (20:36 +0000)]
Pickler_clear_memo(): convert to METH_NOARGS.

22 years agoAdd Pickler.clear_memo() so the pickle and cPickle modules are more similar.
Fred Drake [Wed, 1 May 2002 20:33:53 +0000 (20:33 +0000)]
Add Pickler.clear_memo() so the pickle and cPickle modules are more similar.

22 years agolist_documented_items(): Basic implementation.
Fred Drake [Wed, 1 May 2002 17:25:04 +0000 (17:25 +0000)]
list_documented_items():  Basic implementation.
This still does not work well since ctags does not do a good job with the
Python headers, appearantly due to the DL_IMPORT macro.  ;-(

22 years agoExplain what os.read() returns at end of file.
Fred Drake [Wed, 1 May 2002 03:31:42 +0000 (03:31 +0000)]
Explain what os.read() returns at end of file.
This closes SF bug #550409.  Applying to release21-maint & release22-maint.

22 years agoAdd missing right-parenthesis.
Fred Drake [Wed, 1 May 2002 03:23:03 +0000 (03:23 +0000)]
Add missing right-parenthesis.

22 years agoWatch out for older XEmacsen for which requiring info-look doesn't
Barry Warsaw [Tue, 30 Apr 2002 18:58:52 +0000 (18:58 +0000)]
Watch out for older XEmacsen for which requiring info-look doesn't
define info-lookup-maybe-add-help.

22 years agomoved from Tools/scripts (was only at rev 1.1 - no changes yet - so I simply
Skip Montanaro [Tue, 30 Apr 2002 16:25:37 +0000 (16:25 +0000)]
moved from Tools/scripts (was only at rev 1.1 - no changes yet - so I simply
removed it from there and added it here)

22 years agomoving into the Doc/tools directory
Skip Montanaro [Tue, 30 Apr 2002 16:23:42 +0000 (16:23 +0000)]
moving into the Doc/tools directory

22 years agoAdd a note about when the "%r" formatting code was added.
Fred Drake [Tue, 30 Apr 2002 14:54:47 +0000 (14:54 +0000)]
Add a note about when the "%r" formatting code was added.

22 years agoadd enumobject.c to build machinery
Andrew MacIntyre [Tue, 30 Apr 2002 13:06:32 +0000 (13:06 +0000)]
add enumobject.c to build machinery

22 years agoFred's recent changes to support "-u all" resulted in subset resource
Andrew MacIntyre [Tue, 30 Apr 2002 12:11:04 +0000 (12:11 +0000)]
Fred's recent changes to support "-u all" resulted in subset resource
selections (eg "-u network") being ignored.

22 years agoadd enumobject.c to build machinery
Andrew MacIntyre [Tue, 30 Apr 2002 12:06:23 +0000 (12:06 +0000)]
add enumobject.c to build machinery

22 years agoAdded a missing "|" in the grammar productions used in the reference manual
Fred Drake [Tue, 30 Apr 2002 02:18:51 +0000 (02:18 +0000)]
Added a missing "|" in the grammar productions used in the reference manual
(reported by François Pinard).
Added some missing "_" characters in the same cluster of productions.
Added missing floor division operator in m_expr production, and mention
floor division in the relevant portion of the text.

22 years agobuiltin_zip(): Take a good guess at how big the result list will be,
Tim Peters [Mon, 29 Apr 2002 21:27:32 +0000 (21:27 +0000)]
builtin_zip():  Take a good guess at how big the result list will be,
and allocate it in one gulp.

This isn't a bugfix, it's just a minor optimization that may or may not
pay off.

22 years agoTypo: whcar_t should be wchar_t.
Thomas Heller [Mon, 29 Apr 2002 17:28:43 +0000 (17:28 +0000)]
Typo: whcar_t should be wchar_t.

Bugfix candidate? Don't know how this is handled in the docs.

22 years agoAdd some items, and remove a note to myself
Andrew M. Kuchling [Mon, 29 Apr 2002 15:42:16 +0000 (15:42 +0000)]
Add some items, and remove a note to myself

22 years agoSmall markup adjustments for consistency.
Fred Drake [Mon, 29 Apr 2002 15:17:16 +0000 (15:17 +0000)]
Small markup adjustments for consistency.

22 years agoSee discussion at SF bug 547537.
Guido van Rossum [Mon, 29 Apr 2002 13:54:48 +0000 (13:54 +0000)]
See discussion at SF bug 547537.

Unicode objects are currently taken as binary data by the write()
method.  This is not what Unicode users expect, nor what the
StringIO.py code does.  Until somebody adds a way to specify binary or
text mode for cStringIO objects, change the format string to use "t#"
instead of "s#", so that it will request the "text buffer" version.
This will try the default encoding for Unicode objects.

This is *not* a 2.2 bugfix (since it *is* a semantic change).

22 years agoMostly in SequenceMatcher.{__chain_b, find_longest_match}:
Tim Peters [Mon, 29 Apr 2002 01:37:32 +0000 (01:37 +0000)]
Mostly in SequenceMatcher.{__chain_b, find_longest_match}:
This now does a dynamic analysis of which elements are so frequently
repeated as to constitute noise.  The primary benefit is an enormous
speedup in find_longest_match, as the innermost loop can have factors
of 100s less potential matches to worry about, in cases where the
sequences have many duplicate elements.  In effect, this zooms in on
sequences of non-ubiquitous elements now.

While I like what I've seen of the effects so far, I still consider
this experimental.  Please give it a try!

22 years agoJust added comments, and cleared some XXX questions, related to int
Tim Peters [Sun, 28 Apr 2002 16:57:34 +0000 (16:57 +0000)]
Just added comments, and cleared some XXX questions, related to int
memory management.

22 years ago_PyObject_DebugCheckAddress(): If the leading pad bytes are corrupt,
Tim Peters [Sun, 28 Apr 2002 06:14:45 +0000 (06:14 +0000)]
_PyObject_DebugCheckAddress():  If the leading pad bytes are corrupt,
display a msg warning that the count of bytes requested may be bogus,
and that a segfault may happen next.

22 years agoMoving pymalloc along.
Tim Peters [Sun, 28 Apr 2002 04:11:46 +0000 (04:11 +0000)]
Moving pymalloc along.

As threatened, PyMem_{Free, FREE} also invoke the object deallocator now
when pymalloc is enabled (well, it does when pymalloc isn't enabled too,
but in that case "the object deallocator" is plain free()).

This is maximally backward-compatible, but it leaves a bitter aftertaste.

Also massive reworking of comments.

22 years ago_PyObject_GC_New: Could call PyObject_INIT with a NULL 1st argument.
Tim Peters [Sun, 28 Apr 2002 01:57:25 +0000 (01:57 +0000)]
_PyObject_GC_New:  Could call PyObject_INIT with a NULL 1st argument.
_PyObject_GC_NewVar:  Could call PyObject_INIT_VAR likewise.

Bugfix candidate.

22 years agoRepair widespread misuse of _PyString_Resize. Since it's clear people
Tim Peters [Sat, 27 Apr 2002 18:44:32 +0000 (18:44 +0000)]
Repair widespread misuse of _PyString_Resize.  Since it's clear people
don't understand how this function works, also beefed up the docs.  The
most common usage error is of this form (often spread out across gotos):

if (_PyString_Resize(&s, n) < 0) {
Py_DECREF(s);
s = NULL;
goto outtahere;
}

The error is that if _PyString_Resize runs out of memory, it automatically
decrefs the input string object s (which also deallocates it, since its
refcount must be 1 upon entry), and sets s to NULL.  So if the "if"
branch ever triggers, it's an error to call Py_DECREF(s):  s is already
NULL!  A correct way to write the above is the simpler (and intended)

if (_PyString_Resize(&s, n) < 0)
goto outtahere;

Bugfix candidate.

22 years agoSF patch 549375: Compromise PyUnicode_EncodeUTF8
Tim Peters [Sat, 27 Apr 2002 18:03:26 +0000 (18:03 +0000)]
SF patch 549375:  Compromise PyUnicode_EncodeUTF8
This implements ideas from Marc-Andre, Martin, Guido and me on Python-Dev.

"Short" Unicode strings are encoded into a "big enough" stack buffer,
then exactly as much string space as they turn out to need is allocated
at the end.  This should have speed benefits akin to Martin's "measure
once, allocate once" strategy, but without needing a distinct measuring
pass.

"Long" Unicode strings allocate as much heap space as they could possibly
need (4 x # Unicode chars), and do a realloc at the end to return the
untouched excess.  Since the overallocation is likely to be substantial,
this shouldn't burden the platform realloc with unusably small excess
blocks.

Also simplified uses of the PyString_xyz functions.  Also added a release-
build check that 4*size doesn't overflow a C int.  Sooner or later, that's
going to happen.

22 years agoTeach the Windows build about the new enumobject.c file.
Tim Peters [Fri, 26 Apr 2002 21:20:02 +0000 (21:20 +0000)]
Teach the Windows build about the new enumobject.c file.

22 years agoSlightly expand and clarify the differences between getegid(), getgid(),
Fred Drake [Fri, 26 Apr 2002 20:59:40 +0000 (20:59 +0000)]
Slightly expand and clarify the differences between getegid(), getgid(),
getpgrp(), and setpgid().
This closes SF bug #547939.

22 years agoBe more consistent, both internally and with recommended practice.
Fred Drake [Fri, 26 Apr 2002 20:44:14 +0000 (20:44 +0000)]
Be more consistent, both internally and with recommended practice.
This closes SF bug #547953.

22 years agoDocumentation for the enumerate() function/type.
Fred Drake [Fri, 26 Apr 2002 20:29:44 +0000 (20:29 +0000)]
Documentation for the enumerate() function/type.
This closes SF patch #547162.

22 years agoClarify that the strip changes also apply to Unicode.
Guido van Rossum [Fri, 26 Apr 2002 20:11:29 +0000 (20:11 +0000)]
Clarify that the strip changes also apply to Unicode.

22 years ago- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum [Fri, 26 Apr 2002 19:40:56 +0000 (19:40 +0000)]
- New builtin function enumerate(x), from PEP 279.  Example:
  enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c").
  The argument can be an arbitrary iterable object.

22 years ago(py-comint-output-filter-function): Put the pop-to-buffer call inside
Barry Warsaw [Fri, 26 Apr 2002 15:49:52 +0000 (15:49 +0000)]
(py-comint-output-filter-function): Put the pop-to-buffer call inside
the `when' condition so other non-Python shell comint changes won't
cause random buffers to pop.

22 years agoPyNumber_CoerceEx: this took a shortcut (not doing anything) when the
Guido van Rossum [Fri, 26 Apr 2002 02:49:14 +0000 (02:49 +0000)]
PyNumber_CoerceEx: this took a shortcut (not doing anything) when the
left and right type were of the same type and not classic instances.

This shortcut is dangerous for proxy types, because it means that
coerce(Proxy(1), Proxy(2.1)) leaves Proxy(1) unchanged rather than
turning it into Proxy(1.0).

In an ever-so-slight change of semantics, I now only take the shortcut
when the left and right types are of the same type and don't have the
CHECKTYPES feature.  It so happens that classic instances have this
flag, so the shortcut is still skipped in this case (i.e. nothing
changes for classic instances).  Proxies also have this flag set
(otherwise implementing numeric operations on proxies would become
nightmarish) and this means that the shortcut is also skipped there,
as desired.  It so happens that int, long and float also have this
flag set; that means that e.g. coerce(1, 1) will now invoke
int_coerce().  This is fine: int_coerce() can deal with this, and I'm
not worried about the performance; int_coerce() is only invoked when
the user explicitly calls coerce(), which should be rarer than rare.

22 years agoClean up uses of some deprecated features.
Fred Drake [Fri, 26 Apr 2002 02:29:55 +0000 (02:29 +0000)]
Clean up uses of some deprecated features.
Reported by Neal Norwitz on python-dev.

22 years agoIf Py_OptimizeFlag is false then always evaluate assert conditions, don't
Neil Schemenauer [Fri, 26 Apr 2002 01:58:53 +0000 (01:58 +0000)]
If Py_OptimizeFlag is false then always evaluate assert conditions, don't
test __debug__ at runtime.  Closes SF patch #548833.

22 years agoMake sure that tp_free frees the int the same way as tp_dealloc would.
Guido van Rossum [Fri, 26 Apr 2002 00:53:34 +0000 (00:53 +0000)]
Make sure that tp_free frees the int the same way as tp_dealloc would.
This fixes the problem that Barry reported on python-dev:
   >>> 23000 .__class__ = bool
crashes in the deallocator.  This was because int inherited tp_free
from object, which uses the default allocator.

2.2. Bugfix candidate.

22 years agoFix typo in the setup of interpreter-mode-alist.
Barry Warsaw [Thu, 25 Apr 2002 21:46:33 +0000 (21:46 +0000)]
Fix typo in the setup of interpreter-mode-alist.

22 years agoSF patch #510288 by Kevin J. Butler, mod'd by Barry. This provides
Barry Warsaw [Thu, 25 Apr 2002 21:31:47 +0000 (21:31 +0000)]
SF patch #510288 by Kevin J. Butler, mod'd by Barry.  This provides
better auto-recognition of a Jython file vs. a CPython (or agnostic)
file by looking at the #! line more closely, and inspecting the import
statements in the first 20000 bytes (configurable).  Specifically,

(py-import-check-point-max): New variable, controlling how far into
the buffer it will search for import statements.

(py-jpython-packages): List of package names that are Jython-ish.

(py-shell-alist): List of #! line programs and the modes associated
with them.

(jpython-mode-hook): Extra hook that runs when entering jpython-mode
(what about Jython mode? <20k wink>).

(py-choose-shell-by-shebang, py-choose-shell-by-import,
py-choose-shell): New functions.

(python-mode): Use py-choose-shell.

(jpython-mode): New command.

(py-execute-region): Don't use my previous hacky attempt at doing
this, use the new py-choose-shell function.

One other thing this file now does: it attempts to add the proper
hooks to interpreter-mode-alist and auto-mode-alist if they aren't
already there.  Might help with Emacs users since that editor doesn't
come with python-mode by default.

22 years agoClean up the layout of the bool_as_number struct initializer.
Guido van Rossum [Thu, 25 Apr 2002 20:01:10 +0000 (20:01 +0000)]
Clean up the layout of the bool_as_number struct initializer.

22 years ago(py-execute-region): Alexander Schmolck points out that leading
Barry Warsaw [Thu, 25 Apr 2002 19:17:42 +0000 (19:17 +0000)]
(py-execute-region): Alexander Schmolck points out that leading
whitespace can hose the needs-if test.  So just skip all blank lines
at the start of the region right off the bat.

22 years agoPass the full pathname to MSVC when compiling a debug version. This
Thomas Heller [Thu, 25 Apr 2002 17:29:45 +0000 (17:29 +0000)]
Pass the full pathname to MSVC when compiling a debug version. This
allows the debugger to find the source without asking the user to
browse for it.

22 years agoAppend the PC specific include 'PC' and library 'PCBuild' directories
Thomas Heller [Thu, 25 Apr 2002 17:26:37 +0000 (17:26 +0000)]
Append the PC specific include 'PC' and library 'PCBuild' directories
under NT - this allows distutils to work with the CVS version or the
source distribution.

Wrap a long line.

22 years agoFix trivial typo.
Thomas Heller [Thu, 25 Apr 2002 17:03:30 +0000 (17:03 +0000)]
Fix trivial typo.

22 years ago(py-comint-output-filter-function): Add a pop-to-buffer call so you
Barry Warsaw [Thu, 25 Apr 2002 16:26:38 +0000 (16:26 +0000)]
(py-comint-output-filter-function): Add a pop-to-buffer call so you
always get to see the result of e.g. a py-execute-region.  Funny, this
bugged both me /and/ Guido!

22 years ago(py-shell-hook): A new hook variable, run at the end of py-shell.
Barry Warsaw [Thu, 25 Apr 2002 15:44:17 +0000 (15:44 +0000)]
(py-shell-hook): A new hook variable, run at the end of py-shell.
Allows for some customization of the underlying comint buffer.

(py-shell): Call the new hook.

(info-lookup-maybe-add-help): A new call suggested by Milan Zamazal to
make lookups in the Info documentation easier.

22 years agoRegenerated.
Jack Jansen [Wed, 24 Apr 2002 09:13:24 +0000 (09:13 +0000)]
Regenerated.

Bugfix candidate.

22 years agoFix a small mistake and complete some function prototypes.
Thomas Heller [Wed, 24 Apr 2002 06:35:11 +0000 (06:35 +0000)]
Fix a small mistake and complete some function prototypes.
SF Patch #547813.

22 years agoAdd more tests for abstract isinstance() and issubclass().
Neil Schemenauer [Wed, 24 Apr 2002 03:33:02 +0000 (03:33 +0000)]
Add more tests for abstract isinstance() and issubclass().

22 years agotest_resource has no chance of running on Windows.
Tim Peters [Tue, 23 Apr 2002 23:09:02 +0000 (23:09 +0000)]
test_resource has no chance of running on Windows.

22 years agotest_mmap started breaking on Windows, only when run after test_bsddb.
Tim Peters [Tue, 23 Apr 2002 23:07:28 +0000 (23:07 +0000)]
test_mmap started breaking on Windows, only when run after test_bsddb.
On Win2K it thought 'foo' started at byte offset 0 instead of at the
pagesize, and on Win98 it thought 'foo' didn't exist at all.  Somehow
or other this is related to the new "in memory file" gimmicks in
bsddb, but the old bsddb we use on Windows sucks so bad anyway I don't
want to bother digging deeper.  Flushing the file in test_mmap after
writing to it makes the problem go away, so good enough.

22 years agoUnit tests for the changes in abstract.c version 2.101. The debug
Barry Warsaw [Tue, 23 Apr 2002 22:48:42 +0000 (22:48 +0000)]
Unit tests for the changes in abstract.c version 2.101.  The debug
build's "undetected error" problems were originally detected with
extension types, but we can whitebox test the same situations with
new-style classes.

22 years agoRegenerated.
Jack Jansen [Tue, 23 Apr 2002 22:46:01 +0000 (22:46 +0000)]
Regenerated.

22 years agoabstract_get_bases(): Clarify exactly what the return values and
Barry Warsaw [Tue, 23 Apr 2002 22:45:44 +0000 (22:45 +0000)]
abstract_get_bases(): Clarify exactly what the return values and
states can be for this function, and ensure that only AttributeErrors
are masked.  Any other exception raised via the equivalent of
getattr(cls, '__bases__') should be propagated up.

abstract_issubclass(): If abstract_get_bases() returns NULL, we must
call PyErr_Occurred() to see if an exception is being propagated, and
return -1 or 0 as appropriate.  This is the specific fix for a problem
whereby if getattr(derived, '__bases__') raised an exception, an
"undetected error" would occur (under a debug build).  This nasty
situation was uncovered when writing a security proxy extension type
for the Zope3 project, where the security proxy raised a Forbidden
exception on getattr of __bases__.

PyObject_IsInstance(), PyObject_IsSubclass(): After both calls to
abstract_get_bases(), where we're setting the TypeError if the return
value is NULL, we must first check to see if an exception occurred,
and /not/ mask an existing exception.

Neil Schemenauer should double check that these changes don't break
his ExtensionClass examples (there aren't any test cases for those
examples and abstract_get_bases() was added by him in response to
problems with ExtensionClass).  Neil, please add test cases if
possible!

I belive this is a bug fix candidate for Python 2.2.2.

22 years agoConverted to use re in stead of regex and regsub (finally:-).
Jack Jansen [Tue, 23 Apr 2002 22:43:37 +0000 (22:43 +0000)]
Converted to use re in stead of regex and regsub (finally:-).

22 years agoRewrote the PyUnit description so that it now recommends to use
Barry Warsaw [Tue, 23 Apr 2002 21:39:00 +0000 (21:39 +0000)]
Rewrote the PyUnit description so that it now recommends to use
run_suite() instead of run_unittest().  Best practice is to plan for
multiple test classes.

22 years agoAdd text about circular references caused by storing frames in local
Fred Drake [Tue, 23 Apr 2002 21:21:20 +0000 (21:21 +0000)]
Add text about circular references caused by storing frames in local
variables.  This closes SF bug #543148.

22 years agoSecond part of fix for #493826: regenerated suite modules so errn exists but == 0...
Jack Jansen [Tue, 23 Apr 2002 21:08:54 +0000 (21:08 +0000)]
Second part of fix for #493826: regenerated suite modules so errn exists but == 0 doesn't signal an error.

Bugfix candidate.

22 years agoFirst part of fix for #493826: if 'errn' key exists in return value this doesn't...
Jack Jansen [Tue, 23 Apr 2002 21:03:21 +0000 (21:03 +0000)]
First part of fix for #493826: if 'errn' key exists in return value this doesn't necesarily signal an error, only if the value is non-zero it does. This
does not correspond with my reading of the documentation, but the OSX Finder can return 'errn'=0, and it knows better than me:-)

Bugfix candidate.

22 years agoIgnore SIGXFSZ.
Jeremy Hylton [Tue, 23 Apr 2002 20:31:01 +0000 (20:31 +0000)]
Ignore SIGXFSZ.

The SIGXFSZ signal is sent when the maximum file size limit is
exceeded (RLIMIT_FSIZE).  Apparently, it is also sent when the 2GB
file limit is reached on platforms without large file support.

The default action for SIGXFSZ is to terminate the process and dump
core.  When it is ignored, the system call that caused the limit to be
exceeded returns an error and sets errno to EFBIG.  Python
always checks errno on I/O syscalls, so there is nothing to do with
the signal.

22 years agoAdd tests for the recent resource module change.
Jeremy Hylton [Tue, 23 Apr 2002 20:21:22 +0000 (20:21 +0000)]
Add tests for the recent resource module change.
Also add a test that Python doesn't die with SIGXFSZ if it exceeds the
file rlimit.  (Assuming this will also test the behavior when the 2GB
limit is exceed on a platform that doesn't have large file support.)

22 years agoCheck for overflow errors in setrlimit(),
Jeremy Hylton [Tue, 23 Apr 2002 20:15:04 +0000 (20:15 +0000)]
Check for overflow errors in setrlimit(),
and reflow a long line.

22 years agoMinor change to an index entry.
Fred Drake [Tue, 23 Apr 2002 20:04:46 +0000 (20:04 +0000)]
Minor change to an index entry.

22 years agoClarify return value of PyLong_AsLongLong().
Jeremy Hylton [Tue, 23 Apr 2002 20:01:20 +0000 (20:01 +0000)]
Clarify return value of PyLong_AsLongLong().

The function is documented to return -1 on error.  If res was < 0, it
returned res.  It wasn't clear that the invariant was res < 0 iff res
== -1.

22 years agoBackport of 1.6.4.2.2.3 from release22-maint branch.
Jack Jansen [Tue, 23 Apr 2002 19:59:03 +0000 (19:59 +0000)]
Backport of 1.6.4.2.2.3 from release22-maint branch.

22 years agoUpdated URL.
Jack Jansen [Tue, 23 Apr 2002 19:56:20 +0000 (19:56 +0000)]
Updated URL.

22 years agoBackport of select parts of release22-maint (up to 1.38.4.2.2.3).
Jack Jansen [Tue, 23 Apr 2002 19:50:53 +0000 (19:50 +0000)]
Backport of select parts of release22-maint (up to 1.38.4.2.2.3).

22 years agoWhitespace normalization. Unka Timmy would be proud.
Barry Warsaw [Tue, 23 Apr 2002 18:18:43 +0000 (18:18 +0000)]
Whitespace normalization.  Unka Timmy would be proud.

22 years agoClarify the return value of PyObject_IsInstance().
Fred Drake [Tue, 23 Apr 2002 18:15:44 +0000 (18:15 +0000)]
Clarify the return value of PyObject_IsInstance().

22 years agoWCOREDUMP(), WIFCONTINUED(), WCONTINUED, WUNTRACED: New.
Fred Drake [Tue, 23 Apr 2002 15:58:02 +0000 (15:58 +0000)]
WCOREDUMP(), WIFCONTINUED(), WCONTINUED, WUNTRACED:  New.

isatty(), WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(): Changed to return
    bools instead of ints.

22 years agoSF patch 546244 by John Williams: add Text.dump() method.
Guido van Rossum [Tue, 23 Apr 2002 13:29:43 +0000 (13:29 +0000)]
SF patch 546244 by John Williams: add Text.dump() method.

22 years agoAdd warning about the HP PA-RISC 2.0 C compiler's optimizer.
Guido van Rossum [Tue, 23 Apr 2002 13:06:07 +0000 (13:06 +0000)]
Add warning about the HP PA-RISC 2.0 C compiler's optimizer.

22 years agoThere was a non-ascii character in the source. Replaced by a hex escape.
Jack Jansen [Tue, 23 Apr 2002 10:52:44 +0000 (10:52 +0000)]
There was a non-ascii character in the source. Replaced by a hex escape.

22 years agowhitespace fixup. test__all__ and test_sundry were failing
Anthony Baxter [Tue, 23 Apr 2002 02:38:39 +0000 (02:38 +0000)]
whitespace fixup. test__all__ and test_sundry were failing
for me on linux because of the inconsistent whitespace.

22 years agodon't fail if the audio device is busy, just skip.
Anthony Baxter [Tue, 23 Apr 2002 02:20:46 +0000 (02:20 +0000)]
don't fail if the audio device is busy, just skip.
SF patch 545486

22 years agoSF patch [ 545523 ] patch for 514433 bsddb.dbopen (NULL)
Anthony Baxter [Tue, 23 Apr 2002 02:11:05 +0000 (02:11 +0000)]
SF patch  [ 545523 ] patch for 514433 bsddb.dbopen (NULL)
closes SF #514433

can now pass 'None' as the filename for the bsddb.*open functions,
and you'll get an in-memory temporary store.

docs are ripped out of the bsddb dbopen man page. Fred may want to
clean them up.

Considering this for 2.2, but not 2.1.

22 years agoMerge in Skip's last few updates w.r.t. py-help-at-point:
Barry Warsaw [Mon, 22 Apr 2002 22:05:49 +0000 (22:05 +0000)]
Merge in Skip's last few updates w.r.t. py-help-at-point:

(py-mode-map): Bind py-help-at-point to f1 as well as C-c C-h

(py-help-at-point): Make sure the symbol is quoted so things like
pydoc.help('sys.platform') work correctly.  Also, leave the *Python
Output* buffer in help-mode; this may be a bit more controversial.

22 years agoSome contributions and ideas by Alexander Schmolck: add a keybinding
Barry Warsaw [Mon, 22 Apr 2002 21:48:20 +0000 (21:48 +0000)]
Some contributions and ideas by Alexander Schmolck: add a keybinding
to call pychecker on the current file, add a face for pseudo
keywords self, None, True, False, and Ellipsis.  Specifically,

(py-pychecker-command, py-pychecker-command-args): New variables.

(py-pseudo-keyword-face): New face variable, defaulting to a copy of
font-lock-keyword-face.

(python-font-lock-keywords): Add an entry for self, None, True, False,
Ellipsis to be rendered in py-pseudo-keyword-face.

(py-pychecker-history): New variable.

(py-mode-map): Bind C-c C-w to py-pychecker-run.

(py-pychecker-run): New command.

22 years agounicode_memchr(): Squashed gratuitous int-vs-size_t mismatch (which
Tim Peters [Mon, 22 Apr 2002 19:00:10 +0000 (19:00 +0000)]
unicode_memchr():  Squashed gratuitous int-vs-size_t mismatch (which
gives a compiler wng under MSVC because of the resulting signed-vs-
unsigned comparison).

22 years agoSF bug 546078: IDLE calltips cause application error.
Tim Peters [Mon, 22 Apr 2002 18:43:49 +0000 (18:43 +0000)]
SF bug 546078:  IDLE calltips cause application error.
Assorted crashes on Windows and Linux when trying to display a very
long calltip, most likely a Tk bug.  Wormed around by clamping the
calltip display to a maximum of 79 characters (why 79? why not ...).

Bugfix candidate, for all Python releases.

22 years agoApply patch diff.txt from SF feature request
Walter Dörwald [Mon, 22 Apr 2002 17:42:37 +0000 (17:42 +0000)]
Apply patch diff.txt from SF feature request
http://www.python.org/sf/444708

This adds the optional argument for str.strip
to unicode.strip too and makes it possible
to call str.strip with a unicode argument
and unicode.strip with a str argument.

22 years agoSkip Montanaro's contribution (slightly mod'd by Barry) to provide a
Barry Warsaw [Mon, 22 Apr 2002 17:15:19 +0000 (17:15 +0000)]
Skip Montanaro's contribution (slightly mod'd by Barry) to provide a
"help-on-symbol-at-point" feature which uses pydoc to provide help on
the symbol under point, if available.

Mods include some name changes, a port to Emacs, binding the command
to C-c C-h, and providing a more informative error message if the
symbol's help can't be found (through use of a nasty bare except).

Note also that py-describe-mode has been moved off of C-c C-h m; it's
now just available on C-c ?

Closes SF patch #545439.

22 years ago(py-execute-region): If the line at the beginning of the region is a
Barry Warsaw [Mon, 22 Apr 2002 16:23:29 +0000 (16:23 +0000)]
(py-execute-region): If the line at the beginning of the region is a
#! line, use the command on that line as the shell command to use to
execute the region.  I.e. if the region looks like

----------------
#! /usr/bin/env python1.5

print 'hello world'.startswith('hello')
----------------

you'll get an exception! :)

This closes SF bug #232398.

22 years ago(py-execute-region): If you ran this without having visited a
Barry Warsaw [Mon, 22 Apr 2002 15:29:27 +0000 (15:29 +0000)]
(py-execute-region): If you ran this without having visited a
python-mode file, py-which-shell would have been nil and the command
to use would not get set correctly.  This changes things so that 1)
the temporary file has a .py extension, 2) the temporary file is put
into python-mode, and 3) the temporary file's py-which-shell is
captured in a local `shell' variable, which is used to calculate the
command to use.  Closes SF bug #545436.

(py-parse-state): Rip out the XEmacs-specific calls to
buffer-syntactic-context, which can get quite confused if there's an
open paren in column zero say, embedded in a triple quoted string.
This was always a performance hack anyway, and computers are fast
enough now that we should be able to get away with the slower, more
portable, full-parse branch.  Closes SF bug #451841.

Update the comments at the top of the file.

22 years agoAdded Christopher Smith.
Jack Jansen [Mon, 22 Apr 2002 13:56:25 +0000 (13:56 +0000)]
Added Christopher Smith.

22 years agoFixes based on ideas from Christopher Smith:
Jack Jansen [Mon, 22 Apr 2002 13:55:43 +0000 (13:55 +0000)]
Fixes based on ideas from Christopher Smith:
- islink() now returns true for alias files
- walk() no longer follows aliases while traversing
- realpath() implemented, returning an alias-free pathname.

As this could conceivably break existing code I think it isn't a bugfix candidate.

22 years agoRemoved note on test_time failing.
Jack Jansen [Mon, 22 Apr 2002 11:46:16 +0000 (11:46 +0000)]
Removed note on test_time failing.

Bugfix candidate.

22 years agoRegenerated to include Internet Config error strings.
Jack Jansen [Mon, 22 Apr 2002 11:45:46 +0000 (11:45 +0000)]
Regenerated to include Internet Config error strings.

Bugfix candidate.

22 years agoAdded an optional file with MacErrors.h extensions: IC errors aren't in there.
Jack Jansen [Mon, 22 Apr 2002 11:44:26 +0000 (11:44 +0000)]
Added an optional file with MacErrors.h extensions: IC errors aren't in there.

Bugfix candidate.