summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* More test cases, including something that simulates what the profilerFred Drake2001-09-261-5/+66
| | | | probably *should* be doing.
* A file just to look at (using pydoc).Tim Peters2001-09-261-0/+297
|
* Add tests for new PyErr_NormalizeException() behaviorJeremy Hylton2001-09-262-0/+61
| | | | | | | | | | | | 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.
* PyErr_NormalizeException()Jeremy Hylton2001-09-261-1/+12
| | | | | | | | | | | | | | | | | | 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.
* Don't export generators future infoJeremy Hylton2001-09-261-1/+1
|
* Prevent a NULL pointer from being pushed onto the stack.Jeremy Hylton2001-09-261-1/+5
| | | | | | | | | | | | 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.
* Move the styling for the HTML version of \mailheader into the CSS file.Fred Drake2001-09-263-2/+3
| | | | | | 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.
* Note that the colon following a mail header name should not be includedFred Drake2001-09-261-5/+5
| | | | | | when using the \mailheader markup. Change a couple of inline examples to show the markup rather than the result.
* Typo fix.Greg Ward2001-09-261-1/+1
|
* Move the \mailheader description to the right place.Fred Drake2001-09-261-12/+13
| | | | | | 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}.
* Start making some markup adjustments; Barry has indicated he will work onFred Drake2001-09-261-17/+17
| | | | this before we finish the integration, along with some restructuring.
* Test case for SF bugs #463359 and #462937, added to test_grammar for lack ofThomas Wouters2001-09-262-0/+28
| | | | | a better place. Excessively fragile code, but at least it breaks when something in this area changes!
* Update the tests for the current incarnation of the email package, andBarry Warsaw2001-09-261-105/+198
| | | | added some new tests of message/delivery-status content type messages.
* More test messages for test_email.pyBarry Warsaw2001-09-262-0/+135
|
* _parsebody(): Use get_boundary() and get_type().Barry Warsaw2001-09-261-10/+16
| | | | | | | 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.
* has_key(): Implement in terms of get().Barry Warsaw2001-09-261-33/+58
| | | | | | | | | | | | | | | 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).
* __init__(): Arguments major renamed to maintype and minor renamed toBarry Warsaw2001-09-261-3/+3
| | | | subtype for consistency with the rest of the package.
* Updated docstrings. Also,Barry Warsaw2001-09-261-7/+7
| | | | | | typed_subpart_iterator(): Arguments major renamed to maintype and minor renamed to subtype for consistency with the rest of the package.
* Image.py and class Image => MIMEImage.py and MIMEImageBarry Warsaw2001-09-264-36/+40
| | | | | | | | | 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.
* In class Generator:Barry Warsaw2001-09-261-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | _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.
* cosmeticBarry Warsaw2001-09-261-0/+1
|
* The email package documentation, currently organized the way I thinkBarry Warsaw2001-09-268-0/+1168
| | | | Fred prefers. I'm not sure I like this organization, so it may change.
* SF [#463737] Add types.CallableIterTypeTim Peters2001-09-251-3/+5
| | | | | Rather than add umpteen new obscure internal Iter types, got rid of all of them. See the new comment.
* test_iterator(): Don't do a type comparison to see if it's anBarry Warsaw2001-09-251-1/+4
| | | | | | iterator, just test to make sure it has the two required iterator protocol methods __iter__() and next() -- actually just test hasattr-ness.
* add_operators(): the __floordiv__ and __truediv__ descriptors (andGuido van Rossum2001-09-251-0/+10
| | | | | | | 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.
* Update to support \mailheader and 5-column tables.Fred Drake2001-09-251-0/+52
|
* Simplify a helper by returning fewer values.Fred Drake2001-09-251-5/+4
|
* Factor out the protect-from-exceptions helpers and make capture_events()Fred Drake2001-09-251-35/+65
| | | | | | use it. This simplifies the individual tests a little. Added some new tests related to exception handling.
* Guido points out that sys.__stdout__ is a bit bucket under IDLE. So keepTim Peters2001-09-252-1/+13
| | | | | | | 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.
* _reconstructor(): there's no need for tricks with assignment toGuido van Rossum2001-09-251-9/+2
| | | | | __class__. The __new__ protocol is up to this. (Thanks to Tim for pointing this out.)
* test_support should be imported directly, not via test.test_support.Tim Peters2001-09-252-2/+2
|
* Get rid of the increasingly convoluted global tricks w/ sys.stdout, inTim Peters2001-09-252-28/+12
| | | | favor of local save/modify/restore. The test suite should run fine again.
* Clarified some points about the interface to the mmap() function.Fred Drake2001-09-251-10/+11
| | | | This closes SF bug #448918.
* Minor changes.Fred Drake2001-09-251-5/+8
|
* Revise the example to be more resiliant in the face of continued use afterFred Drake2001-09-251-18/+18
| | | | | | | | | 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.
* - Provisional support for pickling new-style objects. (*)Guido van Rossum2001-09-254-12/+142
| | | | | | | | | | | | | | | | | | | - 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.
* Set sys.save_stdout (to sys.stdout), so doctest-using tests can be runGuido van Rossum2001-09-251-0/+2
| | | | standalone.
* Added documentation for the SSL interface, contributed by Gerhard Häring.Fred Drake2001-09-251-0/+23
| | | | This closes SF patch #461337.
* Fix a URL (closing SF patch #462195).Fred Drake2001-09-251-25/+43
| | | | | | 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.
* SF patch #459385 (Norman Vine): time.timezone fix for Cygwin.Guido van Rossum2001-09-251-19/+19
| | | | Also did some whitespace normalization.
* + Display property functions in the same order they're specified toTim Peters2001-09-251-7/+7
| | | | | | | | | | | | | | property() (get, set, del; not set, get, del). + Change "Data defined/inherited in ..." header lines to "Data and non-method functions defined/inherited in ...". Things like the value of __class__, and __new__, and class vrbls like the i in class C: i = int show up in this section too. I don't think it's worth a separate section to distinguish them from non-callable attrs, and there's no obvious reliable way to distinguish callable from non-callable attrs anyway.
* Note a few tasks that are done now.Guido van Rossum2001-09-251-10/+14
|
* Separate out the type/class-related news and reword some items.Guido van Rossum2001-09-251-39/+63
| | | | Add news items about comparisons, repr(), __class__ assignment.
* Change repr() of a new-style class to say <class 'ClassName'> ratherGuido van Rossum2001-09-253-8/+15
| | | | | | than <type 'ClassName'>. Exception: if it's a built-in type or an extension type, continue to call it <type 'ClassName>. Call me a wimp, but I don't want to break more user code than necessary.
* Make __class__ assignment possible, when the object structures are theGuido van Rossum2001-09-252-4/+111
| | | | | | | | | | | | | | same. I hope the test for structural equivalence is stringent enough. It only allows the assignment if the old and new types: - have the same basic size - have the same item size - have the same dict offset - have the same weaklist offset - have the same GC flag bit - have a common base that is the same except for maybe the dict and weaklist (which may have been added separately at the same offsets in both types)
* + Got rid of all instances of <small>. Under IE5, GUI-mode pydoc hasTim Peters2001-09-251-22/+19
| | | | | | | | | | | | | always been close to useless, because the <small>-ified docstrings were too small to read, even after cranking up my default font size just for pydoc. Now it reads fine under my defaults (as does most of the web <0.5 wink>). If it's thought important to play tricks with font size, tough, then someone should rework pydoc to use style sheets, and (more) predictable percentage-of-default size controls. + Tried to ensure that all <dt> and <dd> tags are closed. I've read (but don't know) that some browsers get confused if they're not, and esp. when style sheets are in use too.
* GUI mode now displays useful stuff for properties. This is usually betterTim Peters2001-09-251-4/+14
| | | | | than text mode, since here we can hyperlink from the getter etc methods back to their definitions.
* + Text-mode (but not yet GUI mode) pydoc now produces useful stuff forTim Peters2001-09-241-9/+35
| | | | | | | | | | properties: the docstring (if any) is displayed, and the getter, setter and deleter (if any) functions are named. All that is shown indented after the property name. + Text-mode pydoc class display now draws a horizontal line between class attribute groups (similar to GUI mode -- while visually more intrusive in text mode, it's still an improvement).
* Make properties discoverable from Python:Tim Peters2001-09-243-27/+90
| | | | | | | | | | | | | - property() now takes 4 keyword arguments: fget, fset, fdel, doc. Note that the real purpose of the 'f' prefix is to make fdel fit in ('del' is a keyword, so can't used as a keyword argument name). - These map to visible readonly attributes 'fget', 'fset', 'fdel', and '__doc__' in the property object. - fget/fset/fdel weren't discoverable from Python before. - __doc__ is new, and allows to associate a docstring with a property.
* Added several new tests to check the behavior with respect to doctypeFred Drake2001-09-241-6/+77
| | | | | | | declarations and weird markup that we used to accept & ignore that recent versions raised an exception for; the original behavior has been restored and augmented (the user can decide what to do if they care; the default is to ignore it as done in early versions).