Fixed unicode() to use the new API PyUnicode_FromEncodedObject().
This adds support for instance to the constructor (instances
have to define __str__ and can return Unicode objects via that
hook; string return values are decoded into Unicode using the
current default encoding).
Fred Drake [Thu, 6 Jul 2000 19:42:19 +0000 (19:42 +0000)]
Fix bug #392, reported by Jonathan Giddy <jon@dstc.edu.au>:
In posixmodule.c:posix_fork, the function PyOS_AfterFork is called for
both the parent and the child, despite the docs stating that it should
be called in the new (child) process.
This causes problems in the parent since the forking thread becomes the
main thread according to the signal module.
Calling PyOS_AfterFork() only in the child fixes this. Changed for both
fork() and forkpty().
Fred Drake [Thu, 6 Jul 2000 19:38:49 +0000 (19:38 +0000)]
Python 2.0 is not supposed to use string exceptions in the standard library
& extensions, so create exceptions in extension modules using the
PyErr_NewException() API.
Fred Drake [Thu, 6 Jul 2000 18:09:02 +0000 (18:09 +0000)]
Correct a markup nit that caused a space to be dropped from the HTML
version (actually a LaTeX2HTML bug), and clarified a sentence in the
mktime() description based entirely on comments from Grant Griffin
<grant.griffin@honeywell.com>.
Fred Drake [Thu, 6 Jul 2000 16:12:47 +0000 (16:12 +0000)]
Minor changes. Explain that for class exceptions, use excdesc but do not
document the constructor parameters. Need a better way, but this will do
for now.
Added new codec APIs and a new interface method .encode() which
works just like the Unicode one. The C APIs match the ones in the Unicode
implementation, but were extended to be able to reuse the existing
Unicode codecs for string purposes too.
Conversions from string to Unicode and back are done using the
default encoding.
Added prototypes for the new codec APIs for strings. These APIs
match the ones in the Unicode implementation, but were extended
to be able to reuse the existing Unicode codecs for string
purposes too.
Conversion from string to Unicode and back are done using the
default encoding.
Fred Drake [Thu, 6 Jul 2000 04:51:04 +0000 (04:51 +0000)]
Several small changes, mostly to the markup, to improve consistency and
internal hyperlinking. Move some things around, also for consistency
with other modules ("See also" stuff tends to live at the \section level,
before sub-sections, etc.).
Tim Peters [Wed, 5 Jul 2000 22:56:52 +0000 (22:56 +0000)]
Add more "volatile" decls to stop gcc -Wall warnings.
Somebody w/ gcc please check that the wngs are gone!
There are cheaper (at runtime) ways to prevent the wngs, but
they're obscure and delicate. I'm going for the easy Big
Hammer here under the theory that PCRE will be replaced by
SRE anyway.
Added new .isalpha() and .isalnum() methods to match the same
ones on the Unicode objects. Note that the string versions use
the (locale aware) C lib APIs isalpha() and isalnum().
Fixed so the ZIP file (which is bundled into an executable) goes in the
temporary directory ('bdist_base').
Added --dist-dir option to control where the executable is put.
Fred Drake [Wed, 5 Jul 2000 02:24:39 +0000 (02:24 +0000)]
Created a new chapter on structured markup processing, including the
existing SGML, HTML, & XML support, and providing a home for the new
XML support as it becomes documented.
Fred Drake [Wed, 5 Jul 2000 02:03:34 +0000 (02:03 +0000)]
Wrapped some long lines.
Cleaned up the table of error constants defined in pyexpat.errors; an
extra pair of braces had pretty much destroyed the table! (Not sure why.)
Moved the pyexpat.errors module documentation into a \section with the
proper headers for a module.
Fred Drake [Tue, 4 Jul 2000 23:51:31 +0000 (23:51 +0000)]
pyexpat.errors is a *strange* module!
It gets initialized when pyexpat is imported, and is only accessible as an
attribute of pyexpat; it cannot be imported itself. This allows it to at
least be importable after pyexpat itself has been imported by adding it
to sys.modules, so it is not quite as strange.
Tim Peters [Tue, 4 Jul 2000 17:44:48 +0000 (17:44 +0000)]
Removed Py_PROTO and switched to ANSI C declarations in the dict
implementation. This was really to test whether my new CVS+SSH
setup is more usable than the old one -- and turns out it is (for
whatever reason, it was impossible to do a commit before that
involved more than one directory).
2 fixes plus one extension:
- Actually count the linefeeds in a the CDATA content.
- Don't call the endtag handler for an unmatched endtag (this makes
the base class simpler since it doesn't have to deal with unopened
endtags).
- If the __init__ method is called with keyword argument
translate_attribute_references=0, don't attempt to translate
character and entity references in attribute values.
Fred Drake [Tue, 4 Jul 2000 04:15:53 +0000 (04:15 +0000)]
libinstall: For the first bytecode compilation pass, use -tt instead of
-t. This ensures that each installation from source is
checked for compliance. This is needed to make sure .py
files in the various Lib/plat-foo/ directories are tested
even if the core developers do not have access to the
corresponding platforms.
Fred Drake [Mon, 3 Jul 2000 18:11:56 +0000 (18:11 +0000)]
ANSI-fication, remove Py_PROTO, etc.
Revise math_1(), math_2(), stub-generating macros, and function tables to
use PyArg_ParseTuple() and properly provide the function name for error
message generation.
Fix pow() docstring for MPW 3.1; had said "power" instead of "pow".
Fred Drake [Mon, 3 Jul 2000 13:44:25 +0000 (13:44 +0000)]
Fix bug #379, reported by Phillip Porch <root@theproch.com>:
openpty(): Fallback code when os.openpty() does not exist attempted to
call _slave_open(), which should have been slave_open().
This bug only showed on platforms which do not provide a working openpty()
in the C library.
Added new Py_UNICODE_ISALPHA() and Py_UNICODE_ISALNUM() macros
which are true for alphabetic and alphanumeric characters resp.
The macros are currently implemented using the existing is* tables
but will have to be updated to meet the Unicode standard definitions
(add tables for non-cased letters and letter modifiers).
Fred Drake [Mon, 3 Jul 2000 09:56:23 +0000 (09:56 +0000)]
Eric S. Raymond <esr@thyrsus.com>:
This patch implements relative-path semantics for the "source" facility resembling
those of cpp(1), documents the change, and improves the shlex test main to
make it easier to test this feature. Along the way, it fixes a name error
in the existing docs.
[Additional documentation markup changes for consistency by FLD.]
Fred Drake [Mon, 3 Jul 2000 08:18:47 +0000 (08:18 +0000)]
cmpfiles(): Added shallow and use_statcache parameters, with same meanings
and defaults as for filecmp.cmp(). Updated docstring
accordingly, and formatted it more like others in the standard
library.
Fred Drake [Mon, 3 Jul 2000 07:23:13 +0000 (07:23 +0000)]
Martin von Löwis <martin@loewis.home.cs.tu-berlin.de>:
This patch delegates more string functions to string object methods,
uses the varargs delegation syntax, and stops using stringold.
Tim Peters [Sun, 2 Jul 2000 23:18:43 +0000 (23:18 +0000)]
The example_nt directory was old enough to vote. Frank Stajano
pointed out some of the problems he had following the instructions,
and I stumbled into the others: MSVC has changed in several
respects, Python has changed the directories into which it builds
its own Windows outputs, and we grew the unusual scheme of
appending "_d" to the names of debug-mode output files.
This should all work with VC6 + CVS Python now. Some other Windows
geek please confirm! And the less you know, the better <0.5 wink>.
Explanations and examples for versions of MSVC before 6, and
versions of Python before 2.0b1, have been removed, because
they're too different and so confuse life. This last step I OK'ed
with Guido first (indeed, 'twas his idea!).
Fredrik Lundh [Sun, 2 Jul 2000 22:25:39 +0000 (22:25 +0000)]
- experimental: added two new attributes to the match object:
"lastgroup" is the name of the last matched capturing group,
"lastindex" is the index of the same group. if no group was
matched, both attributes are set to None.
the (?P#) feature will be removed in the next relase.