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.
Fred Drake [Wed, 20 Sep 2000 05:49:09 +0000 (05:49 +0000)]
.use_latex(): Make this a little smarter so that it only runs pdflatex
once if all the temporary files are available from building
a DVI file. This can avoid two runs of pdflatex.
*Very* belated application of Thomas Heller's patch to handle
resource files. The gist of the patch is to treat ".rc" and ".mc"
files as source files; ".mc" files are compiled to ".rc" and then
".res", and ".rc" files are compiled to ".res". Wish I knew what
all these things stood for...
Tim Peters [Tue, 19 Sep 2000 23:46:56 +0000 (23:46 +0000)]
Treat trailing colon in os.path.join("a:", "b") same way for DOS as in
recent changes to ntpath.py and posixmodule.c. Thanks to Guido for
pointing out the inconsistency!
This patch adds a new Python C API called PyString_AsStringAndSize()
which implements the automatic conversion from Unicode to a string
object using the default encoding.
The new API is then put to use to have eval() and exec accept
Unicode objects as code parameter. This closes bugs #110924
and #113890.
As side-effect, the traditional C APIs PyString_Size() and
PyString_AsString() will also accept Unicode objects as
parameters.
The cause was that the replace code necessarily used a PCRE internal
function to to template expansion.
The fix changes the code to use an SRE internal if SRE is used, and a
PCRE internal if SRE is used; in a way that should work with 1.5.2.
The solution can be sped up tremendously under the assumption that the
choice between sre and pre is not changed during the execution of the
program; especially replace-all will be slow.
Fred Drake [Tue, 19 Sep 2000 15:36:19 +0000 (15:36 +0000)]
make_nav_sectref(): Create more minimal HTML, hanging the class attribute
off an existing anchor tag if available (I think it
always is, but am not completely sure).
Tim Peters [Tue, 19 Sep 2000 08:54:13 +0000 (08:54 +0000)]
Obscure marshal fixes:
When reading a short, sign-extend on platforms where shorts are
bigger than 16 bits.
When reading a long, repair the unportable sign extension that was
being done for 64-bit machines (it assumed that signed right shift
sign-extends).
Patch #101121, by Ka-Ping Yee: cosmetic cleanup of cgi.py, using my
style conventions. (Ping has checkin privileges but apparently
ignores them at the moment.)
Ping improves a few doc strings and fixes style violations like foo ( bar ).
An addition of my own: rearrange the printing of various items in
test() so that the (long) environment comes at the end. This avoids
having to scroll if you want to see the current directory or command
line arguments.
Make better use of GNU Pth -- patch by Andy Dustman.
I can't test this, so I'm just checking it in with blind faith in Andy.
I've tested that it doesn't broeak a non-Pth build on Linux.
Changes include:
- There's a --with-pth configure option.
- Instead of _GNU_PTH, we test for HAVE_PTH.
- Better signal handling.
- (The config.h.in file is regenerated in a slightly different order.)