Skip Montanaro [Wed, 9 Oct 2002 21:37:18 +0000 (21:37 +0000)]
MacOSX linker doesn't understand -R flag at all, no matter how you feed it
the flag. Punt and return a -L flag instead (returning "" gums up the
command to be forked).
GNU readline() mistakenly sets the LC_CTYPE locale.
This is evil. Only the user or the app's main() should do this!
We must save and restore the locale around the rl_initialize() call.
The string formatting code has a test to switch to Unicode when %s
sees a Unicode argument. Unfortunately this test was also executed
for %r, because %s and %r share almost all of their code. This meant
that, if u is a unicode object while repr(u) is an 8-bit string
containing ASCII characters, '%r' % u is a *unicode* string containing
only ASCII characters!
Fixed by executing the test only for %s.
Also fixed an error message -- %s argument has non-string str()
doesn't make sense for %r, so the error message now differentiates
between %s and %r.
Add special consideration for rlcompleter. As a side effect of
initializing GNU readline, setlocale(LC_CTYPE, "") is called, which
changes the <ctype.h> macros to use the "default" locale (which isn't
the *initial* locale -- the initial locale is the "C" locale in which
only ASCII characters are printable). When the default locale is e.g.
Latin-1, the repr() of string objects can include 8-bit characters
with the high bit set; I believe this is due to the recent
PRINT_MULTIBYTE_STRING changes to stringobject.c. This in turn screws
up test_pyexpat and test_rotor, which depend on the repr() of 8-bit
strings with high bit characters.
The solution (for now) is to force the LC_CTYPE locale to "C" after
importing rlcompleter. This is the locale required by the test suite
anyway.
Tim Peters [Wed, 9 Oct 2002 07:56:04 +0000 (07:56 +0000)]
Don't try to access sys.getwindowsversion unless it exists (ntpath is
imported on systems other than Windows, and in particular is imported
by test___all__; the compile farm reported that all Linux tests failed
due to this; isn't anyone in PythonDevLand running CVS on Linux?!).
Tim Peters [Wed, 9 Oct 2002 01:07:11 +0000 (01:07 +0000)]
Logic for determining whether skipping test_pep277 is expected: whether
ths "should be" skipped depends on os.path.supports_unicode_filenames,
not really on the platform. Fiddled the expected-skip constructor
appropriately.
Tim Peters [Tue, 8 Oct 2002 21:01:07 +0000 (21:01 +0000)]
The
list(xrange(sys.maxint / 4))
test. Changed 4 to 2.
The belief is that this test intended to trigger a bit of code in
listobject.c's NRESIZE macro that's looking for arithmetic overflow. As
written, it doesn't achieve that, though, and leaves it up to the platform
realloc() as to whether it wants to allocate 2 gigabytes. Some platforms
say "sure!", although they don't appear to mean it, and disaster ensues.
Changing 4 to 2 (just barely) manages to trigger the arithmetic overflow
test instead, leaving the platform realloc() out of it.
Mark Hammond [Tue, 8 Oct 2002 02:44:31 +0000 (02:44 +0000)]
Add os.path.supports_unicode_filenames for all platforms,
sys.getwindowsversion() on Windows (new enahanced Tim-proof <wink>
version), and fix test_pep277.py in a few minor ways.
Including doc and NEWS entries.
Barry Warsaw [Mon, 7 Oct 2002 17:27:55 +0000 (17:27 +0000)]
openfile(): Go back to opening the files in text mode. This undoes
the change in revision 1.11 (test_email.py) in response to SF bug
#609988. We now think that was the wrong fix and that WinZip was the
real culprit there.
Barry Warsaw [Mon, 7 Oct 2002 17:27:35 +0000 (17:27 +0000)]
_parsebody(): Use get_content_type() instead of the deprecated
get_type(). Also, one of the regular expressions is constant so might
as well make it a module global. And, when splitting up digests,
handle lineseps that are longer than 1 character in length
(e.g. \r\n).
Fred Drake [Mon, 7 Oct 2002 16:28:38 +0000 (16:28 +0000)]
Modified presentation of the grammar for calls to be easier to read
for both HTML and typeset renderings. Corresponds to revision
1.53.4.8 on the r22-maint branch.
Add test_pep277 to the expected skips on Linux. (This test seems to
be skipped everywhere except on Windows NT and descendants, but I'm
only going to add it to the skip list for the platform I can test.)
Tim Peters [Sat, 5 Oct 2002 17:54:56 +0000 (17:54 +0000)]
This test fails on Win98, which is fine, but when it failed it left
a junk directory behind that caused 4 other tests to fail later. Now
it cleans up after itself, and the 4 bogus later failures don't happen.
When looking for an alias, first look for the normalized name (which
still may contain dots), then if that doesn't exist look for the name
with dots replaced by underscores. This is a little more forgiving.
Mark Hammond [Thu, 3 Oct 2002 07:24:48 +0000 (07:24 +0000)]
Trivial fix to the pep277 checkin: ensure that exceptions always have a filename attribute (previously did only when string filenames were passed, but not when unicode)
Fred Drake [Tue, 1 Oct 2002 15:30:56 +0000 (15:30 +0000)]
When the HTML output dir is specified using --dir=~/foo, the tilde
needs to be expanded by mkhowto, since the shell won't touch it except
at the start of the complete argument.
Fred Drake [Tue, 1 Oct 2002 15:20:20 +0000 (15:20 +0000)]
Change the default path to icons so that "mkhowto" does the "right thing" by
default when used for 3rd-party docs. This requires the standard Python docs
to specify a location, but they are a bit of a special case in sharing one set
of icons among several documents.
Fred Drake [Tue, 1 Oct 2002 14:17:10 +0000 (14:17 +0000)]
Split the long email package examples into separate files and use
\verbatiminput instead of the verbatim environment -- this does the "right
thing" regarding page breaks in long examples for the typeset formats, and
has nice benefits for the HTML version as well.
Strangely, two out of three patches there seem already committed; but
the essential one (get rid of the assert in object_filenames in
ccompiler.py) was not yet applied.
This makes the build procedure for Twisted work again.
This is *not* a backport candidate despite the fact that identical
code appears to exist in 2.2.2; Twisted builds fine there, so there
must have been a change elsewhere.
Barry Warsaw [Mon, 30 Sep 2002 15:51:31 +0000 (15:51 +0000)]
With help from Martin v. Loewis, clarification is added for the
semantics of header chunks using byte and Unicode strings.
Specifically,
append(): When the given string is a byte string, charset (whether
specified explicitly in the argument list or implicitly via the
constructor default) is the encoding of the byte string, and a
UnicodeError will be raised if the string cannot be decoded with that
charset. If s is a Unicode string, then charset is a hint specifying
the character set of the characters in the string. In this case, when
producing an RFC 2822 compliant header using RFC 2047 rules, the
Unicode string will be encoded using the following charsets in order:
us-ascii, the charset hint, utf-8.
__init__(): Use the global USASCII Charset instance when the charset
argument is None. Also, clarification in the docstring.