- 26 Sep, 2001 23 commits
-
-
Tim Peters authored
here means it has no more than one base class to rummage through (in which cases there's no potential confusion about resolution order).
-
Fred Drake authored
probably *should* be doing.
-
Tim Peters authored
-
Jeremy Hylton authored
Add raise_exception() to the _testcapi module. It isn't a test, but the C API exists only to support test_exceptions. raise_exception() takes two arguments -- an exception class and an integer specifying how many arguments it should be called with. test_exceptions uses BadException() to test the interpreter's behavior when there is a problem instantiating the exception. test_capi1() calls it with too many arguments. test_capi2() causes an exception to be raised in the Python code of the constructor.
-
Jeremy Hylton authored
If a new exception occurs while an exception instance is being created, try harder to make sure there is a traceback. If the original exception had a traceback associated with it and the new exception does not, keep the old exception. Of course, callers to PyErr_NormalizeException() must still be prepared to have tb set to NULL. XXX This isn't an ideal solution, but it's better than no traceback at all. It occurs if, for example, the exception occurs when the call to the constructor fails before any Python code is executed. Guido suggests that it there is Python code that was about to be executed -- but wasn't, say, because it was called with the wrong number of arguments -- then we should point at the first line of the code object anyway.
-
Jeremy Hylton authored
-
Jeremy Hylton authored
It's possible for PyErr_NormalizeException() to set the traceback pointer to NULL. I'm not sure how to provoke this directly from Python, although it may be possible. The error occurs when an exception is set using PyErr_SetObject() and another exception occurs while PyErr_NormalizeException() is creating the exception instance. XXX As a result of this change, it's possible for an exception to occur but sys.last_traceback to be left undefined. Not sure if this is a problem.
-
Fred Drake authored
In both the HTML and typeset versions of the documentation, add a colon after the name of a mail header so that it is more easily distinguished from other text.
-
Fred Drake authored
when using the \mailheader markup. Change a couple of inline examples to show the markup rather than the result.
-
Greg Ward authored
-
Fred Drake authored
Clarify the \mimetype description; it can be used to refer to a part of a MIME type name, so \mimetype{text} or \mimetype{plain} can be used, not just \mimetype{text/plain}.
-
Fred Drake authored
this before we finish the integration, along with some restructuring.
-
Thomas Wouters authored
a better place. Excessively fragile code, but at least it breaks when something in this area changes!
-
Barry Warsaw authored
added some new tests of message/delivery-status content type messages.
-
Barry Warsaw authored
-
Barry Warsaw authored
Also, add a clause to the big-if to handle message/delivery-status content types. These create a message with subparts that are Message instances, which best represent the header blocks of this content type.
-
Barry Warsaw authored
get_type(): Use a compiled regular expression, which can be shared. _get_params_preserve(): A helper method which extracts the header's parameter list preserving value quoting. I'm not sure that this needs to be a public method. It's necessary because we want get_param() and friends to return the unquoted parameter value, however we want the quote-preserved form for set_boundary(). get_params(), get_param(), set_boundary(): Implement in terms of _get_params_preserve(). walk(): Yield ourself first, then recurse over our subparts (if any).
-
Barry Warsaw authored
subtype for consistency with the rest of the package.
-
Barry Warsaw authored
typed_subpart_iterator(): Arguments major renamed to maintype and minor renamed to subtype for consistency with the rest of the package.
-
Barry Warsaw authored
Text.py and class Text => MIMEText.py and MIMEText MessageRFC822.py and class MessageRFC822 => MIMEMessage.py and MIMEMessage These are renamed so as to be more consistent; these are MIME specific derived classes for when creating the object model out of whole cloth.
-
Barry Warsaw authored
_handle_text(): If the payload is None, then just return (i.e. don't write anything). Subparts of message/delivery-status types will have this property since they are just blocks of headers. Also, when raising the TypeError, include the type of the payload in the error message. _handle_multipart(), _handle_message(): When creating a clone of self, pass in our _mangle_from_ and maxheaderlen flags so the clone has the same behavior. _handle_message_delivery_status(): New method to do the proper printing of message/delivery-status type messages. These have to be handled differently than other message/* types because their payloads are subparts containing just blocks of headers. In class DecodedGenerator: _dispatch(): Skip over multipart/* messages since we don't care about them, and don't want the non-text format to appear in the printed results.
-
Barry Warsaw authored
-
Barry Warsaw authored
Fred prefers. I'm not sure I like this organization, so it may change.
-
- 25 Sep, 2001 17 commits
-
-
Tim Peters authored
Rather than add umpteen new obscure internal Iter types, got rid of all of them. See the new comment.
-
Barry Warsaw authored
iterator, just test to make sure it has the two required iterator protocol methods __iter__() and next() -- actually just test hasattr-ness.
-
Guido van Rossum authored
their 'i' and 'r' variants) were not being generated if the corresponding nb_ slots were present in the type object. I bet this is because floor and true division were introduced after I last looked at that part of the code.
-
Fred Drake authored
-
Fred Drake authored
-
Fred Drake authored
use it. This simplifies the individual tests a little. Added some new tests related to exception handling.
-
Tim Peters authored
the local save/modify/restore of sys.stdout, but add machinery so that regrtest can tell test_support the value of sys.stdout at the time regrtest.main() started, and test_support can pass that out later to anyone who needs a "visible" stdout.
-
Guido van Rossum authored
__class__. The __new__ protocol is up to this. (Thanks to Tim for pointing this out.)
-
Tim Peters authored
-
Tim Peters authored
favor of local save/modify/restore. The test suite should run fine again.
-
Fred Drake authored
This closes SF bug #448918.
-
Fred Drake authored
-
Fred Drake authored
the object has been pickled; don't mutate the instance dict in the __getstate__() method. Other minor changes for style. Broke up the displayed interactive session to get better page-breaking behavior for typeset versions, and to point out an important aspect of the example. This closes SF bug #453914.
-
Guido van Rossum authored
- Made cls.__module__ writable. - Ensure that obj.__dict__ is returned as {}, not None, even upon first reference; it simply springs into life when you ask for it. (*) The pickling support is provisional for the following reasons: - It doesn't support classes with __slots__. - It relies on additional support in copy_reg.py: the C method __reduce__, defined in the object class, really calls calling copy_reg._reduce(obj). Eventually the Python code in copy_reg.py needs to be migrated to C, but I'd like to experiment with the Python implementation first. The _reduce() code also relies on an additional helper function, _reconstructor(), defined in copy_reg.py; this should also be reimplemented in C.
-
Guido van Rossum authored
standalone.
-
Fred Drake authored
This closes SF patch #461337.
-
Fred Drake authored
Cleaned up a bunch of XXX comments containing links to additional information, replacing them with proper references. Replaced "MacOS" with "Mac OS", since that's what the style guide says.
-