Commit Graph

23919 Commits

Author SHA1 Message Date
Raymond Hettinger ca2f537e32 Have os.environ() inherit from the iterable version of UserDict.
Closes SF bug 605731.
2002-09-06 19:36:31 +00:00
Raymond Hettinger 44c42b9cf3 Added a tutorial note and example regarding the scope of loop variables
in a list comprehension.  Includes a justification and a comparision
to regular for-loops.

Closes SF bug 605047.
2002-09-06 18:06:04 +00:00
Walter Dörwald 9ab7dd4d5b Add a test case that checks that the proper exception is raises
when the replacement from an encoding error callback is itself
unencodable.
2002-09-06 17:21:40 +00:00
Walter Dörwald 5ccaf8f129 Apply diff3.txt (plus additional documentation)
from SF patch http://www.python.org/sf/554192

This adds two new functions to mimetypes:
guess_all_extensions() which returns a list of all known
extensions for a mime type, and add_type() which adds one
mapping between a mime type and an extension.
2002-09-06 16:15:58 +00:00
Skip Montanaro 2c519981fb update docs to reflect that \b considers underscore to be part of a word. 2002-09-06 14:38:23 +00:00
Barry Warsaw e99e2f53e7 test_set_param(), test_del_param(): Test RFC 2231 encoding support by
Oleg Broytmann in SF patch #600096.  Whitespace normalized by Barry.
2002-09-06 03:56:26 +00:00
Barry Warsaw 3c25535dc8 _formatparam(), set_param(): RFC 2231 encoding support by Oleg
Broytmann in SF patch #600096.  Specifically, the former function now
encodes the triplets, while the latter adds optional charset and
language arguments.
2002-09-06 03:55:04 +00:00
Barry Warsaw 470288c54e test_mondo_message(): "binary" is not a legal content type, so with
the previous RFC 2045, $5.2 repair to get_content_type() this
subpart's type will now be text/plain.
2002-09-06 03:41:27 +00:00
Barry Warsaw 58fb61cce5 test_replace_header(): New test for Message.replace_header(). 2002-09-06 03:39:59 +00:00
Barry Warsaw 229727fa07 replace_header(): New method given by Skip Montanaro in SF patch
#601959.  Modified slightly by Barry (who added the KeyError in case
the header is missing.
2002-09-06 03:38:12 +00:00
Neal Norwitz b567392bbf SF bug # 585792, Invalid mmap crashes Python interpreter
Raise ValueError if user passes a size to mmap which is larger
than the file.
2002-09-05 21:48:07 +00:00
Neal Norwitz 7165af23e6 Added "that" to correct grammar, the rest is due to wrapping 2002-09-05 21:42:24 +00:00
Neal Norwitz bb9c5f5032 PyObject_RichCompareBool() already returns -1, 0, or 1, so return its value 2002-09-05 21:32:55 +00:00
Neal Norwitz 884baa1e6b --with(out)-thread is deprecated according to configure --help 2002-09-05 21:31:04 +00:00
Neal Norwitz 609ba81cdb SF # 555779, import user doesn't work with CGIs 2002-09-05 21:08:25 +00:00
Raymond Hettinger bd9adab138 Micro-optimization for list_contains. Factored double if test
out of the loop.
2002-09-05 20:18:08 +00:00
Raymond Hettinger aae5999b44 Micro-optimization for list_contains. Factored double if test
out of the loop.
2002-09-05 14:23:49 +00:00
Kurt B. Kaiser 63857a454d M PyShell.py
M RemoteDebugger.py
M ScriptBinding.py

Restart the execution server with a clean environment and execute the
active module from scratch upon activation of Run/F5.

Add functionality to PyShell.py to restart the execution server in a new
subprocess.  The server makes a connection to the Idle client which sends a
block of code to be executed.

Modify ScriptBinding.py to restart the subprocess upon Run/F5, assuming that
an execution is not currently in progress.  Remove Import Module functionality,
not required now that the code is executed in a clean environment.

If the Debugger is active, also restart the subprocess side of the split
debugger.  Add functionality to RemoteDebugger.py to support this.

At this time breakpoints will be lost in the subprocess if Run/F5 is activated.
A subsequent checkin of PyShell.py will implement reloading of the breakpoints
into the subprocess debugger.  I'm keeping this separate as the design may
change.
2002-09-05 02:31:20 +00:00
Raymond Hettinger 342456d5d2 smptlib did not handle empty addresses.
The problem was that it expected rfc822.parseaddr() to return None
upon a parse failure.  The actual, documented return value for a
parse failure is (None, None).

Closes SF bug 602029.
2002-09-05 01:14:07 +00:00
Raymond Hettinger d918884bb8 Fix typo 2002-09-04 23:52:42 +00:00
Walter Dörwald 5c1ee17742 Change the unicode.translate docstring to document that
Unicode strings (with arbitrary length) are allowed
as entries in the unicode.translate mapping.

Add a test case for multicharacter replacements.

(Multicharacter replacements were enabled by the
PEP 293 patch)
2002-09-04 20:31:32 +00:00
Raymond Hettinger a04c3d86ae Fix typo 2002-09-04 15:12:07 +00:00
Guido van Rossum efae8862fe In doc strings, use 'k in D' rather than D.has_key(k). 2002-09-04 11:29:45 +00:00
Skip Montanaro 979c74b969 added a bit about the change to the thread ticker 2002-09-03 21:25:14 +00:00
Guido van Rossum 472c5229c4 Delete the %c test from test_date_time() untill Brett Cannon has time
to fix it.  (It fails when the day of the month is a 1-digit number,
because %c produces space+digit there, while strptime seems to expect
zero+digit somehow.)
2002-09-03 21:10:10 +00:00
Jeremy Hylton d4c472c3e2 Move code for reading chunked responses in helper function,
along with some small changes (e.g. use of +=).
2002-09-03 20:49:06 +00:00
Skip Montanaro 066a8df3a4 missed this one on the previous multi-file checkin - see
http://python.org/sf/602191
2002-09-03 20:24:31 +00:00
Guido van Rossum 602d45194c Add a custom __str__ method to KeyError that applies repr() to the
missing key.  (Also added a guard to SyntaxError__str__ to prevent
calling PyString_Check(NULL).)
2002-09-03 20:24:09 +00:00
Skip Montanaro 99dba27e9a Bump default check interval to 100 instructions. Computers are much faster
than when this interval was first established.  Checking too frequently just
adds needless overhead because most of the time there is nothing to do and
no other threads ready to run.
2002-09-03 20:19:06 +00:00
Skip Montanaro d581d7792b replace thread state objects' ticker and checkinterval fields with two
globals, _Py_Ticker and _Py_CheckInterval.  This also implements Jeremy's
shortcut in Py_AddPendingCall that zeroes out _Py_Ticker.  This allows the
test in the main loop to only test a single value.

The gory details are at

    http://python.org/sf/602191
2002-09-03 20:10:45 +00:00
Jeremy Hylton d229b3ae04 SF bug [ 600488 ] Robustness tweak to httplib.py
If the transfer-encoding is unknown, ignore it.  Suggested by Tom
Emerson.
2002-09-03 19:24:24 +00:00
Guido van Rossum 6e813188db testConnectTimeout(): set the timeout to a smaller value; 0.02
sometimes wasn't short enough.
2002-09-03 19:17:47 +00:00
Guido van Rossum 83a072d953 Update the module doc comment. 2002-09-03 19:10:18 +00:00
Guido van Rossum 960bc5490b (Most of) SF patch 601369 (Christos Georgiou): obmalloc,structmodule:
64bit, big endian (issue 2 only).

This adds a bunch of memcpy calls via a temporary variable to avoid
alignment errors.  That's needed for some platforms.
2002-09-03 18:42:21 +00:00
Guido van Rossum 683c0fe414 Fix for SF bug 601077 by Zack Weinberg.
The new execvpe code would sometimes do the wrong thing when a
non-executable file existed earlier in the path and an executable file
of the same name existed later in the path.  This patch restores the
proper behavior (which is to execute the second file).  When only a
non-executable file exists, the correct error is still reported.
2002-09-03 16:36:17 +00:00
Tim Peters 17db21ffd0 Removed reliance on gcc/C99 extension. 2002-09-03 15:39:58 +00:00
Walter Dörwald 8709a420c4 Check whether a string resize is necessary at the end
of PyString_DecodeEscape(). This prevents a call to
_PyString_Resize() for the empty string, which would
result in a PyErr_BadInternalCall(), because the
empty string has more than one reference.

This closes SF bug http://www.python.org/sf/603937
2002-09-03 13:53:40 +00:00
Skip Montanaro 8e790e7007 expose PYTHON_API_VERSION macro as sys.api_version. Closes patch # 601456. 2002-09-03 13:25:17 +00:00
Martin v. Löwis f62a89b1e0 Ignore encoding declarations inside strings. Fixes #603509. 2002-09-03 11:52:44 +00:00
Andrew M. Kuchling 65b7282ef7 Add reminder about PEP293 2002-09-03 00:53:21 +00:00
Kurt B. Kaiser d01163615a (Re)Apply Sourceforge Python patch 520483, Sourceforge Idlefork patch
521908 (again) to MAIN

The patch applied by Steven was inadvertently reverted during the
transition to GRPC.

Python 2.3a0 (#3, May  8 2002, 23:37:01)
[GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
Type "copyright", "credits" or "license" for more information.
GRPC IDLE Fork 0.8.2
>>> print u'\xbfQu\xe9 pas\xf3?'
¿Qué pasó?
Modified Files:
	OutputWindow.py
2002-09-02 21:29:40 +00:00
Walter Dörwald f7bcd1d65c Check string for NULL before using it to format the error message.
(Spotted by Neal Norwitz)
2002-09-02 18:22:32 +00:00
Walter Dörwald 70bb0d4e65 Removed bogus PyUnicodeTranslateError_GetEncoding, as
UnicodeTranslateError doesn't have an encoding attribute.
(Spotted by Neal Norwitz)
2002-09-02 16:41:55 +00:00
Walter Dörwald fd08e4c9ed Limit the length of attribute names in exception messages
to prevent buffer overflows (spotted by Neal Norwitz).
2002-09-02 16:10:06 +00:00
Fred Drake f57b22a716 Minor change for symmetry with PyXML: PyDoc_STR should not include
the "safety" parentheses since some older compilers refuse to compile
the module then, claiming that static initializers are non-constant.

This doesn't actually make any difference for Python, since these
definitions are not used when compiling with a version of Python that
already defines the PyDoc_* macros.
2002-09-02 15:54:06 +00:00
Walter Dörwald 3aeb632c31 PEP 293 implemention (from SF patch http://www.python.org/sf/432401) 2002-09-02 13:14:32 +00:00
Jack Jansen 94fab762de Generate pythonw.sh on the fly.
Use the build python for as many things as possible.
2002-09-02 12:29:11 +00:00
Jack Jansen e3d9f405e9 Pass -x badsyntax to compileall.
Tweaks to make builds work for non-standard dstroot.
2002-09-02 12:16:00 +00:00
Barry Warsaw a4ce1cf34c _structure(): Use .get_content_type() 2002-09-01 21:04:43 +00:00
Guido van Rossum 674deb2eea SF bug 601775 - some int results that should be bool. 2002-09-01 15:06:28 +00:00