summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* ndiffAssertEqual(): Stringify the arguments before runningBarry Warsaw2002-07-091-4/+16
| | | | | | | .splitlines() on them, since they may be Header instances. test_multilingual(), test_header_ctor_default_args(): New tests of make_header() and that Header can take all default arguments.
* make_header(): New function to take the output of decode_header() andBarry Warsaw2002-07-091-6/+45
| | | | | | | | | | | create a Header instance. Closes feature request #539481. Header.__init__(): Allow the initial string to be omitted. __eq__(), __ne__(): Support rich comparisons for equality of Header instances withy Header instances or strings. Also, update a bunch of docstrings.
* Fix SF Bug 564931: compile() traceback must include filename.Thomas Heller2002-07-091-0/+9
|
* Anthony Baxter's patch for non-strict parsing. This adds a `strict'Barry Warsaw2002-07-091-24/+71
| | | | | | | | | | | | | | | | | argument to the constructor -- defaulting to true -- which is different than Anthony's approach of using global state. parse(), parsestr(): Grow a `headersonly' argument which stops parsing once the header block has been seen, i.e. it does /not/ parse or even read the body of the message. This is used for parsing message/rfc822 type messages. We need test cases for the non-strict parsing. Anthony will supply these. _parsebody(): We can get rid of the isdigest end-of-line kludges, although we still need to know if we're parsing a multipart/digest so we can set the default type accordingly.
* Add the concept of a "default type". Normally the default type isBarry Warsaw2002-07-091-0/+22
| | | | | | | | | | text/plain but the RFCs state that inside a multipart/digest, the default type is message/rfc822. To preserve idempotency, we need a separate place to define the default type than the Content-Type: header. get_default_type(), set_default_type(): Accessor and mutator methods for the default type.
* __init__(): Don't attach the subparts if its an empty tuple. If theBarry Warsaw2002-07-091-2/+5
| | | | boundary was given in the arguments, call set_boundary().
* clone(): A new method for creating a clone of this generator (forBarry Warsaw2002-07-091-27/+24
| | | | | | | | | | | | | recursive generation). _dispatch(): If the message object doesn't have a Content-Type: header, check its default type instead of assuming it's text/plain. This makes for correct generation of message/rfc822 containers. _handle_multipart(): We can get rid of the isdigest kludge. Just print the message as normal and everything will work out correctly. _handle_mulitpart_digest(): We don't need this anymore either.
* __init__(): Be sure to set the default type to message/rfc822.Barry Warsaw2002-07-091-0/+2
|
* _structure(): A handy little debugging aid that I don't (yet) intendBarry Warsaw2002-07-091-0/+10
| | | | to make public, but that others might still find useful.
* TestEmailBase.ndiffAssertEqual(): Python 2.1's difflib doesn't have anBarry Warsaw2002-07-091-32/+186
| | | | | | | | | | ndiff function, so just alias it to assertEqual in that case. Various: make sure all openfile()/read()'s are wrapped in try/finally's so the file gets closed. A bunch of new tests checking the corner cases for multipart/digest and message/rfc822.
* New files which test the corners of multipart/message andBarry Warsaw2002-07-092-0/+48
| | | | message/rfc822 compliance.
* With the addition of Oleg's support for RFC 2231, it's time to bumpBarry Warsaw2002-07-091-1/+1
| | | | the version number to 2.1.
* Change the "__ private" names to "_ protected"; this has been a pain forFred Drake2002-07-081-31/+31
| | | | subclassing so many times it should simply be changed.
* Got rid of special case for Macintosh realloc slowdown: Tim fixed the problem.Jack Jansen2002-07-082-6/+1
|
* Fix from SF patch #527518: proxy config with user+pass authentication.Jeremy Hylton2002-07-071-3/+8
| | | | Bug fix candidate.
* Fix for SF bug #432621: httplib: multiple Set-Cookie headersJeremy Hylton2002-07-073-4/+131
| | | | | | | | | | If multiple header fields with the same name occur, they are combined according to the rules in RFC 2616 sec 4.2: Appending each subsequent field-value to the first, each separated by a comma. The order in which header fields with the same field-name are received is significant to the interpretation of the combined field value.
* Fix SF bug #575360Jeremy Hylton2002-07-061-0/+6
| | | | | | | Subclasses of Exception that define an __init__ must call Exception.__init__ or define self.args. Otherwise, str() will fail. Bug fix candidate.
* Handle HTTP/0.9 responses.Jeremy Hylton2002-07-061-19/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Section 19.6 of RFC 2616 (HTTP/1.1): It is beyond the scope of a protocol specification to mandate compliance with previous versions. HTTP/1.1 was deliberately designed, however, to make supporting previous versions easy.... And we would expect HTTP/1.1 clients to: - recognize the format of the Status-Line for HTTP/1.0 and 1.1 responses; - understand any valid response in the format of HTTP/0.9, 1.0, or 1.1. The changes to the code do handle response in the format of HTTP/0.9. Some users may consider this a bug because all responses with a sufficiently corrupted status line will look like an HTTP/0.9 response. These users can pass strict=1 to the HTTP constructors to get a BadStatusLine exception instead. While this is a new feature of sorts, it enhances the robustness of the code (be tolerant in what you accept). Thus, I consider it a bug fix candidate. XXX strict needs to be documented.
* Modifying EditorWindow causes breakpoints in that module to be removedKurt B. Kaiser2002-07-062-3/+11
| | | | | | from both sides of the split debugger. M Debugger.py M EditorWindow.py
* Decent burial for venerated ancestor (urn in attic)Kurt B. Kaiser2002-07-061-342/+0
|
* Remove dead code.Kurt B. Kaiser2002-07-061-38/+0
|
* 1. Test Sourceforge checkin, idle-dev postingKurt B. Kaiser2002-07-061-1/+0
| | | | 2. Remove extraneous comment
* Combine OldStackViewer.py with Debugger.py, removing dead code.unknown2002-07-053-290/+164
| | | | | | M Debugger.py : Incorporate StackViewer, NamespaceViewer classes M StackViewer.py : remove import OldStackViewer U OldStackViewer.py : remove file
* printlist(): Replaced the guts with a call to textwrap. Yay!Tim Peters2002-07-041-30/+19
|
* Docstring improvements. In particular, added docstrings for theGreg Ward2002-07-041-10/+27
| | | | | standalone wrap() and fill() functions. This should address the misunderstanding that led to SF bug 577106.
* append(): Clarify the expected type of charset.Barry Warsaw2002-07-031-1/+2
|
* Debugger Exception Info and GUI Stack Exception Traceback: finishKurt B. Kaiser2002-07-031-10/+23
| | | | implementation.
* Be consistent with the functions in the posix/nt module: docstringsFred Drake2002-07-021-3/+3
| | | | don't include a " -> None" for functions that have no return value.
* Convert raise to call exception class. Add whitespace.Jeremy Hylton2002-07-021-1/+1
|
* Remove bogus assignment to self.length in NamedNodeMap.__delitem__().Fred Drake2002-07-021-1/+0
|
* Bump required PyXML version to 0.6.5.Martin v. Löwis2002-06-301-1/+1
|
* Implement the encoding argument for toxml and toprettyxml.Martin v. Löwis2002-06-303-8/+29
| | | | Document toprettyxml.
* Merge from PyXML:Martin v. Löwis2002-06-301-2/+26
| | | | | | [1.3] Added documentation of the namespace URI for elements with no namespace. [1.4] New property http://www.python.org/sax/properties/encoding. [1.5] Support optional string interning in pyexpat.
* Add xml namespace initially (PyXML 1.19).Martin v. Löwis2002-06-301-1/+2
|
* Fix spacing.Martin v. Löwis2002-06-301-1/+1
|
* Merge changes from PyXML:Martin v. Löwis2002-06-301-13/+76
| | | | | | | | | | | | | | | | | | | | [1.15] Added understanding of the feature_validation, feature_external_pes, and feature_string_interning features. Added support for the feature_external_ges feature. Added support for the property_xml_string property. [1.16] Made it recognize the namespace prefixes feature. [1.17] removed erroneous first line [1.19] Support optional string interning in pyexpat. [1.21] Restore compatibility with versions of Python that did not support weak references. These do not get the cyclic reference fix, but they will continue to work as they did before. [1.22] Activate entity processing unless standalone.
* Code modernization. Replace v=s[i]; del s[i] with single lookup v=s.pop(i)Raymond Hettinger2002-06-3011-42/+19
|
* Another test of long headers.Barry Warsaw2002-06-292-0/+19
|
* Oleg Broytmann's support for RFC 2231 encoded parameters, SF patch #549133Barry Warsaw2002-06-292-1/+34
| | | | New test cases.
* Oleg Broytmann's support for RFC 2231 encoded parameters, SF patch #549133Barry Warsaw2002-06-291-0/+57
| | | | | | | | | Specifically, decode_rfc2231(), encode_rfc2231(): Functions to encode and decode RFC 2231 style parameters. decode_params(): Function to decode a list of parameters.
* Oleg Broytmann's support for RFC 2231 encoded parameters, SF patch #549133Barry Warsaw2002-06-291-7/+27
| | | | | | | | | | | | | | | | | Specifically, _formatparam(): Teach this about encoded `param' arguments, which are a 3-tuple of items (charset, language, value). language is ignored. _unquotevalue(): Handle both 3-tuple RFC 2231 values and unencoded values. _get_params_preserve(): Decode the parameters before returning them. get_params(), get_param(): Use _unquotevalue(). get_filename(), get_boundary(): Teach these about encoded (3-tuple) parameters.
* test_multilingual(): Test for Header.__unicode__().Barry Warsaw2002-06-291-0/+22
|
* __unicode__(): Patch # 541263 by Mikhail Zabaluev, implementationBarry Warsaw2002-06-291-0/+6
| | | | modified by Barry.
* Track change of begin() to _begin().Jeremy Hylton2002-06-281-2/+2
|
* Lots of new and updated tests to check for proper ascii headerBarry Warsaw2002-06-282-42/+187
| | | | | | | folding. Note that some of the Japanese tests have changed, but I don't really know if they are correct or not. :( Someone with Japanese and RFC 2047 expertise, please take a look!
* _max_append(): When adding the string `s' to its own line, it shouldBarry Warsaw2002-06-281-2/+2
| | | | | be lstrip'd so that old continuation whitespace is replaced by that specified in Header's continuation_ws parameter.
* Teach this class about "highest-level syntactic breaks" but only forBarry Warsaw2002-06-281-58/+151
| | | | | | | | | | | | | | | | | | | | | | | headers with no charset or 'us-ascii' charsets. Actually this is only partially true: we know about semicolons (but not true parameters) and we know about whitespace (but not technically folding whitespace). Still it should be good enough for all practical purposes. Other changes include: __init__(): Add a continuation_ws argument, which defaults to a single space. Set this to change the whitespace used for continuation lines when a header must be split. Also, changed the way header line lengths are calculated, so that they take into account continuation_ws (when tabs-expanded) and any provided header_name parameter. This should do much better on returning split headers for which the first and subsequent lines must fit into a specified width. guess_maxlinelen(): Removed. I don't think we need this method as part of the public API. encode_chunks() -> _encode_chunks(): I don't think we need this one as part of the public API either.
* _split_header(): The code here was terminally broken because it didn'tBarry Warsaw2002-06-281-53/+11
| | | | | | | | know anything about RFC 2047 encoded headers. Fortunately we have a perfectly good header splitter in Header.encode(). So we just call that to give us a properly formatted and split header. Header.encode() didn't know about "highest-level syntactic breaks" but that's been fixed now too.
* Simplify HTTPSConnection constructor.Jeremy Hylton2002-06-281-21/+7
| | | | See discussion in SF bug 458463.
* Close SF patch 523944: importing modules with foreign newlines.Jeremy Hylton2002-06-281-1/+1
| | | | | | Didn't use the patch, because universal newlines support made it easy. It might be worth fixing the actual problem in the 2.2 maintenance branch, in which case the patch is still needed.