- The extended type structure used for heap types (new-style
classes defined by Python code using a class statement) is now
exported from object.h as PyHeapTypeObject. (SF patch #696193.)
Jack Jansen [Fri, 7 Mar 2003 12:50:45 +0000 (12:50 +0000)]
Two fixes to make this test pass on MacOS9:
- the test was sloppy about filenames: "0-REGTYPE-TEXT" was used where
the archive held "/0-REGTYPE-TEXT".
- tarfile extracts all files in binary mode, but the test expected to be able to
read and compare text files in text mode. Use universal text mode.
Jack Jansen [Thu, 6 Mar 2003 23:02:04 +0000 (23:02 +0000)]
Module to get OSA terminology description through the "official channels",
in stead of manually getting the AETE/AEUT resource. Donated by Donovan
Preston. This is his original code (but with the filename changed) checked
in for reference only.
Barry Warsaw [Thu, 6 Mar 2003 20:33:04 +0000 (20:33 +0000)]
_split_ascii(): In the clause where curlen + partlen > maxlen, if the
part itself is longer than maxlen, and we aren't already splitting on
whitespace, then we recursively split the part on whitespace and
append that to the this list.
Reverted the previous change to read() and readline().
Kevin Jacobs found that the code simplification did not
exactly match the semantics of the original. Regression
test cases were requested.
Add a note explaining why you shouldn't try to compute mean and
standard deviation. Also add an XXX comment wondering if we should
refrain from using itertools.repeat().
Barry Warsaw [Thu, 6 Mar 2003 16:10:30 +0000 (16:10 +0000)]
__unicode__(): When converting to a unicode string, we need to
preserve spaces in the encoded/unencoded word boundaries. RFC 2047 is
ambiguous here, but most people expect the space to be preserved.
Really closes SF bug # 640110.
Barry Warsaw [Thu, 6 Mar 2003 06:37:42 +0000 (06:37 +0000)]
decode_header(): Typo when appending an unencoded chunk to the
previous unencoded chunk (e.g. when they appear on separate lines).
Closes the 2nd bug in SF #640110 (the first one's already been
fixed).
Barry Warsaw [Thu, 6 Mar 2003 05:39:46 +0000 (05:39 +0000)]
Merge of the folding-reimpl-branch. Specific changes,
_split(): New implementation of ASCII line splitting which should do a
better job and not be subject to the various weird artifacts (bugs)
reported. This should also do a better job of higher-level syntactic
splits by trying first to split on semis, then commas, then
whitespace.
Use a Timbot-ly binary search for optimal non-ASCII split points for
better packing of header lines. This also lets us remove one
recursion call. Don't pass in firstline, but instead pass in the
actual line length we're shooting for. Also pass in the list of split
characters.
encode(): Pass in the list of split characters so applications can
have some control over what "higher level syntactic breaks" are.
Also,
decode_header(): Transform binascii.Errors which can occur when
decoding a base64 RFC 2047 header with bogus data, into an
email.Errors.HeaderParseError. Closes SF bug #696712.
Barry Warsaw [Thu, 6 Mar 2003 05:22:02 +0000 (05:22 +0000)]
Merge of the folding-reimpl-branch. Specific changes,
_handle_multipart(): Ensure that if the preamble exists but does not
end in a newline, a newline is still added. Without this, the
boundary separator will end up on the preamble line, breaking the MIME
structure.
_make_boundary(): Handle differences in the decimal point character
based on the locale.
Barry Warsaw [Thu, 6 Mar 2003 05:16:29 +0000 (05:16 +0000)]
Merge of the folding-reimpl-branch. Specific changes,
Charset: Alias __repr__ to __str__ for debugging.
header_encode(): When calling quopriMIME.header_encode(), set
maxlinelen=None so that the lower level function doesn't (also) try to
wrap/fold the line.
Barry Warsaw [Thu, 6 Mar 2003 05:14:20 +0000 (05:14 +0000)]
Merge of the folding-reimpl-branch. Specific changes,
_max_append(): Change the comparison so that the new string is
concatenated if it's less than or equal to the max length.
header_encode(): Allow for maxlinelen == None to mean, don't do any
line splitting. This is because this module is mostly used by higher
level abstractions (Header.py) which already ensures line lengths. We
do this in a cheapo way by setting the max_encoding to some insanely
<100k wink> large number.
Jack Jansen [Wed, 5 Mar 2003 21:16:06 +0000 (21:16 +0000)]
Two ancient and obscure bugs found and fixed by Donovan Preston (these
could be responsible for various unexplained problems with Python/OSA
interaction over the years):
- Enum values were passed as their string counterparts. Most applications
don't seem to mind this, but some do (InDesign).
- Attributes have never worked (!), as they were incorrectly passed
as parameters. Apparently nobody uses them much:-)
Jack Jansen [Wed, 5 Mar 2003 16:13:19 +0000 (16:13 +0000)]
Fix for bug #697546: don't auto-register the Python documentation
by putting the help book in an array. Somehow the fact that Python.app
(and, hence, pythonw) got an automatic help menu messed up Tkinter's
handling of the help menu.
Just van Rossum [Wed, 5 Mar 2003 15:46:54 +0000 (15:46 +0000)]
removing one Mac hack and add another:
- The applet logic has been replaced to bundlebuilder's bootstrap script
- Due to Apple being extremely string about argv[0], we need a way to
specify the actual executable name for use with sys.executable. See
the comment embedded in the code.
Martin v. Löwis [Wed, 5 Mar 2003 15:13:47 +0000 (15:13 +0000)]
Always initialize Py_FileSystemDefaultEncoding on Unix in Py_Initialize,
and not as a side effect of setlocale. Expose it as sys.getfilesystemencoding.
Adjust test case.
Back in June in revision 1.98 Steve (accidentally, presumably) wiped
out a month's worth of checkins to libstdtypes.tex (including my
extended slice docs).
I think this checkin merges them all back in, but if you make one of
these checkins:
revision 1.97
date: 2002/06/14 00:27:13; author: nnorwitz
Use \code{True} (or False) instead of true/false.
Not sure if code is correct, but that is what's in this file.
I've seen \constant{True} in other places.
----------------------------
revision 1.95
date: 2002/05/22 20:39:43; author: bwarsaw
Jack's documentation for the U mode character on the file()
constructor, vetted by Barry.
----------------------------
revision 1.94
date: 2002/05/21 18:19:15; author: rhettinger
Patch 543387. Document deprecation of complex %, //,and divmod().
----------------------------
revision 1.93
date: 2002/05/15 15:45:25; author: rhettinger
Added missing index entries for mapping methods. Closes patch
#548693.
I thought it was common practice to check things compiled before
checking them in? Oh well, this fixes various obvious mistakes and
changes a subsubsubsection (which doesn't exist) into a subsubsection
(which does). I'm not sure this matches the intent, but it seems to
read OK on a quick skim.
Kurt B. Kaiser [Mon, 3 Mar 2003 20:06:48 +0000 (20:06 +0000)]
SF 695861
Eliminate extra blank line in shell output. Caused by stdout not being
flushed
upon completion of subprocess' Executive.runcode() when user code ends by
outputting an unterminated line, e.g. print "test",
Just van Rossum [Mon, 3 Mar 2003 17:32:15 +0000 (17:32 +0000)]
Patch #683592 revisited, after discussions with MvL:
- Implement the behavior as specified in PEP 277, meaning os.listdir()
will only return unicode strings if it is _called_ with a unicode
argument.
- And then return only unicode, don't attempt to convert to ASCII.
- Don't switch on Py_FileSystemDefaultEncoding, but simply use the
default encoding if Py_FileSystemDefaultEncoding is NULL. This means
os.listdir() can now raise UnicodeDecodeError if the default encoding
can't represent the directory entry. (This seems better than silcencing
the error and fall back to a byte string.)
- Attempted to decribe the above in Doc/lib/libos.tex.
- Reworded the Misc/NEWS items to reflect the current situation.
This checkin also fixes bug #696261, which was due to os.listdir() not
using Py_FileSystemDefaultEncoding, like all file system calls are
supposed to.
Ken Manheimer [Mon, 3 Mar 2003 17:09:44 +0000 (17:09 +0000)]
py-pdbtrack-grub-for-buffer(): Rectified some logic errors i
introduced when shifting around some code, and added some redundancy
to reduce chances of hitting the wrong source code. (This is
experimental - it will improve the accuracy, but will reduce the
ability of the user to deliberately select the buffer they want the
buffer grubbing stuff to find. I think the accuracy improvement will
be worth it, but am not sure, so may remove this.)
Jack Jansen [Mon, 3 Mar 2003 13:19:44 +0000 (13:19 +0000)]
Mod to previous checkin: we must require ascii, not system defautl encoding,
because we have no easy way to convert the python encoding string to
a CF encoding parameter.
with my patch that allows for an array to be mutated when passed
as the buffer argument to ioctl() (details complicated by
backwards compatibility considerations -- read the docs!).
Jack Jansen [Mon, 3 Mar 2003 12:25:02 +0000 (12:25 +0000)]
Call AEInteractWithUser() before bringing up any of the dialogs (with the
exception of the ProgressBar, which I think is okay to show in the background).
Ken Manheimer [Mon, 3 Mar 2003 00:35:32 +0000 (00:35 +0000)]
Enhanced pdbtrack to provide for source code that's not findable by
the reported path. (Eg, precompiled scripts with a file path suitable
for a different host, scripts actually running on a remote system or
with no valid path, like Zope through-the-web python scripts.)
On failing to find the code on the reported path, pdbtrack takes the
function name and looks through the buffers, from most to least
recent, seeking the first python-mode buffer that either is named for
the function or has a definition (def or class) for that function. So
to get source tracking for code that's not located where the path
indicates, you put a copy of the script in a buffer, and pdbtrack will
find it.
Also, fixed a small bug so pdbtrack now properly presents the overlay
arrow when you run the pdb 'w'here command.
Fix from Greg Chapman from SF bug #695651: a complex subclass
constructor, when passed a single complex argument, returns the
argument unchanged. This should be done only for the complex base
class; a complex subclass should of course cast the value to the
subclass in this case.
The fix also revealed a segfault in complex_getnewargs(): the argument
for the Py_BuildValue() format code "D" is the *address* of a
Py_complex struct, not the value. (This corroborated by the API
documentation.)
Tim Peters [Sun, 2 Mar 2003 00:36:10 +0000 (00:36 +0000)]
TestOnlySetsInBinaryOps: Simplified the non-inplace tests by using
assertRaises. Fixed a repeated subtle bug in the inplace tests by
removing the possibilty that a self.fail() call could raise a
TypeError that the test catches by mistake.
Tim Peters [Sun, 2 Mar 2003 00:19:49 +0000 (00:19 +0000)]
SF bug 693121: Set == non-Set is a TypeError.
Allow mixed-type __eq__ and __ne__ for Set objects. This is messier than
I'd like because Set *also* implements __cmp__. I know of one glitch now:
cmp(s, t) returns 0 now when s and t are both Sets and s == t, despite
that Set.__cmp__ unconditionally raises TypeError (and by intent). The
rub is that __eq__ gets tried first, and the x.__eq__(y) True result
convinces Python that cmp(x, y) is 0 without even calling Set.__cmp__.
Tim Peters [Sat, 1 Mar 2003 23:33:34 +0000 (23:33 +0000)]
The doctest was printing Sets, but that's unreliable because set
elements get displayed in undefined dict order. Use a Set subclass
instead (which arranges to sort the elements for display).