Neal Norwitz [Fri, 23 Dec 2005 21:24:35 +0000 (21:24 +0000)]
Fix SF #1117398, cookielib LWPCookieJar and MozillaCookieJar exceptions
cookielib.LWPCookieJar and .MozillaCookieJar are documented to raise
cookielib.LoadError on attempt to load an invalid cookies file, but
raise IOError instead. Compromise by having LoadError subclass IOError.
[Patch #1375417] Massive rearrangement of the Library Reference.
Fred approved just checking it in; he may make further fixes.
The change shrinks the 'Generic OS' and other OS chapters, which had become
something of a dumping ground for random modules. It differs from the
last version of the patch: 1) I've added introductions for the new chapters (still missing a few -- search for 'intro')
2) a few modules have been rearranged slightly from the version in the patch
Barry Warsaw [Mon, 19 Dec 2005 14:43:44 +0000 (14:43 +0000)]
Revert most of r41765. Don't use $Revision$ in Py_GetBuildNumber(). Keep the
use of $(srcdir) in Makefile.pre.in so builds outside the source dir still
work.
Barry Warsaw [Sun, 18 Dec 2005 01:27:35 +0000 (01:27 +0000)]
Expose Subversion revision number (calculated via "svnversion .") to Python.
Add C API function Py_GetBuildNumber(), add it to the interactive prompt
banner (i.e. Py_GetBuildInfo()), and add it as the sys.build_number
attribute. The build number is a string instead of an int because it may
contain a trailing 'M' if there are local modifications.
Neal Norwitz [Thu, 15 Dec 2005 05:25:09 +0000 (05:25 +0000)]
Revert r41662 and the part of 41552 that originally caused the problem
(calling ftell(stdin) doesn't seem defined). So we won't test errors
from ftell unless we can do it portably.
Walter Dörwald [Wed, 14 Dec 2005 23:32:22 +0000 (23:32 +0000)]
If quopri uses the implementations from binascii do the tests a second time
using the Python implementations of the functions. This imcreases code
coverage and makes sure that both implementations do the same thing.
The .py files appear to have been checked in with Windows or inconsistent line
endings. The current check-in disrupts the 'svn blame', but hopefully it is
irrelevant for freshly imported code.
Armin Rigo [Wed, 14 Dec 2005 18:05:14 +0000 (18:05 +0000)]
When regenerating files like Python-ast.h, take care that the generated
comment based on 'sys.args[0]' does not depend on the path. For Python
builds from a remote directory ("/path/to/configure; make") the previous
logic used to include the "/path/to" portion in Python-ast.h. Then svn
would consider this file to be locally modified.
Fred Drake [Wed, 14 Dec 2005 06:20:35 +0000 (06:20 +0000)]
move the xml package implementation to xmlcore, and adjust the tests to
test that package, not the xmlcore/PyXML switcheroo fiasco in the xml
module/package
From a suggestion on c.l.py: modernize the introduction to the tutorial.
* Remove talk of shell scripting, replacing it by some more current examples
* Mention C++ and Java as well as C
Raymond H., please feel free to rewrite or revert as you see fit.
If the changes are OK, they could be backported to the 2.4-maint branch.
If a line had multiple semi-colons and ended with a semi-colon, we would
loop too many times and access a NULL node. Exit the loop early if
there are no more children.
Jeremy Hylton [Sat, 10 Dec 2005 18:50:16 +0000 (18:50 +0000)]
Add const to several API functions that take char *.
In C++, it's an error to pass a string literal to a char* function
without a const_cast(). Rather than require every C++ extension
module to put a cast around string literals, fix the API to state the
const-ness.
I focused on parts of the API where people usually pass literals:
PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type
slots, etc. Predictably, there were a large set of functions that
needed to be fixed as a result of these changes. The most pervasive
change was to make the keyword args list passed to
PyArg_ParseTupleAndKewords() to be a const char *kwlist[].
One cast was required as a result of the changes: A type object
mallocs the memory for its tp_doc slot and later frees it.
PyTypeObject says that tp_doc is const char *; but if the type was
created by type_new(), we know it is safe to cast to char *.
Hye-Shik Chang [Sat, 10 Dec 2005 17:44:27 +0000 (17:44 +0000)]
Patch #1276356: Implement new resource "urlfetch" for regrtest.
This enables even impatient people to run tests that require remote
files such as test_normalization and test_codecmaps_*.