Fred Drake [Fri, 22 Jun 2001 17:11:30 +0000 (17:11 +0000)]
Adjust to understand use of either single- or double-quotes to quote
attribute values, and make the logic surrounding the platform
annotations just a little easier to read. Also make the platform
notes appear in the generated page; they were supposed to, but did not.
Guido van Rossum [Fri, 22 Jun 2001 16:05:48 +0000 (16:05 +0000)]
This is a trivial command line utility to print MD5 checksums.
I published it on the web as http://www.python.org/2.1/md5sum.py
so I thought I might as well check it in.
Works with Python 1.5.2 and later.
Works like the Linux tool ``mdfsum file ...'' except it doesn't take
any options or read stdin.
Neil Schemenauer [Thu, 21 Jun 2001 02:41:10 +0000 (02:41 +0000)]
Try to avoid creating reference cycles involving generators. Only keep a
reference to f_back when its really needed. Do a little whitespace
normalization as well. This whole file is a big war between tabs and spaces
but now is probably not the time to reindent everything.
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>.