Commit Graph

22954 Commits

Author SHA1 Message Date
Fred Drake 78e057a32a Clarify the version information for the unicode() built-in.
Closes SF bug #575272.
2002-06-29 16:06:47 +00:00
Barry Warsaw 1969817486 Another test of long headers. 2002-06-29 15:23:39 +00:00
Barry Warsaw 9546e7972c Oleg Broytmann's support for RFC 2231 encoded parameters, SF patch #549133
New test cases.
2002-06-29 05:58:45 +00:00
Barry Warsaw 12566a8826 Oleg Broytmann's support for RFC 2231 encoded parameters, SF patch #549133
Specifically,

decode_rfc2231(), encode_rfc2231(): Functions to encode and decode RFC
2231 style parameters.

decode_params(): Function to decode a list of parameters.
2002-06-29 05:58:04 +00:00
Barry Warsaw 908dc4bea8 Oleg Broytmann's support for RFC 2231 encoded parameters, SF patch #549133
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.
2002-06-29 05:56:15 +00:00
Barry Warsaw 3fdc889e76 test_multilingual(): Test for Header.__unicode__(). 2002-06-29 03:27:27 +00:00
Barry Warsaw 8e69bdac33 __unicode__(): Patch # 541263 by Mikhail Zabaluev, implementation
modified by Barry.
2002-06-29 03:26:58 +00:00
Greg Ward ae64f3adcd Add documentation for new textwrap module. 2002-06-29 02:38:50 +00:00
Greg Ward 8b46c71d5b Typo fix. 2002-06-29 01:23:45 +00:00
Jeremy Hylton 566fe9ef66 Track change of begin() to _begin(). 2002-06-28 23:54:30 +00:00
Barry Warsaw b6a9213930 Lots of new and updated tests to check for proper ascii header
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!
2002-06-28 23:49:33 +00:00
Barry Warsaw ba2577b7f1 _max_append(): When adding the string `s' to its own line, it should
be lstrip'd so that old continuation whitespace is replaced by that
specified in Header's continuation_ws parameter.
2002-06-28 23:48:23 +00:00
Barry Warsaw 766125080f Teach this class about "highest-level syntactic breaks" but only for
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.
2002-06-28 23:46:53 +00:00
Barry Warsaw 062749ac57 _split_header(): The code here was terminally broken because it didn't
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.
2002-06-28 23:41:42 +00:00
Jeremy Hylton 7c75c99a10 Simplify HTTPSConnection constructor.
See discussion in SF bug 458463.
2002-06-28 23:38:14 +00:00
Jeremy Hylton 13f99d7097 Close SF patch 523944: importing modules with foreign newlines.
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.
2002-06-28 23:32:51 +00:00
Fred Drake 2a3d7db93e Added character data buffering to pyexpat parser objects.
Setting the buffer_text attribute to true causes the parser to collect
character data, waiting as long as possible to report it to the Python
callback.  This can save an enormous number of callbacks from C to
Python, which can be a substantial performance improvement.

buffer_text defaults to false.
2002-06-28 22:56:48 +00:00
Jeremy Hylton 3e76d7f3b3 Add Bob Kline of HTTP 100 fame. 2002-06-28 22:39:56 +00:00
Jeremy Hylton be4fcf1875 Fixes for two separate HTTP/1.1 bugs: 100 responses and HTTPS connections.
The HTTPResponse class now handles 100 continue responses, instead of
choking on them.  It detects them internally in the _begin() method
and ignores them.  Based on a patch by Bob Kline.

This closes SF bugs 498149 and 551273.

The FakeSocket class (for SSL) is now usable with HTTP/1.1
connections.  The old version of the code could not work with
persistent connections, because the makefile() implementation read
until EOF before returning.  If the connection is persistent, the
server sends a response and leaves the connection open.  A client that
reads until EOF will block until the server gives up on the connection
-- more than a minute in my test case.

The problem was fixed by implementing a reasonable makefile().  It
reads data only when it is needed by the layers above it.  It's
implementation uses an internal buffer with a default size of 8192.

Also, rename begin() method of HTTPResponse to _begin() because it
should only be called by the HTTPConnection.
2002-06-28 22:38:01 +00:00
Fred Drake 71b63ff342 pyexpat code cleanup and minor refactorings:
The handlers array on each parser now has the invariant that None will
never be set as a handler; it will always be NULL or a Python-level
value passed in for the specific handler.

have_handler():  Return true if there is a Python handler for a
    particular event.

get_handler_name():  Return a string object giving the name of a
    particular handler.  This caches the string object so it doesn't
    need to be created more than once.

get_parse_result():  Helper to allow the Parse() and ParseFile()
    methods to share the same logic for determining the return value
    or exception state.

PyUnknownEncodingHandler(), PyModule_AddIntConstant():
    Made these helpers static.  (The later is only defined for older
    versions of Python.)

pyxml_UpdatePairedHandlers(), pyxml_SetStartElementHandler(),
pyxml_SetEndElementHandler(), pyxml_SetStartNamespaceDeclHandler(),
pyxml_SetEndNamespaceDeclHandler(), pyxml_SetStartCdataSection(),
pyxml_SetEndCdataSection(), pyxml_SetStartDoctypeDeclHandler(),
pyxml_SetEndDoctypeDeclHandler():
    Removed.  These are no longer needed with Expat 1.95.x.

handler_info:
    Use the setter functions provided by Expat 1.95.x instead of the
    pyxml_Set*Handler() functions which have been removed.

Minor code formatting changes for consistency.
Trailing whitespace removed.
2002-06-28 22:29:01 +00:00
Neil Schemenauer c9051640f8 Fix small bug. The count of objects in all generations younger then the
collected one should be zeroed.
2002-06-28 19:16:04 +00:00
Mark Hammond 0d3b2fe094 Patch 574531/Bug 574570 - allow freeze on windows to use the _winreg
extension.
2002-06-28 01:13:02 +00:00
Jack Jansen 2bb598067a The standard definition file is now called mwerks_shcarbon_plugin.h. 2002-06-27 22:10:19 +00:00
Jack Jansen 1892cf0312 Started on support for using standard setup.py to build at least
the "standard" modules. Unfinished, but shouldn't harm anything.
2002-06-27 22:09:19 +00:00
Jack Jansen 73aa1fff85 More fixes for building MacPython extension modules. It now actually succeeds
in building various modules.
2002-06-27 22:06:49 +00:00
Fredrik Lundh 3d9addd55a merged with SLAB codebase (version 1.0.1) 2002-06-27 21:36:21 +00:00
Fredrik Lundh 4fb7027ec0 made the code match the comments (1.5.2 compatibility) 2002-06-27 20:08:25 +00:00
Fredrik Lundh 6f7c3431c8 Fix bug #570057: Broken pre.subn() (and pre.sub())
This should be backported to the 2.2.X series (how
do I do that?)
2002-06-27 19:59:27 +00:00
Fred Drake 1add023b88 Integrate the tests for name interning from PyXML (test_pyexpat.py
revision 1.12 in PyXML).
2002-06-27 19:41:51 +00:00
Fred Drake b91a36b230 Integrate the changes from PyXML's version of pyexpat.c revisions
1.47, 1.48, 1.49 (name interning support).
2002-06-27 19:40:48 +00:00
Fred Drake d805fefff4 Added support for some of the more recently defined macros and
environments.
2002-06-27 18:38:06 +00:00
Fred Drake 2c813818c8 Clean up some markup. 2002-06-27 18:30:34 +00:00
Neal Norwitz dcd0500664 dis.dis() also supports modules 2002-06-26 22:32:47 +00:00
Jack Jansen c70815ac0f Disabled non-carbon builds (for the moment still optional) and made
these scripts work with the new precompiled headers.
2002-06-26 22:06:08 +00:00
Neal Norwitz 80a3e0a604 Whitespace normalization (remove tabs) 2002-06-26 22:05:33 +00:00
Fred Drake 292724d989 Fix various typos reported to python-docs. 2002-06-26 21:52:26 +00:00
Fred Drake 33fd5f7e02 Fix typo reported to python-docs. 2002-06-26 21:25:15 +00:00
Jack Jansen e0c62b4db0 Make the prototype match the declaration in the GUSI header files. 2002-06-26 20:43:24 +00:00
Jack Jansen c5601f4839 Undefine DPRINTF before defining it, there was a conflict with some other
definition.
2002-06-26 20:41:30 +00:00
Jack Jansen 3a96702b2b Undefine TRUE and FALSE before redefining them. 2002-06-26 20:40:42 +00:00
Jack Jansen e739a0dbe9 Got rid of an extraneous semicolon. 2002-06-26 20:39:20 +00:00
Jack Jansen 027f6722c4 Changed some prototypes to match the exact definition in some faraway Apple
header files. If we're building with precompiled headers these are in scope.
2002-06-26 20:37:40 +00:00
Jack Jansen 440a36f3ab In plugin projects use (by default) the new mwerks_shcarbon_pch
header file in stead of mwerks_carbonplugin_config.h.
2002-06-26 20:36:12 +00:00
Jack Jansen bc5e145341 Close the project after generating it, so we don't keep a gazillion project
files open when we're rebuilding them all.
2002-06-26 20:35:18 +00:00
Jack Jansen 7504dfedb4 - Got rid of non-carbon builds
- Use precompiled headers
- Rationalize config file names.
2002-06-26 20:17:02 +00:00
Jack Jansen 4439b7c67e Fixed a few showstoppers in the process of making MacPython use setup.py to build it's exension modules (in stead of relying on a private mechanism). It definitely doesn't work yet, but it looks promising. 2002-06-26 15:44:30 +00:00
Jack Jansen ab5320bfd9 Fixed various MacPython-specific issues found by attempting to use the standard core setup.py for MacPython. 2002-06-26 15:42:49 +00:00
Raymond Hettinger 0a2963c797 Apply SF 562987 modernizing Cookie to subclass from dict instead of UserDict 2002-06-26 15:19:01 +00:00
Fred Drake 3a159a8d25 Suppress the variable verbose output from test.xmltests; the inclusion of
timing information in the output makes the determination of success bogus.
2002-06-26 15:16:16 +00:00
Jack Jansen 09c7343273 Turns out GetArgv() options can be 4-tuples too, with the last value being the default (or something like that). Cater for this.
Also put in a safeguard against very long help strings.
2002-06-26 15:14:48 +00:00