Thomas Wouters [Tue, 3 Oct 2000 16:51:08 +0000 (16:51 +0000)]
On some systems (like Solaris), the master end of a tty/pty pair is
apparently not considered a terminal, and so isatty(3) returns false. So we
skip the test for ttyness of the master side and just check the slave side,
which should really be a terminal.
Barry Warsaw [Tue, 3 Oct 2000 16:02:05 +0000 (16:02 +0000)]
_PyImport_Fini(): Closed small memory leak when an embedded app calls
Py_Initialize()/Py_Finalize() in a loop. _PyImport_Filetab needed to
be deallocated. Partial closure of SF #110681, Jitterbug PR#398.
CGI scripts should *not* use /usr/bin/env, since on systems that don't
come standard with Python installed, Python isn't on the default $PATH.
Too bad that this breaks on Linux, where Python is in /usr/bin which
is on the default path -- the point is that you must manually edit
your CGI scripts when you install them.
Fred Drake [Tue, 3 Oct 2000 06:05:25 +0000 (06:05 +0000)]
$OFF_SITE_LINK_ICON: Don't define here; simply defining it overrides a
definition provided by previously loaded configuration code, and
testing whether it's defined isn't needed since the default was
false anyway.
get_link_icon(): Add support for $OFF_SITE_LINK_ICON_HEIGHT and
$OFF_SITE_LINK_ICON_WIDTH, giving the dimensions of the icon
being used. This can make for faster page display. Both are
optional.
make_my_titlegraphic(): Fix insertion of the off-site icon link.
do_env_funcdesc(): Remove debugging print.
handle_rfclike_reference(): Remove trailing colon from first line; it
doesn't really make sense and looks bad if we add an icon to
mark off-site links.
Fred Drake [Tue, 3 Oct 2000 05:56:55 +0000 (05:56 +0000)]
Replace minimal \seetext references with better annotated \seerfc
references, telling the reader more about what to expect at the other end
of the links.
Greg Ward [Tue, 3 Oct 2000 03:31:05 +0000 (03:31 +0000)]
Added a long-winded comment (and commented-out comment to go with out)
about how it would be nice to write absolute paths to the temporary
byte-compilation script, but this doesn't work because it screws up the
trailing-slash trickery done to 'prefix' in build_py's 'byte_compile()'
method.
Fixed to use 'execute()' instead of 'os.remove()' to remove the temporary
script: now it doesn't blow up in dry-run mode!
Fred Drake [Mon, 2 Oct 2000 21:20:22 +0000 (21:20 +0000)]
Remove comment about -lucb for the mmap module -- the module has been
changed so that this is no longer needed on the only platform this is
known to have been needed on.
Supporting rl_library_version is more trouble than it's worth --
readline doesn't have it before readline 2.2 and there's no
compile-time way to find out which readline version is in use.
Fred Drake [Mon, 2 Oct 2000 14:43:38 +0000 (14:43 +0000)]
make_icon_filename(): Convenience function to turn a partial filename
into a usable filename using $ICONSERVER and
$IMAGE_TYPE as needed.
get_link_icon(): Function to examine a URL and return the string to use
to insert an icon if the link points off-site, if needed
and $OFF_SITE_LINK_ICON is set.
Adjusted appropriate places to use these new functions.
Fix a bug in stack overflow error handling. This fixes half of Bug
#115555.
The error from s_push() on stack overflow was -1, which was passed
through unchanged by push(), but not tested for by push()'s caller --
which only expected positive error codes. Fixed by changing s_push()
to return E_NOMEM on stack overflow. (Not quite the proper error code
either, but I can't be bothered adding a new E_STACKOVERFLOW error
code in all the right places.)
Fred Drake [Mon, 2 Oct 2000 03:40:51 +0000 (03:40 +0000)]
Do not set Konquerer to be the default browser if $KDEDIR is set -- some
Linux distributions which provide both KDE and Gnome set this environment
variable even if the user is not using KDE. We do *not* want to start
Konquerer if KDE is not running unless the user actually tells us to!
Greg Ward [Mon, 2 Oct 2000 02:19:04 +0000 (02:19 +0000)]
Added the ability to do byte-compilation at build time, currently off
by default (since compiling at install time works just fine). Details:
- added 'compile' and 'optimize' options
- added 'byte_compile()' method
- changed 'get_outputs()' so it includes bytecode files
A lot of the code added is very similar to code in install_lib.py;
would be nice to factor it out further.
Greg Ward [Mon, 2 Oct 2000 02:15:08 +0000 (02:15 +0000)]
Finished the overhaul of byte-compilation options: there's now a 6-way
choice between (compile, no-compile) * (optimize=0, optimize=1,
optimize=2). Details:
- added --no-compile option to complement --compile, which has
been there for ages
- changed --optimize (which never worked) to a value option, which
expects 0, 1, or 2
- renamed 'bytecompile()' method to 'byte_compile()', and beefed
it up to handle both 'compile' and 'optimize' options
- fix '_bytecode_filenames()' to respect the new options
Fred Drake [Sun, 1 Oct 2000 17:50:46 +0000 (17:50 +0000)]
my_getpagesize(): New function; returns the size of a page of memory.
Versions are defined for Windows and Unix; the Unix
flavor uses sysconf() to get the page size; this avoids
the use of getpagesize(), which is deprecated and
requires an additional library on some platforms
(specifically, Reliant UNIX).
Reduced the 'bytecompile()' method to a one-line wrapper around
'util.byte_compile()'. Currently just reproduces the existing functionality
-- doesn't use any of the fancy features in the new 'byte_compile()'.
Added 'byte_compile(): an all-singing, all-dancing wrapper around the
standard 'py_compile.compile()' function. Laundry list of features:
- handles standard Distutils 'force', 'verbose', 'dry_run' flags
- handles various levels of optimization: can compile directly in
this interpreter process, or write a temporary script that is
then executed by a new interpreter with the appropriate flags
- can rewrite the source filename by stripping an optional prefix
and preprending an optional base dir.
Various docstring tweaks.
Fixed 'subst_vars()' so it actually blows up like the docstring claims
(and fixed the docstring not to claim it handles ${var}, which it
doesn't).
Changed to use the 'sub-commands' machinery:
- added 'sub_commands' class attr
- added 'has_*()' predicates referenced by the sub-command list
- rewrote 'run()' so it's a trivial loop over relevant sub-commands
Fred Drake [Fri, 29 Sep 2000 17:45:05 +0000 (17:45 +0000)]
Add a paragraph about an optimization bug in SGI compilers which affects
complex objects, and explain how to build so that Objects/complexobject.c
is compiled without optimization.
Fred Drake [Fri, 29 Sep 2000 15:17:36 +0000 (15:17 +0000)]
Spelling: internalization --> internationalization
Fixed displays of the interactive prompt in running text.
These close SourceForge bug #115658.
Also:
Updated discussion of tuple unpacking to reflect the general ability
to unpack any sequence type. Explained that it is possible to create
tuples which contain mutable values, and noted in the dictionary
section that such tuples cannot be used as keys.
Noted that .pyc and .pyo files can be run directly when provided as
the script parameter to the interpreter, and slightly clarified
comments about using modules with only the byte compiled code.
Removed some XXX comments that are no longer relevant.
Removed commented-out paragraph about __private names being experimental.
Thomas Heller [Fri, 29 Sep 2000 11:36:55 +0000 (11:36 +0000)]
Removed the extra_dirs and path_file metadata options.
They are unneeded: All this stuff is already done by the
install command which is run by bdist_wininst.
One bug has been fixed:
The root of the fake install tree is install.install_purelib,
not install.install_lib!
They are different if the extra_path option is used in
the setup function.
Tim Peters [Fri, 29 Sep 2000 04:03:10 +0000 (04:03 +0000)]
The 2.0b2 change to write .pyc files in exclusive mode (if possible)
unintentionally caused them to get written in text mode under Windows.
As a result, when .pyc files were later read-- in binary mode --the
magic number was always wrong (note that .pyc magic numbers deliberately
include \r and \n characters, so this was "good" breakage, 100% across
all .pyc files, not random corruption in a subset). Fixed that.
Thomas Heller [Thu, 28 Sep 2000 19:28:35 +0000 (19:28 +0000)]
Removed the implib_dir instance variable because it is unused.
Removed get_ext_libname() because it is unused.
Fixed get_libraries() to append an '_d' to the python debug
import library. If MSVC is used, do not add 'pythonxx.lib' to
the list of libraries, because this is handled better
by a pragma in config.h.
This should fix bug #115595, but it needs some more testing.
Fred Drake [Thu, 28 Sep 2000 19:07:53 +0000 (19:07 +0000)]
popen4(), class Popen4: popen4() support for Unix.
popen2(), popen3(): Reversed order of bufsize and mode parameters to
comply with what was here before (Python 1.5.2).
class Popen3: Factored the __init__() into a more basic initializer and
a helper method, to allow some re-use by the Popen4 class.
Use os.dup2() instead of os.dup() to create the proper
file descriptors in the child process.
This closes SourceForge bug #115330 and partially closes #115353.
Fred Drake [Thu, 28 Sep 2000 16:52:36 +0000 (16:52 +0000)]
Convert all entries on sys.path to absolute paths, and also update the
__file__ attributes of already-imported modules to be absolute. This helps
robustify the interpreter against os.chdir() calls from the application.
Only remove setdefaultencoding() from sys if it exists; if this module is
run as a script (since there is a _test() function that gets run), it broke
because the script attempts to remove it again after the import of site
has already done so. This allows the module to be run as a script again.
makepath(): New function, standardizes all pathname normalization in one
place.
Fred Drake [Thu, 28 Sep 2000 04:25:33 +0000 (04:25 +0000)]
Added some tests for the truncate() method; one is commented out because
cStringIO does not get it right (reported as SF bug #115531).
Added test for ValueError when write() is called on a closed StringIO
object. Commented out because cStringIO does not get it right
(reported as SF bug #115530).
Fred Drake [Wed, 27 Sep 2000 22:43:54 +0000 (22:43 +0000)]
Allow spaces in section names.
Do not expose the __name__ when reporting the list of options available
for a section since that is for internal use.
This closes SourceForge bug #115357.
Additionally, define InterpolationDepthError and MAX_INTERPOLATION_DEPTH.
The exception is raised by get*() when value interpolation cannot be
completed within the defined recursion limit. The constant is only
informative; changing it will not affect the allowed depth.
Fix the exit from get() so that None is not returned if the depth is met
or exceeded; either return the value of raise InterpolationDepthError.
Jeremy Hylton [Wed, 27 Sep 2000 20:51:17 +0000 (20:51 +0000)]
Fix buffer overflow vulnerabilities in calculate_path(). Code used
copied strings from environment variables and argv[0] into
fixed-length buffers without checking their length.
Reported by Stan Bubrouski; advice on fix from John Viega.