Martin v. Löwis [Sun, 24 Sep 2000 19:40:25 +0000 (19:40 +0000)]
If dbopen is not in libc, checking whether it is in libdb will fail if
db_185.h has renamed that function to __db185_open, which it does in DB 3.1.
So don't check whether the function is in -ldb.
Fredrik Lundh [Sun, 24 Sep 2000 18:51:25 +0000 (18:51 +0000)]
- Improved handling of win32 proxy settings (addresses bug #114256).
The earlier code assumed "protocol=host;protocol=host;..." or "host",
but Windows may also use "protocol=host" (just one entry), as well as
"protocol://host". This code needs some more work, so I'll leave the
bug open for now.
Lars Gustäbel [Sun, 24 Sep 2000 10:53:31 +0000 (10:53 +0000)]
Bug fix to namespace handling in XMLGenerator (now adds declarations).
Bug fixes to XMLFilterBase (wrong ignorableWhitespace signature and
did not inherit set*Handler methods from XMLReader.)
Fred Drake [Sat, 23 Sep 2000 04:55:48 +0000 (04:55 +0000)]
Change the name of the exception from "pyexpat.error" to
"xml.parsers.expat.error", so it will reflect the public name of the
exception rather than the internal name.
Also change some of the initialization to use the new PyModule_Add*()
convenience functions.
Tim Peters [Sat, 23 Sep 2000 03:39:17 +0000 (03:39 +0000)]
Fix for SF bug 110624: float literals behave inconsistently.
I fixed the specific complaint but left the (many) large issues untouched.
See the (very long) bug report discussion for why:
http://sourceforge.net/bugs/?func=detailbug&group_id=5470&bug_id=110624
Note that while I left the interface to the undocumented public API function
PyFloat_FromString alone, its 2nd argument is useless. From a comment block
in the code:
RED_FLAG 22-Sep-2000 tim
PyFloat_FromString's pend argument is braindead. Prior to this RED_FLAG,
1. If v was a regular string, *pend was set to point to its terminating
null byte. That's useless (the caller can find that without any
help from this function!).
2. If v was a Unicode string, or an object convertible to a character
buffer, *pend was set to point into stack trash (the auto temp
vector holding the character buffer). That was downright dangerous.
Since we can't change the interface of a public API function, pend is
still supported but now *officially* useless: if pend is not NULL,
*pend is set to NULL.
Fred Drake [Sat, 23 Sep 2000 03:24:27 +0000 (03:24 +0000)]
Andrew Kuchling <akuchlin@mems-exchange.org>:
Add three new convenience functions to the PyModule_*() family:
PyModule_AddObject(), PyModule_AddIntConstant(), PyModule_AddStringConstant().
Fred Drake [Fri, 22 Sep 2000 17:05:04 +0000 (17:05 +0000)]
use_sans_serif(),
use_italics(): Remove both functions, inlining use_italics() at its
only call site.
init_myformat(): Uncomment line so that some internal markup does not
get generated, since it is not properly removed later.
(Fix on aspect of SourceForge bug #114749.)
Modified call to process_commands_wrap_deferred(), removing \code from
the list since it had a bad interaction with other changes in some contexts.
Address Bug #115057: add a --with-suffix option to set the EXE
variable in the Makefiles from the configure script. Usefil for
Cygwin and Mac OS X builds.
Neil Schemenauer [Fri, 22 Sep 2000 15:26:20 +0000 (15:26 +0000)]
- Add test for new SAVEALL debugging flag
- Use exceptions rather than asserts for failing tests.
- Reorganize tests and produce some output if verbose option is set.
Neil Schemenauer [Fri, 22 Sep 2000 15:22:38 +0000 (15:22 +0000)]
- Add DEBUG_SAVEALL option. When enabled all garbage objects found by the
collector will be saved in gc.garbage. This is useful for debugging a
program that creates reference cycles.
- Fix else statements in gcmodule.c to conform to Python coding standards.
Tim Peters [Fri, 22 Sep 2000 10:05:54 +0000 (10:05 +0000)]
Implemented new os.startfile function, unique to Windows, exposing a
subset of Win32 ShellExecute's functionality. Guido wants this because
IDLE's Help -> Docs function currently crashes his machine because of a
conflict between his version of Norton AntiVirus (6.10.20) and MS's
_popen. Docs for startfile are being mailed to Fred (or just read the
docstring -- it tells the whole story).
Changed webbrowser.py to use os.startfile instead of os.popen on Windows.
Changed IDLE's EditorWindow.py to pass an absolute path for the docs
(hardcoding ShellExecute's "directory" arg to "." as used to be done let
IDLE work, but made the startfile command exceedingly obscure for other
uses -- the MS docs are terrible, of course, & still not sure I
understand it).
Note that Windows Python must link with shell32.lib now! That's where
ShellExecute lives.
Tweak what happens when run on non-Windows platforms: set install prefix
as well as scheme, and don't convert all installation paths (that's now
done by the "install" command for us).
Changed all paths in the INSTALL_SCHEMES dict to Unix syntax, and added
'convert_paths()' method to convert them all to the local syntax (backslash
or colon or whatever) at the appropriate time.
Added SCHEME_KEYS to get rid of one hard-coded list of attributes (in
'select_scheme()').
Default 'install_path_file' to true, and never set it false (it's just
there in case some outsider somewhere wants to disable installation of the
.pth file for whatever reason).
Toned down the warning emitted when 'install_path_file' is false, since we
no longer know why it might be false.
Added 'warn_dir' flag to suppress warning when installing to a directory
not in sys.path (again, we never set this false -- it's there for outsiders
to use, specifically the "bdist_*" commands).
Pulled the loop of 'change_root()' calls out to new method 'change_roots()'.
Fix 'convert_path()' so it returns immediately under Unix -- prevents blowing
up when the pathname starts with '/', which is needed when converting
installation directories in the "install" command.
Fred Drake [Thu, 21 Sep 2000 22:27:16 +0000 (22:27 +0000)]
Denis S. Otkidach <ods@users.sourceforge.net>:
Show how code can be written to handle __getslice__ & friends in a way that
is compatible with pre-2.0 versions of Python while still working with the
"new" way of handling slicing.
Untested patch by Ty Sarna to make TELL64 work on older NetBSD systems.
According to Justin Pettit, this also works on OpenBSD, so I've added
that symbol as well.
Added a true unicode_internal_encode function and fixed the
unicode_internal_decode function to support Unicode objects
directly rather than by generating a copy of the object.
Special case the "s#" PyArg_Parse() token for Unicode objects:
"s#" will now return a pointer to the default encoded string data
of the Unicode object instead of a pointer to the raw UTF-16
data.
The latter is still available via PyObject_AsReadBuffer().
The patch also adds an optimization for string objects which is
based on the fact that string objects return the raw character data
for getreadbuffer access and are always single-segment.
Special case the "s#" PyArg_Parse() token for Unicode objects:
"s#" will now return a pointer to the default encoded string data
of the Unicode object instead of a pointer to the raw UTF-16
data.
The latter is still available via PyObject_AsReadBuffer().
The minidom.Node class has a debug attribute which, when its _debug
flag is true, is set to a StringIO object that silently collects all
debug messages. This is triggered by the Node._debug=1 statement at
the top of test_minidom.py. After the tests, we better delete that
StringIO object to avoid wasting memory. We also reset the _debug
flag. (Note that this is an undetectable memory leak, and the memory
doesn't get collected by the cycle-gc either, because it's all
reachable -- it's just useless.)
Fred Drake [Thu, 21 Sep 2000 20:10:23 +0000 (20:10 +0000)]
Remove memory leaks of strings/Unicode objects passed into the character
data and default handlers -- a new reference was being passed to
Py_BuildValue() for the "O" format character; using "N" plugs the leak.
Fixed two other (minor) leaks that occurred on various error conditions.
Removed uses of the UNLESS macro, which makes code hard to read, and is
Evil.
Fred Drake [Thu, 21 Sep 2000 15:58:02 +0000 (15:58 +0000)]
Add new environments: longtableii, longtableiii, and longtableiv, to
support long tables which might break across page boundaries. Otherwise
identical to tableii, tableiii, and tableiv.
Tim Peters [Thu, 21 Sep 2000 05:43:11 +0000 (05:43 +0000)]
Derived from Martin's SF patch 110609: support unbounded ints in %d,i,u,x,X,o formats.
Note a curious extension to the std C rules: x, X and o formatting can never produce
a sign character in C, so the '+' and ' ' flags are meaningless for them. But
unbounded ints *can* produce a sign character under these conversions (no fixed-
width bitstring is wide enough to hold all negative values in 2's-comp form). So
these flags become meaningful in Python when formatting a Python long which is too
big to fit in a C long. This required shuffling around existing code, which hacked
x and X conversions to death when both the '#' and '0' flags were specified: the
hacks weren't strong enough to deal with the simultaneous possibility of the ' ' or
'+' flags too, since signs were always meaningless before for x and X conversions.
Isomorphic shuffling was required in unicodeobject.c.
Also added dozens of non-trivial new unbounded-int test cases to test_format.py.