Martin v. Löwis [Sun, 30 Jun 2002 07:38:50 +0000 (07:38 +0000)]
Merge from PyXML:
[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.
Martin v. Löwis [Sun, 30 Jun 2002 07:21:24 +0000 (07:21 +0000)]
Merge changes from PyXML:
[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.
Barry Warsaw [Fri, 28 Jun 2002 23:49:33 +0000 (23:49 +0000)]
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!
Barry Warsaw [Fri, 28 Jun 2002 23:48:23 +0000 (23:48 +0000)]
_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.
Barry Warsaw [Fri, 28 Jun 2002 23:46:53 +0000 (23:46 +0000)]
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.
Barry Warsaw [Fri, 28 Jun 2002 23:41:42 +0000 (23:41 +0000)]
_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.
Jeremy Hylton [Fri, 28 Jun 2002 23:32:51 +0000 (23:32 +0000)]
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.
Fred Drake [Fri, 28 Jun 2002 22:56:48 +0000 (22:56 +0000)]
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.
Jeremy Hylton [Fri, 28 Jun 2002 22:38:01 +0000 (22:38 +0000)]
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.
Fred Drake [Fri, 28 Jun 2002 22:29:01 +0000 (22:29 +0000)]
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.
Jack Jansen [Wed, 26 Jun 2002 20:37:40 +0000 (20:37 +0000)]
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.
Jack Jansen [Wed, 26 Jun 2002 15:44:30 +0000 (15:44 +0000)]
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.
Jack Jansen [Wed, 26 Jun 2002 15:00:29 +0000 (15:00 +0000)]
This module broke on the Mac (where it can't work, but distutils seems to import it anyway) because it imported pwd and grp. Moved the import to inside the routine where they're used.
Kurt B. Kaiser [Wed, 26 Jun 2002 02:32:09 +0000 (02:32 +0000)]
Shutdown subprocess debugger and associated Proxies/Adapters when closing
the Idle debugger.
M PyShell.py : Call RemoteDebugger.close_remote_debugger()
M RemoteDebugger.py: Add close_remote_debugger(); further polish code used
to start the debugger sections.
M rpc.py : Add comments on Idlefork methods register(), unregister()
comment out unused methods
M run.py : Add stop_the_debugger(); polish code
Fred Drake [Tue, 25 Jun 2002 17:10:50 +0000 (17:10 +0000)]
Talk about interfaces rather than implementation classes where appropriate.
Add hyperlinks to make the documentation on the Attributes and AttributesNS
interfaces more discoverable.
Closes SF bug #484603.
Skip Montanaro [Tue, 25 Jun 2002 05:53:48 +0000 (05:53 +0000)]
Not sure how I forgot to check these in - thought I did all the files in one
fell swoop. Anyway, this just deletes a couple checks for dbm-type header
files that are now performed in setup.py. See patch 553108 for details.
Barry Warsaw [Mon, 24 Jun 2002 20:27:33 +0000 (20:27 +0000)]
In the Extension() call, add runtime_library_dirs so that a useful
-R/--rpath flag gets passed to the linker. Source builds of
BerkeleyDB do their default installs in locations not normally on
ld.so's search path.
Kurt B. Kaiser [Mon, 24 Jun 2002 17:03:37 +0000 (17:03 +0000)]
Clear associated breakpoints when closing an edit window.
M Debugger.py : Added clear_file_breaks()
M EditorWindow.py : Clear breaks when closed, commments->docstrings,
comment out some debugging print statements
M PyShell.py : comments->docstrings ; clarify extending EditorWindow
methods.
M RemoteDebugger.py: Add clear_all_file_breaks() functionality,
clarify some comments.
Jack Jansen [Fri, 21 Jun 2002 14:48:38 +0000 (14:48 +0000)]
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
OSX framework build process. Things fixed/modified:
- the filesystem case-sensitivity test now works for builds outside
the source directory
- various other fixes for building outside the source directory
- python.app now has a target in the main Makefile
- WASTE and AquaTk are found more automatically