Commit graph

24603 commits

Author SHA1 Message Date
Jeremy Hylton
e190663742 Typo in docstring 2002-10-11 17:27:55 +00:00
Jeremy Hylton
96f1129de8 Fix for SF bug #599836: Don't duplicate headers.
If the request object has a header, it should override the default
header provided by the OpenerDirector.
2002-10-11 17:26:46 +00:00
Fred Drake
a0f453b2b1 Allow restricted code to get byteorder, getdefaultencoding(),
getrefcount(), maxunicode, and version_info.
2002-10-11 16:20:45 +00:00
Jeremy Hylton
83d0fd2fd1 Trying alphabet again 2002-10-11 16:05:07 +00:00
Jeremy Hylton
a325c42b2d Sort names alphabetically. 2002-10-11 15:55:17 +00:00
Jeremy Hylton
69dc0c5bf5 Add hexversion to list of safe sys names (SF bug 621447).
Bug fix candidate.
2002-10-11 15:51:29 +00:00
Jeremy Hylton
3bd6fde4e3 Use fdopen() to create file from fd. 2002-10-11 14:36:24 +00:00
Michael W. Hudson
549ab8a98d A test for the recent overflow-in-format-crash bug.
Only runs when sys.maxint == 2**32 - 1; different things go wrong
on a 64-bit box.
2002-10-11 13:46:32 +00:00
Guido van Rossum
cafe0eefc3 Back out news about SF patch 479898 -- it's withdrawn. 2002-10-11 11:47:28 +00:00
Martin v. Löwis
a5f0907d79 Back out #479898. 2002-10-11 05:37:59 +00:00
Guido van Rossum
049cd6b563 Fix a nasty endcase reported by Armin Rigo in SF bug 618623:
'%2147483647d' % -123 segfaults.  This was because an integer overflow
in a comparison caused the string resize to be skipped.  After fixing
the overflow, this could call _PyString_Resize() with a negative size,
so I (1) test for that and raise MemoryError instead; (2) also added a
test for negative newsize to _PyString_Resize(), raising SystemError
as for all bad arguments.

An identical bug existed in unicodeobject.c, of course.

Will backport to 2.2.2.
2002-10-11 00:43:48 +00:00
Neal Norwitz
f689b88e11 Add Greg Copeland for SF # 585913, Adds Galeon support to webbrowser.py 2002-10-10 22:50:53 +00:00
Neal Norwitz
8dd28eb973 SF # 585913, Adds Galeon support to webbrowser.py 2002-10-10 22:49:29 +00:00
Martin v. Löwis
36a4d8c20e Remove mentionings of DOS. 2002-10-10 18:24:54 +00:00
Martin v. Löwis
e893f2f3b4 Remove more DOS support. 2002-10-10 18:17:08 +00:00
Fred Drake
5430f4e9c8 Document when unittest was added to Python. 2002-10-10 16:16:25 +00:00
Andrew M. Kuchling
c309ccab64 Add new posix functions 2002-10-10 16:04:08 +00:00
Barry Warsaw
6f0f961741 Update email micro release number. 2002-10-10 15:58:19 +00:00
Barry Warsaw
df88b9fadf Document that the Charset constructor coerces its argument to lower
case.
2002-10-10 15:23:38 +00:00
Barry Warsaw
57ce1430b2 Document that get_content_charset() coerces its return value to lower
case.
2002-10-10 15:22:16 +00:00
Barry Warsaw
c986e54733 Bump version number to 2.4.2 to pick up the latest minor bug fixes. 2002-10-10 15:19:46 +00:00
Barry Warsaw
dc8087b26e New tests to verify that charsets are case insensitive, and that by
default get_body_encoding() cannot be SHORTEST.
2002-10-10 15:14:22 +00:00
Barry Warsaw
ee07cb1d70 get_content_charset(): RFC 2046 $4.1.2 says charsets are not case
sensitive.  Coerce the argument to lower case.
2002-10-10 15:13:26 +00:00
Barry Warsaw
14fc464ec9 __init__(): RFC 2046 $4.1.2 says charsets are not case sensitive.
Coerce the argument to lower case.  Also, since body encodings can't
be SHORTEST, default the CHARSETS failobj's second item to BASE64.
2002-10-10 15:11:20 +00:00
Guido van Rossum
d4f7da3cd7 Add .PHONY targets, to declare targets that aren't real files.
Immediate benefit: when you use "make -t" to avoid a global recompile
after a trivial header file touchup, Make will no longer create files
named all, oldsharedmods, and sharedmods.

(Not sure if I tracked down all such targets.  Not sure if I care.)
2002-10-10 15:04:04 +00:00
Martin v. Löwis
6ce1315bd3 Patch #612602: Streamline configure methods. 2002-10-10 14:36:13 +00:00
Martin v. Löwis
dbe3f76270 Patch #569139: Implementation of major, minor and makedev. 2002-10-10 14:27:30 +00:00
Andrew M. Kuchling
3e3e1296f0 [Bug #621039] Fix broken link 2002-10-10 11:32:30 +00:00
Andrew M. Kuchling
83992480ed [Bug #621038] Remove duplicated item 2002-10-10 11:31:48 +00:00
Kurt B. Kaiser
5afa1dfb72 M CallTips.py Add support for getting calltip from subprocess,
refactor a bit and clean up.

M PyShell.py       Cosmetic changes, delete blank lines, add # on some
                   blank lines.

M rpc.py           Add more debugging capability

M run.py           Add support for getting calltip from subprocess
                   Move import statements
2002-10-10 08:25:24 +00:00
Neal Norwitz
853ddd5cb9 SF #614596, fix for urllib2.AbstractBasicAuthHandler, John Williams (johnw42)
Make the regex case insensitive for some web sites which use Realm.
2002-10-09 23:17:04 +00:00
Fred Drake
aa02c8441b Accept Armin's documentation patch for SF bug #558179.
Adjusted some markup to make the descriptions more consistent.
2002-10-09 22:33:23 +00:00
Guido van Rossum
2b492b61c6 News about repr() and 8-bit characters, and setlocale() in the
readline module.
2002-10-09 21:40:48 +00:00
Skip Montanaro
628e3bf6cf 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).
2002-10-09 21:37:18 +00:00
Guido van Rossum
60c8a3aba8 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.
2002-10-09 21:27:33 +00:00
Guido van Rossum
8052f8921e Undo this part of the previous checkin:
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.

because PyObject_Repr() and PyObject_Str() ensure that this can never
happen.  Added a helpful comment instead.
2002-10-09 19:14:30 +00:00
Guido van Rossum
b00c07f038 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.
2002-10-09 19:07:53 +00:00
Guido van Rossum
06e2a5e052 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.
2002-10-09 18:17:06 +00:00
Martin v. Löwis
8b10f8988f Remove more DOS support. 2002-10-09 17:23:29 +00:00
Guido van Rossum
ecaaf643e2 Add a few people who were in the ACKS file in the 2.2.2 branch but not
on the trunk.
2002-10-09 16:37:03 +00:00
Andrew M. Kuchling
0a6fa9619e Minor edits and markup fixes 2002-10-09 12:11:10 +00:00
Tim Peters
26bc25a6c4 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?!).
2002-10-09 07:56:04 +00:00
Tim Peters
2a182dbf3f 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.
2002-10-09 01:07:11 +00:00
Tim Peters
cfac1d4a18 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.

I'll backport this to the 2.2 branch next.
2002-10-08 21:01:07 +00:00
Mark Hammond
8696ebcd28 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.
2002-10-08 02:44:31 +00:00
Martin v. Löwis
20eae69a9f Document PEP 293. 2002-10-07 19:01:07 +00:00
Martin v. Löwis
bd5e38d4cc Document PEP 277 changes. 2002-10-07 18:52:29 +00:00
Martin v. Löwis
bab9559d12 Include wctype.h. 2002-10-07 18:26:16 +00:00
Martin v. Löwis
19ff44643f Check for wctype.h. 2002-10-07 17:45:56 +00:00
Barry Warsaw
08c82b8086 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.
2002-10-07 17:27:55 +00:00