Jack Jansen [Wed, 20 Jun 2001 21:31:28 +0000 (21:31 +0000)]
Don't use extern when we mean staticforward (OSX gcc is picky about it).
Blacklist SendControlMessage: it's signature has changed between Universal Headers 3.3 and 3.4.
Fred Drake [Wed, 20 Jun 2001 21:29:30 +0000 (21:29 +0000)]
Added support for new \setreleaseinfo macro.
Normalize all generated HTML so that attribute names come out as
name="value" instead of name='value'.
Changed the target of RFC links to point to the hypertext RFCs at
www.faqs.org instead of the plain text RFCs at www.ietf.org.
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.
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).
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!
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.
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).
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.
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.
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().
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]
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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>.
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).
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.
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.
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.
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.
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.
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.