]> granicus.if.org Git - python/log
python
24 years agoANSIfied function headers to shut up compiler warnings on OSX/Mach-o.
Jack Jansen [Wed, 20 Jun 2001 21:22:23 +0000 (21:22 +0000)]
ANSIfied function headers to shut up compiler warnings on OSX/Mach-o.

24 years agoAdded a const to shut up a compiler warning.
Jack Jansen [Wed, 20 Jun 2001 21:21:07 +0000 (21:21 +0000)]
Added a const to shut up a compiler warning.

24 years agoReversed the order of the checks for None or a Dialog where a Window is expected...
Jack Jansen [Wed, 20 Jun 2001 21:20:22 +0000 (21:20 +0000)]
Reversed the order of the checks for None or a Dialog where a Window is expected so it doesn't crash under OSX/Mach-o.

24 years agoAdd a little more support for describing version information. This
Fred Drake [Wed, 20 Jun 2001 21:17:09 +0000 (21:17 +0000)]
Add a little more support for describing version information.  This
is not pretty, but does what is needed.

24 years agoRemoved some unused routines under Carbon. They caused compile errors with UH34.
Jack Jansen [Wed, 20 Jun 2001 20:55:05 +0000 (20:55 +0000)]
Removed some unused routines under Carbon. They caused compile errors with UH34.

24 years agoAdapted to Universal Headers 3.4: new refcontype and use UPP names in stead of Proc...
Jack Jansen [Wed, 20 Jun 2001 20:53:38 +0000 (20:53 +0000)]
Adapted to Universal Headers 3.4: new refcontype and use UPP names in stead of Proc names for callback creation.

24 years agoAdapted for Universal Headers 3.4: refcon type has changed (sigh) and use modern...
Jack Jansen [Wed, 20 Jun 2001 20:50:19 +0000 (20:50 +0000)]
Adapted for Universal Headers 3.4: refcon type has changed (sigh) and use modern (UPP in stead of Proc) names for callback object creation.

24 years agoOverride bdb's canonic() method with a no-op: with bdb's version we couldn't edit...
Just van Rossum [Wed, 20 Jun 2001 19:57:55 +0000 (19:57 +0000)]
Override bdb's canonic() method with a no-op: with bdb's version we couldn't edit breakpoints in file-less ("Untitled" script windows). Besides, we did't need it as we always use full path names anyway.

24 years agowrite(): Karl Eichwalder points out that the #, flag comments should
Barry Warsaw [Wed, 20 Jun 2001 19:41:40 +0000 (19:41 +0000)]
write(): Karl Eichwalder points out that the #, flag comments should
be outputted just before the msgid lines.

24 years agogen_iternext(): repair subtle refcount problem.
Tim Peters [Wed, 20 Jun 2001 06:57:32 +0000 (06:57 +0000)]
gen_iternext():  repair subtle refcount problem.
NeilS, please check!  This came from staring at your genbug.py, but I'm
not sure it plugs all possible holes.  Without this, I caught a
frameobject refcount going negative, and it was also the cause (in debug
build) of _Py_ForgetReference's attempt to forget an object with already-
NULL _ob_prev and _ob_next pointers -- although I'm still not entirely
sure how!  Part of the difficulty is that frameobjects are stored on a
free list that gets recycled very quickly, so if there's a stray pointer
to one of them it never looks like an insane frameobject (never goes
trough the free() mangling MS debug forces, etc).

24 years agoRemove unused code.
Neil Schemenauer [Wed, 20 Jun 2001 00:39:28 +0000 (00:39 +0000)]
Remove unused code.

24 years agoAdd a bunch of sample strings to test soft line breaks of varying end
Barry Warsaw [Tue, 19 Jun 2001 22:48:42 +0000 (22:48 +0000)]
Add a bunch of sample strings to test soft line breaks of varying end
cases.

24 years agoencode(): Fixed the handling of soft line breaks for lines over 76
Barry Warsaw [Tue, 19 Jun 2001 22:48:10 +0000 (22:48 +0000)]
encode(): Fixed the handling of soft line breaks for lines over 76
characters in length.  Remember that when calculating the soft breaks,
the trailing `=' sign counts against the max length!

24 years agomade 7-bit-clean.
Just van Rossum [Tue, 19 Jun 2001 21:38:42 +0000 (21:38 +0000)]
made 7-bit-clean.

24 years agoSome long overdue maintainance. Made all IDE sources 7-bit-clean, to avoid any furthe...
Just van Rossum [Tue, 19 Jun 2001 21:37:33 +0000 (21:37 +0000)]
Some long overdue maintainance. Made all IDE sources 7-bit-clean, to avoid any further encoding conversion troubles.

24 years ago- _filename_to_abs() didn't cater for .. components in the pathname. Fixed.
Jack Jansen [Tue, 19 Jun 2001 21:23:11 +0000 (21:23 +0000)]
- _filename_to_abs() didn't cater for .. components in the pathname. Fixed.
- compile() didn't return a (empty) list of objects. Fixed.
- the various _fix_xxx_args() methods weren't called (are they new or did I overlook them?). Fixed.

24 years agoThe test used int(time.time()) to get a random number, but this doesn't work on the...
Jack Jansen [Tue, 19 Jun 2001 20:20:05 +0000 (20:20 +0000)]
The test used int(time.time()) to get a random number, but this doesn't work on the mac (where times are bigger than ints). Changed to int(time.time()%1000000).

24 years agoAn import MacOS was missing after the code-rearranging. Added.
Jack Jansen [Tue, 19 Jun 2001 20:11:36 +0000 (20:11 +0000)]
An import MacOS was missing after the code-rearranging. Added.

24 years agoTest by Martin v. Loewis for the new UTF-16 codec handling of BOM
Marc-André Lemburg [Tue, 19 Jun 2001 20:09:28 +0000 (20:09 +0000)]
Test by Martin v. Loewis for the new UTF-16 codec handling of BOM
marks.

24 years agoThis patch by Martin v. Loewis changes the UTF-16 codec to only
Marc-André Lemburg [Tue, 19 Jun 2001 20:07:51 +0000 (20:07 +0000)]
This patch by Martin v. Loewis changes the UTF-16 codec to only
write a BOM at the start of the stream and also to only read it as
BOM at the start of a stream.

Subsequent reading/writing of BOMs will read/write the BOM as ZWNBSP
character. This is in sync with the Unicode specifications.

Note that UTF-16 files will now *have* to start with a BOM mark
in order to be readable by the codec.

24 years agowrite(): It's been generally agreed on the i18n-sig that the docstring
Barry Warsaw [Tue, 19 Jun 2001 19:54:19 +0000 (19:54 +0000)]
write(): It's been generally agreed on the i18n-sig that the docstring
marker should be output as a #, flag, e.g. "#, docstring".

24 years agoDocument the new encodestring() and decodestring() functions. Also,
Barry Warsaw [Tue, 19 Jun 2001 19:44:42 +0000 (19:44 +0000)]
Document the new encodestring() and decodestring() functions.  Also,
add some description of what the quotetabs argument does for the
encode*() functions.  Finally, add a "see also" pointing to the base64
module.

24 years agoFixed -D emulation for symbols with a value, as specified with the define_macros...
Just van Rossum [Tue, 19 Jun 2001 19:44:02 +0000 (19:44 +0000)]
Fixed -D emulation for symbols with a value, as specified with the define_macros Extension argument.

24 years agoA unittest-based test for the quopri module.
Barry Warsaw [Tue, 19 Jun 2001 19:08:13 +0000 (19:08 +0000)]
A unittest-based test for the quopri module.

24 years agoBetter support for RFC 1521 quoted-printable specification, along with
Barry Warsaw [Tue, 19 Jun 2001 19:07:46 +0000 (19:07 +0000)]
Better support for RFC 1521 quoted-printable specification, along with
addition of interface for consistency with base64 module.  Namely,

encodestring(), decodestring(): New functions which accept a string
object and return a string object.  They just wrap the string in
StringIOs and pass them to the encode() and decode() methods
respectively.  encodestring() accepts a default argument of quotetabs,
defaulting to zero, which is passed on straight through to encode().

encode(): Fix the bug where an extra newline would always be added to
the output, which prevented an idempotent roundtrip through
encode->decode.  Now, if the source string doesn't end in a newline,
then the result string won't end in a newline.

Also, extend the quotetabs argument semantics to include quoting
embedded strings, which is also optional according to the RFC.

test() -> main()

"from quopri import *" also imports encodestring() and decodestring().

24 years ago(python-font-lock-keywords): Add "yield" as a keyword to support the
Barry Warsaw [Tue, 19 Jun 2001 18:24:42 +0000 (18:24 +0000)]
(python-font-lock-keywords): Add "yield" as a keyword to support the
new "simple generators" feature of 2.2.  See PEP 255.

24 years agoAdded a MACHDEP_OBJS to the python link. Use this on MacOSX to include
Neil Schemenauer [Tue, 19 Jun 2001 15:44:15 +0000 (15:44 +0000)]
Added a MACHDEP_OBJS to the python link. Use this on MacOSX to include
Mac/macglue.c into the core interpreter. This file contains the glue code that
allows extension modules for Mac toolboxes to live in different shared libraries
but still communicate with each other. The glue code is controlled by the
USE_MAC_TOOLBOX_GLUE define. [checked in for Jack]

24 years agoAdded a MACHDEP_OBJS to the python link. Use this on MacOSX to include
Jack Jansen [Tue, 19 Jun 2001 15:00:23 +0000 (15:00 +0000)]
Added a MACHDEP_OBJS to the python link. Use this on MacOSX to include
Mac/macglue.c into the core interpreter. This file contains the glue code that
allows extension modules for Mac toolboxes to live in different shared libraries
but still communicate with each other. The glue code is controlled by the
USE_MAC_TOOLBOX_GLUE define.

24 years agoTaught IDLE's autoident parser that "yield" is a keyword that begins a
Tim Peters [Tue, 19 Jun 2001 00:28:47 +0000 (00:28 +0000)]
Taught IDLE's autoident parser that "yield" is a keyword that begins a
stmt.  Along w/ the preceding change to keyword.py, making all this work
w/ a future-stmt just looks harder and harder.

24 years agoUpdated keyword.py for "yield".
Tim Peters [Tue, 19 Jun 2001 00:26:25 +0000 (00:26 +0000)]
Updated keyword.py for "yield".

24 years agoSomebody checked this in w/ an ambiguous tab/space mix (reported by
Tim Peters [Mon, 18 Jun 2001 23:56:36 +0000 (23:56 +0000)]
Somebody checked this in w/ an ambiguous tab/space mix (reported by
Mark Favas).

24 years ago(py-continuation-offset): New variable which controls how much to
Barry Warsaw [Mon, 18 Jun 2001 23:40:35 +0000 (23:40 +0000)]
(py-continuation-offset): New variable which controls how much to
indent continuation lines, defined as lines following those that end
in backslash.

(py-compute-indentation): Support for py-continuation-offset.

24 years agoAdded "i" and "l" to the list of std-mode struct codes that don't range-
Tim Peters [Mon, 18 Jun 2001 22:27:39 +0000 (22:27 +0000)]
Added "i" and "l" to the list of std-mode struct codes that don't range-
check correctly on pack().  While these were checking OK on my 32-bit box,
Mark Favas reported failures on a 64-bit box (alas, easy to believe).

24 years agoMerging the gen-branch into the main line, at Guido's direction. Yay!
Tim Peters [Mon, 18 Jun 2001 22:08:13 +0000 (22:08 +0000)]
Merging the gen-branch into the main line, at Guido's direction.  Yay!
Bugfix candidate in inspect.py:  it was referencing "self" outside of
a method.

24 years agoSF bug 434186: 0x80000000/2 != 0x80000000>>1
Tim Peters [Mon, 18 Jun 2001 19:21:11 +0000 (19:21 +0000)]
SF bug 434186: 0x80000000/2 != 0x80000000>>1
i_divmod:  New and simpler algorithm.  Old one returned gibberish on most
boxes when the numerator was -sys.maxint-1.  Oddly enough, it worked in the
release (not debug) build on Windows, because the compiler optimized away
some tricky sign manipulations that were incorrect in this case.
Makes you wonder <wink> ...
Bugfix candidate.

24 years ago[Bug #433047, reported by Armin Rigo] Remove extra 'i' character in
Andrew M. Kuchling [Mon, 18 Jun 2001 19:04:04 +0000 (19:04 +0000)]
[Bug #433047, reported by Armin Rigo] Remove extra 'i' character in
    PyArg_ParseTuple() call.

(2.1.1 bugfix candidate.)

24 years agoAdd some information on the use of \verbatiminput to display sources from
Fred Drake [Mon, 18 Jun 2001 14:59:58 +0000 (14:59 +0000)]
Add some information on the use of \verbatiminput to display sources from
an external file.

24 years agoFix SF bug #433904 (Alex Martelli) - all s_* methods return None only.
Guido van Rossum [Mon, 18 Jun 2001 12:33:36 +0000 (12:33 +0000)]
Fix SF bug #433904 (Alex Martelli) - all s_* methods return None only.

24 years agoPatch #413171: Implement get, setdefault, update in terms of
Martin v. Löwis [Mon, 18 Jun 2001 01:09:41 +0000 (01:09 +0000)]
Patch #413171: Implement get, setdefault, update in terms of
has_key, __getitem__, and __setitem__.

24 years agoClarification in the fp appendix suggested on c.l.py by Michael Chermside.
Tim Peters [Sun, 17 Jun 2001 21:57:17 +0000 (21:57 +0000)]
Clarification in the fp appendix suggested on c.l.py by Michael Chermside.
Also replaced a *star* style emphasis in the Representation Error section
with an \emph{} thingie.

24 years agoFix for bug [ #433047 ] missing args to PyArg_ParseTuple
Marc-André Lemburg [Sun, 17 Jun 2001 18:32:36 +0000 (18:32 +0000)]
Fix for bug [ #433047 ] missing args to PyArg_ParseTuple

24 years agoSF patch #433619, by Michel Pelletier:
Guido van Rossum [Sun, 17 Jun 2001 13:31:25 +0000 (13:31 +0000)]
SF patch #433619, by Michel Pelletier:

Summary: NAMESPACE support in imaplib.py

Initial Comment:
Support for the IMAP NAMESPACE extension defined in rfc
2342.  This is almost a necessity for working with
modern IMAP servers.

24 years agoSynchronize with 1.13 of PyXML:
Martin v. Löwis [Sun, 17 Jun 2001 07:05:43 +0000 (07:05 +0000)]
Synchronize with 1.13 of PyXML:
Allow application to set a new content handler and lex_prop handler during
parsing. Closes bug #433761.
Small hack to make expat be ignored in Jython.

24 years agoInstead of initializing & interning the strings passed to the profile
Fred Drake [Sat, 16 Jun 2001 21:02:31 +0000 (21:02 +0000)]
Instead of initializing & interning the strings passed to the profile
and trace functions lazily, which incurs extra argument pushing and checks
in the C overhead for profiling/tracing, create the strings semi-lazily
when the Python code first registers a profile or trace function.  This
simplifies the trampoline into the profile/trace functions.

24 years agoPyLong_{As, From}VoidPtr: cleanup, replacing assumptions in comments with
Tim Peters [Sat, 16 Jun 2001 08:48:40 +0000 (08:48 +0000)]
PyLong_{As, From}VoidPtr:  cleanup, replacing assumptions in comments with
#if/#error constructs.

24 years agoDocument that filter is added in 2.2.
Martin v. Löwis [Sat, 16 Jun 2001 08:14:04 +0000 (08:14 +0000)]
Document that filter is added in 2.2.

24 years agoFix error in comment, and in test_long_api and test_longlong_api remove
Tim Peters [Sat, 16 Jun 2001 08:10:13 +0000 (08:10 +0000)]
Fix error in comment, and in test_long_api and test_longlong_api remove
the need for the F_ERROR macro.

24 years agodict_repr: Reuse one of the int vars (minor code simplification).
Tim Peters [Sat, 16 Jun 2001 07:52:53 +0000 (07:52 +0000)]
dict_repr:  Reuse one of the int vars (minor code simplification).

24 years agoReformat decl of new _PyString_Join. Add NEWS blurb about repr() speedup.
Tim Peters [Sat, 16 Jun 2001 05:42:57 +0000 (05:42 +0000)]
Reformat decl of new _PyString_Join.  Add NEWS blurb about repr() speedup.

24 years agoSF bug 433228: repr(list) woes when len(list) big.
Tim Peters [Sat, 16 Jun 2001 05:11:17 +0000 (05:11 +0000)]
SF bug 433228: repr(list) woes when len(list) big.
Gave Python linear-time repr() implementations for dicts, lists, strings.
This means, e.g., that repr(range(50000)) is no longer 50x slower than
pprint.pprint() in 2.2 <wink>.

I don't consider this a bugfix candidate, as it's a performance boost.

Added _PyString_Join() to the internal string API.  If we want that in the
public API, fine, but then it requires runtime error checks instead of
asserts.

24 years agoSF bug 433228: repr(list) woes when len(list) big
Tim Peters [Sat, 16 Jun 2001 00:09:28 +0000 (00:09 +0000)]
SF bug 433228:  repr(list) woes when len(list) big
call_object:  If the object isn't callable, display its type in the error
msg rather than its repr.
Bugfix candidate.

24 years agoImplement the \verbatiminput LaTeX macro; this contains more magic than
Fred Drake [Fri, 15 Jun 2001 21:31:57 +0000 (21:31 +0000)]
Implement the \verbatiminput LaTeX macro; this contains more magic than
it should, but only enough that LaTeX2HTML doesn't bite us.

24 years agoAdd a version annotation for the Q and q format codes.
Fred Drake [Fri, 15 Jun 2001 14:13:07 +0000 (14:13 +0000)]
Add a version annotation for the Q and q format codes.

24 years agoForward-port revision 2.24.2.4 from the release21-maint branch:
Thomas Wouters [Fri, 15 Jun 2001 12:05:44 +0000 (12:05 +0000)]
Forward-port revision 2.24.2.4 from the release21-maint branch:

Protect several more uses of constants with #ifdefs; these are necessary on
(at least) SCO OpenServer 5. Fixes a non-SF-submitted bugreport by Michael
Kent.

24 years agoNote that 2.0.1 is also a PSF release. (Gregor Hoffleit, SF #433223.)
Guido van Rossum [Thu, 14 Jun 2001 19:36:59 +0000 (19:36 +0000)]
Note that 2.0.1 is also a PSF release.  (Gregor Hoffleit, SF #433223.)

24 years agoChange IS_LITTLE_ENDIAN macro -- a little faster now.
Tim Peters [Thu, 14 Jun 2001 18:42:50 +0000 (18:42 +0000)]
Change IS_LITTLE_ENDIAN macro -- a little faster now.

24 years agoFix a mis-indentation in _PyUnicode_New() that caused me to stare at
Guido van Rossum [Thu, 14 Jun 2001 17:52:02 +0000 (17:52 +0000)]
Fix a mis-indentation in _PyUnicode_New() that caused me to stare at
some code for longer than needed.

24 years agoFix an improperly placed comma.
Fred Drake [Thu, 14 Jun 2001 13:57:16 +0000 (13:57 +0000)]
Fix an improperly placed comma.

24 years ago_PyLong_AsByteArray: simplify the logic for dealing with the most-
Tim Peters [Thu, 14 Jun 2001 08:53:38 +0000 (08:53 +0000)]
_PyLong_AsByteArray:  simplify the logic for dealing with the most-
significant digits sign bits.  Again no change in semantics.

24 years agoPyLong_From{Unsigned,}Long: count the # of digits first, so no more space
Tim Peters [Thu, 14 Jun 2001 04:56:19 +0000 (04:56 +0000)]
PyLong_From{Unsigned,}Long:  count the # of digits first, so no more space
is allocated than needed (used to allocate 80 bytes of digit space no
matter how small the long input).  This also runs faster, at least on 32-
bit boxes.

24 years agoFixed typo in comment.
Tim Peters [Thu, 14 Jun 2001 01:11:03 +0000 (01:11 +0000)]
Fixed typo in comment.

24 years agoAdd tests of PyLong_{As,From}{Unsigned,}Long. These are very much like
Tim Peters [Thu, 14 Jun 2001 00:55:41 +0000 (00:55 +0000)]
Add tests of PyLong_{As,From}{Unsigned,}Long.  These are very much like
the new PyLong_{As,From}{Unsigned,}LongLong tests, so the bulk of the
code is in the new #include file testcapi_long.h, which generates
different code depending on how macros are set.  This sucks, but I couldn't
think of anything that sucked less.

UNIX headache?  If we still maintain dependencies by hand, someone who
knows what they're doing should teach whatever needs it that
_testcapimodule.c includes testcapi_long.h.

24 years agoGeneralize the new qQ std-mode tests to all int codes (bBhHiIlLqQ).
Tim Peters [Wed, 13 Jun 2001 22:45:27 +0000 (22:45 +0000)]
Generalize the new qQ std-mode tests to all int codes (bBhHiIlLqQ).
Unfortunately, the std-mode bBhHIL codes don't do any range-checking; if
and when some of those get fixed, remove their letters from the
IntTester.BUGGY_RANGE_CHECK string.  In the meantime, a msg saying that
range-tests are getting skipped is printed to stdout whenever one is
skipped.

24 years ago_PyLong_FromByteArray: changed decl of "carry" to match "thisbyte". No
Tim Peters [Wed, 13 Jun 2001 21:09:15 +0000 (21:09 +0000)]
_PyLong_FromByteArray:  changed decl of "carry" to match "thisbyte".  No
semantic change, but a bit clearer and may help a really stupid compiler
avoid pointless runtime length conversions.

24 years ago_PyLong_AsByteArray: Don't do the "delicate overflow" check unless it's
Tim Peters [Wed, 13 Jun 2001 21:01:27 +0000 (21:01 +0000)]
_PyLong_AsByteArray:  Don't do the "delicate overflow" check unless it's
truly needed; usually saves a little time, but no change in semantics.

24 years ago_PyLong_AsByteArray: added assert that the input is normalized. This is
Tim Peters [Wed, 13 Jun 2001 20:50:08 +0000 (20:50 +0000)]
_PyLong_AsByteArray:  added assert that the input is normalized.  This is
outside the function's control, but is crucial to correct operation.

24 years agoPyLong_As{Unsigned,}LongLong: fiddled final result casting.
Tim Peters [Wed, 13 Jun 2001 20:45:17 +0000 (20:45 +0000)]
PyLong_As{Unsigned,}LongLong:  fiddled final result casting.

24 years agoRecord Windows buildno for 2.0.1c1.
Tim Peters [Wed, 13 Jun 2001 19:17:32 +0000 (19:17 +0000)]
Record Windows buildno for 2.0.1c1.

24 years agoTemporarily disable the message to stderr. Jeremy will know what to do
Marc-André Lemburg [Wed, 13 Jun 2001 17:18:06 +0000 (17:18 +0000)]
Temporarily disable the message to stderr. Jeremy will know what to do
about this...

24 years agoGot rid of mactoolboxglue.c
Jack Jansen [Wed, 13 Jun 2001 12:41:25 +0000 (12:41 +0000)]
Got rid of mactoolboxglue.c

24 years agoFixed an error in the signature of the QdRGB converter routines.
Jack Jansen [Wed, 13 Jun 2001 12:39:02 +0000 (12:39 +0000)]
Fixed an error in the signature of the QdRGB converter routines.

24 years agoThe new {b,l}p_{u,}longlong() didn't check get_pylong()'s return for NULL.
Tim Peters [Wed, 13 Jun 2001 01:26:35 +0000 (01:26 +0000)]
The new {b,l}p_{u,}longlong() didn't check get_pylong()'s return for NULL.
Repaired that, and added appropriate tests for it to test_struct.py.

24 years agolongobject.c:
Tim Peters [Wed, 13 Jun 2001 00:35:57 +0000 (00:35 +0000)]
longobject.c:
    Replaced PyLong_{As,From}{Unsigned,}LongLong guts with calls
    to _PyLong_{As,From}ByteArray.
_testcapimodule.c:
    Added strong tests of PyLong_{As,From}{Unsigned,}LongLong.

Fixes SF bug #432552 PyLong_AsLongLong() problems.
Possible bugfix candidate, but the fix relies on code added to longobject
to support the new q/Q structmodule format codes.

24 years agoThe merest start of a test for the PyLong_{As,From}{Unsigned,}LongLong()
Tim Peters [Tue, 12 Jun 2001 20:10:01 +0000 (20:10 +0000)]
The merest start of a test for the PyLong_{As,From}{Unsigned,}LongLong()
functions.  I intend to replace their guts with calls to the new
_PyLong_{As,From}ByteArray() functions, but AFAICT there's no tests for
them at all now; I also suspect PyLong_AsLongLong() isn't catching all
overflow cases, but without a std test to demonstrate that why should you
believe me <wink>.

Also added a raiseTestError() utility function.

24 years ago_PyLong_{As,From}ByteArray: Minor code rearrangement aimed at improving
Tim Peters [Tue, 12 Jun 2001 19:17:03 +0000 (19:17 +0000)]
_PyLong_{As,From}ByteArray:  Minor code rearrangement aimed at improving
clarity.  Should have no effect visible to callers.

24 years agoAdd new built-in 'help' which invokes pydoc.help (with a twist).
Guido van Rossum [Tue, 12 Jun 2001 16:48:52 +0000 (16:48 +0000)]
Add new built-in 'help' which invokes pydoc.help (with a twist).

24 years agoRemoved the Python version from the PYTHONHOMEHELP string. It was
Marc-André Lemburg [Tue, 12 Jun 2001 16:13:51 +0000 (16:13 +0000)]
Removed the Python version from the PYTHONHOMEHELP string. It was
still set to python2.0 ...

24 years agoMake the option processing more robust.
Fred Drake [Tue, 12 Jun 2001 13:31:37 +0000 (13:31 +0000)]
Make the option processing more robust.
Add a -F option similar to "cvs commit -F <file>".
Add a -t option to allow specifying the prefix to the directory into which
the docs should be unpacked (useful when I start trying out new styles for
the presentation).

24 years agoFix for bug #432384: Recursion in PyString_AsEncodedString?
Marc-André Lemburg [Tue, 12 Jun 2001 13:14:10 +0000 (13:14 +0000)]
Fix for bug #432384: Recursion in PyString_AsEncodedString?

24 years agoFixed reference to table notes for {}.keys() and {}.items() -- these
Fred Drake [Tue, 12 Jun 2001 03:31:56 +0000 (03:31 +0000)]
Fixed reference to table notes for {}.keys() and {}.items() -- these
references did not get updated when the notes were renumbered in a
previous update.

This fixes SF bug #432208.

24 years agoAdded q/Q standard (x-platform 8-byte ints) mode in struct module.
Tim Peters [Tue, 12 Jun 2001 01:22:22 +0000 (01:22 +0000)]
Added q/Q standard (x-platform 8-byte ints) mode in struct module.
This completes the q/Q project.

longobject.c _PyLong_AsByteArray:  The original code had a gross bug:
the most-significant Python digit doesn't necessarily have SHIFT
significant bits, and you really need to count how many copies of the sign
bit it has else spurious overflow errors result.

test_struct.py:  This now does exhaustive std q/Q testing at, and on both
sides of, all relevant power-of-2 boundaries, both positive and negative.

NEWS:  Added brief dict news while I was at it.

24 years agoMake copy, cut and paste events case insensitive. Reported by Patrick
Guido van Rossum [Tue, 12 Jun 2001 00:30:33 +0000 (00:30 +0000)]
Make copy, cut and paste events case insensitive.  Reported by Patrick
K. O'Brien on idle-dev.

(Should other bindings follow suit?)

24 years agoTwo new private longobject API functions,
Tim Peters [Mon, 11 Jun 2001 21:23:58 +0000 (21:23 +0000)]
Two new private longobject API functions,
    _PyLong_FromByteArray
    _PyLong_AsByteArray
Untested and probably buggy -- they compile OK, but nothing calls them
yet.  Will soon be called by the struct module, to implement x-platform
'q' and 'Q'.
If other people have uses for them, we could move them into the public API.
See longobject.h for usage details.

24 years agoAdd the appropriate availability annotations for the popen*() family of
Fred Drake [Mon, 11 Jun 2001 18:25:34 +0000 (18:25 +0000)]
Add the appropriate availability annotations for the popen*() family of
functions -- these are not available on traditional Mac OS platforms.

Corrected the version annotations for the spawn*() functions and related
constants; these were added in Python 1.6, not 1.5.2.

24 years agoTrimmed trailing whitespace.
Tim Peters [Mon, 11 Jun 2001 16:57:33 +0000 (16:57 +0000)]
Trimmed trailing whitespace.

24 years agoSimplify some convolution by simply not recognizing 'q' and 'Q' at all
Tim Peters [Mon, 11 Jun 2001 16:51:56 +0000 (16:51 +0000)]
Simplify some convolution by simply not recognizing 'q' and 'Q' at all
in native mode on platforms that don't HAVE_LONG_LONG.

24 years agoMake clear in the docstring that "std" applies to both size and alignment,
Tim Peters [Mon, 11 Jun 2001 16:45:33 +0000 (16:45 +0000)]
Make clear in the docstring that "std" applies to both size and alignment,
not just to alignment.  Spotted by Guido.

Bugfix candidate.

24 years agoProtect the use of the VWERASE symbol by an #ifdef, it's apparently missing
Thomas Wouters [Mon, 11 Jun 2001 15:25:16 +0000 (15:25 +0000)]
Protect the use of the VWERASE symbol by an #ifdef, it's apparently missing
on (some versions of ?) AIX.

24 years agoFixed parameter order for os.popen2(), os.popen3(), and os.popen(4). Added
Fred Drake [Mon, 11 Jun 2001 15:21:48 +0000 (15:21 +0000)]
Fixed parameter order for os.popen2(), os.popen3(), and os.popen(4).  Added
a reference to these functions and popen() from the "Process Management"
section.

Based on a suggestion from comp.lang.python.

24 years agoFix recent changes so that this section will format again.
Fred Drake [Mon, 11 Jun 2001 14:55:01 +0000 (14:55 +0000)]
Fix recent changes so that this section will format again.

24 years agoRenamed some stuff to tell the truth about what it does.
Tim Peters [Sun, 10 Jun 2001 23:52:59 +0000 (23:52 +0000)]
Renamed some stuff to tell the truth about what it does.

24 years agoInitial support for 'q' and 'Q' struct format codes: for now, only in
Tim Peters [Sun, 10 Jun 2001 23:40:19 +0000 (23:40 +0000)]
Initial support for 'q' and 'Q' struct format codes:  for now, only in
native mode, and only when config #defines HAVE_LONG_LONG.  Standard mode
will eventually treat them as 8-byte ints across all platforms, but that
likely requires a new set of routines in longobject.c first (while
sizeof(long) >= 4 is guaranteed by C, there's nothing in C we can rely
on x-platform to hold 8 bytes of int, so we'll have to roll our own;
I'm thinking of a simple pair of conversion functions, Python long
to/from sized vector of unsigned bytes; that may be useful for GMP
conversions too; std q/Q would call them with size fixed at 8).

test_struct.py:  In addition to adding some native-mode 'q' and 'Q' tests,
got rid of unused code, and repaired a non-portable assumption about
native sizeof(short) (it isn't 2 on some Cray boxes).

libstruct.tex:  In addition to adding a bit of 'q'/'Q' docs (more needed
later), removed an erroneous footnote about 'I' behavior.

24 years agoAdded a missing cast to the hashfunc initializer.
Jack Jansen [Sun, 10 Jun 2001 21:43:28 +0000 (21:43 +0000)]
Added a missing cast to the hashfunc initializer.

24 years agoSF bug 431772: traceback.print_exc() causes traceback
Tim Peters [Sun, 10 Jun 2001 18:58:26 +0000 (18:58 +0000)]
SF bug 431772:  traceback.print_exc() causes traceback
Patch from Michael Hundson.
format_exception_only() blew up when trying to report a SyntaxError
from a string input (line is None in this case, but it assumed a string).
Bugfix candidate.

24 years agoannoying whitespace inconsistency
Peter Schneider-Kamp [Sun, 10 Jun 2001 16:45:08 +0000 (16:45 +0000)]
annoying whitespace inconsistency

24 years agoSF bug 430991: wrong co_lnotab
Tim Peters [Sat, 9 Jun 2001 09:26:21 +0000 (09:26 +0000)]
SF bug 430991: wrong co_lnotab
Armin Rigo pointed out that the way the line-# table got built didn't work
for lines generating more than 255 bytes of bytecode.  Fixed as he
suggested, plus corresponding changes to pyassem.py, plus added some
long overdue docs about this subtle table to compile.c.

Bugfix candidate (line numbers may be off in tracebacks under -O).

24 years agoCast the result of xxxPyCObject_Import to PycStringIO_CAPI*.
Martin v. Löwis [Sat, 9 Jun 2001 07:59:43 +0000 (07:59 +0000)]
Cast the result of xxxPyCObject_Import to PycStringIO_CAPI*.
This fixes bug #431557.

24 years agoPatch #424475: Speed-up tp_compare usage, by special-casing the common
Martin v. Löwis [Sat, 9 Jun 2001 07:34:05 +0000 (07:34 +0000)]
Patch #424475: Speed-up tp_compare usage, by special-casing the common
case of objects with equal types which support tp_compare. Give
type objects a tp_compare function.
Also add c<0 tests before a few PyErr_Occurred tests.

24 years agoFix the attributions for the new floating point text.
Fred Drake [Fri, 8 Jun 2001 17:09:01 +0000 (17:09 +0000)]
Fix the attributions for the new floating point text.

24 years agoAdded credits in the right places.
Fred Drake [Fri, 8 Jun 2001 16:28:53 +0000 (16:28 +0000)]
Added credits in the right places.