Commit Graph

22296 Commits

Author SHA1 Message Date
Jeremy Hylton c4ad0bcbe5 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.
2002-04-23 20:01:20 +00:00
Jack Jansen 656b735af9 Backport of 1.6.4.2.2.3 from release22-maint branch. 2002-04-23 19:59:03 +00:00
Jack Jansen d92b7a01c5 Updated URL. 2002-04-23 19:56:20 +00:00
Jack Jansen 601b2fddf2 Backport of select parts of release22-maint (up to 1.38.4.2.2.3). 2002-04-23 19:50:53 +00:00
Barry Warsaw 8570013357 Whitespace normalization. Unka Timmy would be proud. 2002-04-23 18:18:43 +00:00
Fred Drake b957bc3dcc Clarify the return value of PyObject_IsInstance(). 2002-04-23 18:15:44 +00:00
Fred Drake 106c1a0e7a WCOREDUMP(), WIFCONTINUED(), WCONTINUED, WUNTRACED: New.
isatty(), WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(): Changed to return
    bools instead of ints.
2002-04-23 15:58:02 +00:00
Guido van Rossum 256705bca7 SF patch 546244 by John Williams: add Text.dump() method. 2002-04-23 13:29:43 +00:00
Guido van Rossum 4e1dd7d63b Add warning about the HP PA-RISC 2.0 C compiler's optimizer. 2002-04-23 13:06:07 +00:00
Jack Jansen 1476c2753b There was a non-ascii character in the source. Replaced by a hex escape. 2002-04-23 10:52:44 +00:00
Anthony Baxter ae7639dbfb whitespace fixup. test__all__ and test_sundry were failing
for me on linux because of the inconsistent whitespace.
2002-04-23 02:38:39 +00:00
Anthony Baxter 4ce6b351cc don't fail if the audio device is busy, just skip.
SF patch 545486
2002-04-23 02:20:46 +00:00
Anthony Baxter 8388895fe4 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.
2002-04-23 02:11:05 +00:00
Barry Warsaw 0494955b8f 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.
2002-04-22 22:05:49 +00:00
Barry Warsaw 29a90f0a7a 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.
2002-04-22 21:48:20 +00:00
Tim Peters 030a5cebf4 unicode_memchr(): Squashed gratuitous int-vs-size_t mismatch (which
gives a compiler wng under MSVC because of the resulting signed-vs-
unsigned comparison).
2002-04-22 19:00:10 +00:00
Tim Peters 32b069cf54 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.
2002-04-22 18:43:49 +00:00
Walter Dörwald de02bcb265 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.
2002-04-22 17:42:37 +00:00
Barry Warsaw a7cc43b9e8 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.
2002-04-22 17:15:19 +00:00
Barry Warsaw a0113cd5cd (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.
2002-04-22 16:23:29 +00:00
Barry Warsaw b2d5e62d65 (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.
2002-04-22 15:29:27 +00:00
Jack Jansen ca80002694 Added Christopher Smith. 2002-04-22 13:56:25 +00:00
Jack Jansen 992d58b770 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.
2002-04-22 13:55:43 +00:00
Jack Jansen c6d2a20bc6 Removed note on test_time failing.
Bugfix candidate.
2002-04-22 11:46:16 +00:00
Jack Jansen 7aace7a2dc Regenerated to include Internet Config error strings.
Bugfix candidate.
2002-04-22 11:45:46 +00:00
Jack Jansen 117dbdf4b4 Added an optional file with MacErrors.h extensions: IC errors aren't in there.
Bugfix candidate.
2002-04-22 11:44:26 +00:00
Neil Schemenauer 44c4c6dbd6 Py_GETENV is used by obmalloc and needs Py_IgnoreEnvironmentFlag. Provide it. 2002-04-22 03:29:32 +00:00
Neil Schemenauer fd1030e166 pgen now needs pymalloc 2002-04-22 03:05:25 +00:00
Tim Peters 51e7f5caba 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.
2002-04-22 02:33:27 +00:00
Steven M. Gava a2bc259dd7 tracking python idle changes:
Provisional fix for writefile() [SF bug # 541730]
2002-04-22 00:42:42 +00:00
Tim Peters 1c6192662d Update the Windows makefile for 2.3. 2002-04-22 00:39:44 +00:00
Steven M. Gava 931625dc77 tracking python idle changes:
Patch #540583: Open MS Help Docs if available.
2002-04-22 00:38:26 +00:00
Neal Norwitz 8ee3cd47a9 #546156, Remove load_false()/load_true(), they are not used 2002-04-21 23:44:34 +00:00
Tim Peters e1682a80fa Py_UniversalNewlineFread(): small speed boost on non-Windows boxes. 2002-04-21 18:15:20 +00:00
Tim Peters 0eca65c4c5 PyUnicode_EncodeUTF8(): tightened the memory asserts a bit, and at least
tried to catch some possible arithmetic overflows in the debug build.
2002-04-21 17:28:06 +00:00
Neal Norwitz 0e0ee598fc #544265, Remove warnings for passing const to free() 2002-04-21 15:03:18 +00:00
Martin v. Löwis 2a7ff35a07 Back out 2.140. 2002-04-21 09:59:45 +00:00
Tim Peters 639295f0a5 Enable universal newlines on Windows. Note that NEWS needs more words! 2002-04-21 07:30:30 +00:00
Tim Peters 058b141ef7 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.
2002-04-21 07:29:14 +00:00
Tim Peters ea572b21f8 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.
2002-04-21 06:12:02 +00:00
Tim Peters 4a0db06edf 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).
2002-04-21 04:44:11 +00:00
Tim Peters 7e3d961fc1 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.
2002-04-21 03:26:37 +00:00
Tim Peters dc374e034a 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.
2002-04-21 02:01:01 +00:00
Tim Peters c8490c70cd 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.
2002-04-20 21:34:34 +00:00
Tim Peters 4545407746 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.
2002-04-20 20:26:26 +00:00
Neal Norwitz 3d94942000 #546163, fix link problem on Solaris 8 for makedev when using mknod 2002-04-20 13:46:43 +00:00
Martin v. Löwis a4eb14b7a4 Patch #495401: Count number of required bytes for encoding UTF-8 before
allocating the target buffer.
2002-04-20 13:44:01 +00:00
Tim Peters e21095e3c5 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).
2002-04-20 08:36:42 +00:00
Martin v. Löwis 6af3e2dc31 Forward port of patch # 500311: Work around for buggy https servers.
Fixes #494762.
2002-04-20 07:47:40 +00:00
Jeremy Hylton 954aed8c8d Add test for eval() w/ free variables.
Related to SF bug #505315
2002-04-20 04:51:39 +00:00