]> granicus.if.org Git - python/log
python
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.

22 years agoPy_GETENV is used by obmalloc and needs Py_IgnoreEnvironmentFlag. Provide it.
Neil Schemenauer [Mon, 22 Apr 2002 03:29:32 +0000 (03:29 +0000)]
Py_GETENV is used by obmalloc and needs Py_IgnoreEnvironmentFlag.  Provide it.

22 years agopgen now needs pymalloc
Neil Schemenauer [Mon, 22 Apr 2002 03:05:25 +0000 (03:05 +0000)]
pgen now needs pymalloc

22 years agoMoving pymalloc along.
Tim Peters [Mon, 22 Apr 2002 02:33:27 +0000 (02:33 +0000)]
Moving pymalloc along.

+ Redirect PyMem_{Del, DEL} to the object allocator's free() when
  pymalloc is enabled.  Needed so old extensions can continue to
  mix PyObject_New with PyMem_DEL.

+ This implies that pgen needs to be able to see the PyObject_XYZ
  declarations too.  pgenheaders.h now includes Python.h.  An
  implication is that I expect obmalloc.o needs to get linked into
  pgen on non-Windows boxes.

+ When PYMALLOC_DEBUG is defined, *all* Py memory API functions
  now funnel through the debug allocator wrapper around pymalloc.
  This is the default in a debug build.

+ That caused compile.c to fail:  it indirectly mixed PyMem_Malloc
  with raw platform free() in one place.  This is verbotten.

22 years agotracking python idle changes:
Steven M. Gava [Mon, 22 Apr 2002 00:42:42 +0000 (00:42 +0000)]
tracking python idle changes:
Provisional fix for writefile() [SF bug # 541730]

22 years agoUpdate the Windows makefile for 2.3.
Tim Peters [Mon, 22 Apr 2002 00:39:44 +0000 (00:39 +0000)]
Update the Windows makefile for 2.3.

22 years agotracking python idle changes:
Steven M. Gava [Mon, 22 Apr 2002 00:38:26 +0000 (00:38 +0000)]
tracking python idle changes:
Patch #540583: Open MS Help Docs if available.

22 years ago#546156, Remove load_false()/load_true(), they are not used
Neal Norwitz [Sun, 21 Apr 2002 23:44:34 +0000 (23:44 +0000)]
#546156, Remove load_false()/load_true(), they are not used

22 years agoPy_UniversalNewlineFread(): small speed boost on non-Windows boxes.
Tim Peters [Sun, 21 Apr 2002 18:15:20 +0000 (18:15 +0000)]
Py_UniversalNewlineFread():  small speed boost on non-Windows boxes.

22 years agoPyUnicode_EncodeUTF8(): tightened the memory asserts a bit, and at least
Tim Peters [Sun, 21 Apr 2002 17:28:06 +0000 (17:28 +0000)]
PyUnicode_EncodeUTF8():  tightened the memory asserts a bit, and at least
tried to catch some possible arithmetic overflows in the debug build.

22 years ago#544265, Remove warnings for passing const to free()
Neal Norwitz [Sun, 21 Apr 2002 15:03:18 +0000 (15:03 +0000)]
#544265, Remove warnings for passing const to free()

22 years agoBack out 2.140.
Martin v. Löwis [Sun, 21 Apr 2002 09:59:45 +0000 (09:59 +0000)]
Back out 2.140.

22 years agoEnable universal newlines on Windows. Note that NEWS needs more words!
Tim Peters [Sun, 21 Apr 2002 07:30:30 +0000 (07:30 +0000)]
Enable universal newlines on Windows.  Note that NEWS needs more words!

22 years agoPy_UniversalNewlineFread(): Many changes.
Tim Peters [Sun, 21 Apr 2002 07:29:14 +0000 (07:29 +0000)]
Py_UniversalNewlineFread():  Many changes.

+ Continued looping until n bytes in the buffer have been filled, not
  just when n bytes have been read from the file.  This repairs the
  bug that f.readlines() only sucked up the first 8192 bytes of the file
  on Windows when universal newlines was enabled and f was opened in
  U mode (see Python-Dev -- this was the ultimate cause of the
  test_inspect.py failure).

+ Changed prototye to take a char* buffer (void* doesn't make much sense).

+ Squashed size_t vs int mismatches (in particular, besides the unsigned
  vs signed distinction, size_t may be larger than int).

+ Gets out under all error conditions now (it's possible for fread() to
  suffer an error even if it returns a number larger than 0 -- any
  "short read" is an error or EOF condition).

+ Rearranged and simplified declarations.

22 years agoAssorted code cleanups for readability. Greatly boosted the size of the
Tim Peters [Sun, 21 Apr 2002 06:12:02 +0000 (06:12 +0000)]
Assorted code cleanups for readability.  Greatly boosted the size of the
test data:  this test fails on WIndows now if universal newlines are
enabled (which they aren't yet, by default).  I don't know whether the
test will also fail on Linux now.

22 years agoHack around the "2.1.6 Blank lines" bug in a way that the TOC still
Tim Peters [Sun, 21 Apr 2002 04:44:11 +0000 (04:44 +0000)]
Hack around the "2.1.6 Blank lines" bug in a way that the TOC still
displays a recognizable section title (there are extra blanks at the
end of it now, due to the nested anchor, but that's fine).

22 years agoPyUnicode_EncodeUTF8: squash compiler wng. The difference of two
Tim Peters [Sun, 21 Apr 2002 03:26:37 +0000 (03:26 +0000)]
PyUnicode_EncodeUTF8:  squash compiler wng.  The difference of two
pointers is a signed type.  Changing "allocated" to a signed int makes
undetected overflow more likely, but there was no overflow detection
before either.

22 years agoGive the Help viewer a font-size button. This isn't documented by MS,
Tim Peters [Sun, 21 Apr 2002 02:01:01 +0000 (02:01 +0000)]
Give the Help viewer a font-size button.  This isn't documented by MS,
but is documented by others on the web, and the defn of the magic flag
needed appears in MS's htmlhelp.h header file.

22 years agoMove "everything left one": the TOC now shows each doc directory as a
Tim Peters [Sat, 20 Apr 2002 21:34:34 +0000 (21:34 +0000)]
Move "everything left one":  the TOC now shows each doc directory as a
distinct top-level node.  Before they were all nested under an artificial
top-level node, uselessly chewing up horizontal space, and ensuring that
the only thing the user saw in the TOC upon opening the file was a single
collapsed top-level folder.

22 years agoStopped all warnings from the HTML Help Compiler, by generating proper
Tim Peters [Sat, 20 Apr 2002 20:26:26 +0000 (20:26 +0000)]
Stopped all warnings from the HTML Help Compiler, by generating proper
HTML (or, at least, proper in its view).  The TOC file is now identical
to what the HTML compiler itself generates, except for whitespace and
a glitch identified below.  The pretty-printing done by prechm.py is
pretty much destroyed for now; if you need it pretty-printed, just make
the Help Compiler save the files (it's got its own idea of pretty-
printing anyway).

Glitch:  The title of Ref Man "2.1.6 Blank lines" shows up as a blank
for now.  This is because the relevant entry in ref/index.html contains
nested anchors, and pychm really has no idea what to do with that.  I
hacked it for now to avoid any error messages or worse insanity, and
filed a bug report against the docs.

22 years ago#546163, fix link problem on Solaris 8 for makedev when using mknod
Neal Norwitz [Sat, 20 Apr 2002 13:46:43 +0000 (13:46 +0000)]
#546163, fix link problem on Solaris 8 for makedev when using mknod

22 years agoPatch #495401: Count number of required bytes for encoding UTF-8 before
Martin v. Löwis [Sat, 20 Apr 2002 13:44:01 +0000 (13:44 +0000)]
Patch #495401: Count number of required bytes for encoding UTF-8 before
allocating the target buffer.

22 years agoWidespread: Used classes in a more natural way. Added convenience
Tim Peters [Sat, 20 Apr 2002 08:36:42 +0000 (08:36 +0000)]
Widespread:  Used classes in a more natural way.  Added convenience
methods to squash code duplication.  Simplified several overly complex
chunks of logic.  Built output strings more with string interpolation
instead of infix '+'.  Added comments.  Exploited recent Python features
(chiefly bool and augmented assignment).

22 years agoForward port of patch # 500311: Work around for buggy https servers.
Martin v. Löwis [Sat, 20 Apr 2002 07:47:40 +0000 (07:47 +0000)]
Forward port of patch # 500311: Work around for buggy https servers.
Fixes #494762.

22 years agoAdd test for eval() w/ free variables.
Jeremy Hylton [Sat, 20 Apr 2002 04:51:39 +0000 (04:51 +0000)]
Add test for eval() w/ free variables.

Related to SF bug #505315

22 years agoFix SF bug #505315: Make free and cell vars show up consistently in locals().
Jeremy Hylton [Sat, 20 Apr 2002 04:46:55 +0000 (04:46 +0000)]
Fix SF bug #505315: Make free and cell vars show up consistently in locals().

PyFrame_FastToLocals() and PyFrame_LocalsToFast() had a return if
f_nlocals was 0.  I think this was a holdover from the pre 2.1 days
when regular locals were the only kind of local variables.

The change makes it possible to use a free variable in eval or exec if
it the variable is also used elsewhere in the same block, which is
what the documentation says.

22 years agoReplaced the fiddly 5-tuples with a new Book convenience class, allowing
Tim Peters [Sat, 20 Apr 2002 03:25:02 +0000 (03:25 +0000)]
Replaced the fiddly 5-tuples with a new Book convenience class, allowing
to reference fields via names instead of meaningless little integers.
This turned up one case where the wrong little integer was being used,
in informative progress output.  Fixed that too.

22 years agoFixed a comment.
Tim Peters [Sat, 20 Apr 2002 02:56:20 +0000 (02:56 +0000)]
Fixed a comment.

22 years agoAll over: get rid of blanks before colons that open code blocks.
Tim Peters [Sat, 20 Apr 2002 02:39:44 +0000 (02:39 +0000)]
All over:  get rid of blanks before colons that open code blocks.

22 years agodo_project(): Modernized the code.
Tim Peters [Sat, 20 Apr 2002 02:37:07 +0000 (02:37 +0000)]
do_project():  Modernized the code.

22 years agoAdded "What's New" to the 2.2 doc set.
Tim Peters [Sat, 20 Apr 2002 02:07:58 +0000 (02:07 +0000)]
Added "What's New" to the 2.2 doc set.

22 years agoFix com_arglist() and update grammar fragment.
Jeremy Hylton [Fri, 19 Apr 2002 22:56:37 +0000 (22:56 +0000)]
Fix com_arglist() and update grammar fragment.
SF bug #522264 reported by Evelyn Mitchell.

The code included a comment about "STAR STAR" which was translated
into the code as the bogus attribute token.STARSTAR.  This name never
caused an attribute error because it was never retrieved.  The code
was based on an old version of the grammar that specified kwargs as
two tokens ('*' '*').  I checked as far back as 2.1 and didn't find
this production.

The fix is simple, because token.DOUBLESTAR is the only token
allowed.  Also update the grammar fragment in com_arglist().

XXX I'll bet lots of other grammar fragments in comments are out of
date, probably in this module and in compile.c.

22 years agoPatch #546194: Check constants individually. Fixes 534143 on OpenBSD.
Martin v. Löwis [Fri, 19 Apr 2002 21:04:41 +0000 (21:04 +0000)]
Patch #546194: Check constants individually. Fixes 534143 on OpenBSD.
Will backport to 2.2.

22 years agoAdded a stop-list to reduce the size of the full text search index. Fred,
Tim Peters [Fri, 19 Apr 2002 18:41:46 +0000 (18:41 +0000)]
Added a stop-list to reduce the size of the full text search index.  Fred,
populate the "stop_list" triple-quoted string with your favorite handful
of stop words.

22 years agoproject_template: use dict interpolation instead of giant tuples.
Tim Peters [Fri, 19 Apr 2002 18:07:52 +0000 (18:07 +0000)]
project_template:  use dict interpolation instead of giant tuples.

22 years ago+ Changed TOC to folder-tree style.
Tim Peters [Fri, 19 Apr 2002 16:46:43 +0000 (16:46 +0000)]
+ Changed TOC to folder-tree style.
+ Increased size of the window the user sees the first time.
+ Arranged for the display to remember its last size and position.
+ Added a Favorites (bookmarks) tab.
+ Added the "Advanced Search" decorations.

22 years agoGenerates inputs to the Microsoft Help Compiler, which creates compiled
Tim Peters [Fri, 19 Apr 2002 16:09:26 +0000 (16:09 +0000)]
Generates inputs to the Microsoft Help Compiler, which creates compiled
HTML help files (.chm).  Obtained from Robin Dunn's packaging of the
2.2 docs at <http://alldunn.com/python/>, obtained in turn from
Hernán Martínez Foffani's original work at
<http://www.orgmf.com.ar/condor/pytstuff.html>.

22 years agoGet the right funny characters in Hernan's name.
Tim Peters [Fri, 19 Apr 2002 15:59:01 +0000 (15:59 +0000)]
Get the right funny characters in Hernan's name.

22 years ago#546155, remove posix_int() it is not used
Neal Norwitz [Fri, 19 Apr 2002 14:58:40 +0000 (14:58 +0000)]
#546155, remove posix_int() it is not used

22 years agoFix SF #544995 (zlib crash on second flush call)
Jeremy Hylton [Fri, 19 Apr 2002 14:37:07 +0000 (14:37 +0000)]
Fix SF #544995 (zlib crash on second flush call)
Bug fix by mhammond.

Bug fix candidate for 2.2, not present in 2.1.

22 years agoOops: we used PyMem_DEL() to clean up objects, and that's a problem since
Jack Jansen [Fri, 19 Apr 2002 14:29:47 +0000 (14:29 +0000)]
Oops: we used PyMem_DEL() to clean up objects, and that's a problem since
pymalloc, apparently. Fixed, but this means all bgen-generated modules will
have to be re-generated.

I hope (and expect) that the pymalloc fixes aren't bugfix candidates, because
if they are this is one too.

22 years agoDocument the build process more precisely. Suggested by Hugh Sasse.
Martin v. Löwis [Fri, 19 Apr 2002 09:47:23 +0000 (09:47 +0000)]
Document the build process more precisely. Suggested by Hugh Sasse.

22 years ago\idxcode -> \py@idxcode (mimics index stuff in python.sty - problem only
Skip Montanaro [Fri, 19 Apr 2002 04:52:44 +0000 (04:52 +0000)]
\idxcode -> \py@idxcode (mimics index stuff in python.sty - problem only
revealed itself when i added index generating lines to doc/doc.tex)

22 years agofix duplicate label
Skip Montanaro [Fri, 19 Apr 2002 04:50:44 +0000 (04:50 +0000)]
fix duplicate label
add index turds