Barry Warsaw [Wed, 22 Sep 1999 15:45:51 +0000 (15:45 +0000)]
main(): wrap the device.setinfo() call around an exception handler.
It's possible to get a sunaudiodev.error (errno == EINVAL), although
I'm not exactly sure why, this at least won't crash the application.
Ditched the whole notion of "alias options": this meant dropping the
'alias_options' table and getting rid of some hairy code in the
Distribution constructor.
Resurrected the distribution options that describe the modules present
in the module distribution ('py_modules', 'ext_modules'), and added
a bunch more: 'packages', 'package_dir', 'ext_package', 'include_dirs',
'install_path'.
Updated some comments.
Added 'warn()' method to Command.
'Command.get_command_name()' now stores generated command name in
self.command_name.
Added 'write_file()' function.
Added global cache PATH_CREATED used by 'mkpath()' to ensure it doesn't
try to create the same path more than once in a session (and, more
importantly, to ensure that it doesn't print "creating X" more than
once for each X per session!).
Added 'install_path' option for giving non-packagized module
distributions their own directory (and .pth file).
Overhauled how we determine installation directories in
'set_final_options()' to separate platform-dependence and take
'install_path' option into account.
Added 'create_path_file()' to create path config file when 'install_path'
given.
Only run 'install_py' and 'install_ext' when, respectively, there are
some pure Python modules and some extension modules in the distribution.
Some option changes:
- rename 'dir' to 'build_dir'
- take 'package' from distribution option 'ext_package'
- take 'extensions' from distribution option 'ext_modules'
- take 'include_dirs' from distribution
Name keyword args explictly when calling CCompiler methods.
Overhauled how we generate extension filenames (in 'extension_filename()
and 'build_extension()') to take 'package' option into account.
Fred Drake [Mon, 20 Sep 1999 22:32:18 +0000 (22:32 +0000)]
parser__pickler(): Don't drop the third argument to
parser_ast2tuple(). Create an temporary empty dictionary to
use. Bug reported by Mark Favas <m.favas@per.dem.csiro.au>.
Peter Haight discovered that this code uses a mutable default for cnf
and then (under certain circumstances) can clobber the default!
He also submitted this patch as PR#82.
For a long time I've seen absurd tracebacks under -O (e.g., negative
line numbers), but very rarely. Since I was looking at tracebacks
anyway, thought I'd track it down. Turns out to be Guido's only
predictable blind spot <wink -- "char" is signed on some non-GvR
systems>. Patch follows.
After much hemming and hawing, we decided to roll back Fred's change.
It breaks Mailman, it was actually documented in the docstring, so it
was an intentional deviation from the usual del semantics. Let's
document the original behavior in Doc/lib/librfc822.tex.
(1) On Linux, we really need to trust the configure script to select
the right variant of gethostbyname_r for us, since not all Linuxes are
equal in this respect. Reported by Laurent Pointal.
(2) On BeOS, Chris Herborth reports that instead of arpa/inet.h you
must include net/netdb.h to get the inet_ntoa() and inet_addr()
prototypes.
Fred Drake [Tue, 14 Sep 1999 18:00:49 +0000 (18:00 +0000)]
Added "import string" to a couple of examples that describe string
module functions, to clarify that the import is not automatic.
Suggested by Koray Oner <Koray.Oner@Eng.Sun.COM>.
Changed selection of installation directories (in 'set_final_options()')
so that pure Python modules are installed to the platform-specific
directory if there are any extension modules in this distribution.
Straightened up the selection of installation directories for platform-
specific files; it was somewhat broken, and the comments were dead
wrong.
Now runs 'install_ext' command after 'install_py'.
Added 'output_dir' parameter to 'compile()' and 'link_shared_object().
Changed those two methods to only compile/link if necessary (according
to simplistic timestamp checks).
Added 'output_dir' to 'object_filenames()' and 'shared_object_filename()'.
Added 'newer_pairwise()' and 'newer_group()'.
Terminology change in 'newer()'.
Made 'copy_tree' respect dry_run flag a little better.
Added 'move_file()'.
Added 'output_dir' attribute, and 'output_dir' parameter to several method
signatures, and updated some docstrings to reflect it.
Some comments added.
Added 'announce()' and 'move_file()' methods.
Barry Warsaw [Thu, 9 Sep 1999 23:24:33 +0000 (23:24 +0000)]
canonic(): This used to be equivalent to str() but that caused too
much breakage (esp. in JPython which holds absolute path names in
co_filename already). This implementation uses os.path.abspath() as a
slightly better way to canonicalize path names. It implements a
cache.
Barry Warsaw [Thu, 9 Sep 1999 16:32:41 +0000 (16:32 +0000)]
Pdb.lineinfo(): Don't use os.popen('egrep ...') to find the line in
the file that a function is defined on. Non-portable to Windows and
JPython. Instead, new find_function() uses re module on a similar
(simple-minded) pattern.
It appears that inet_aton() doesn't really exist except in libresolv;
the proper function to call is inet_addr(). Since we already had code
to do that (for MS-Windows), this simplifies things a lot!
Fred Drake [Thu, 9 Sep 1999 14:21:52 +0000 (14:21 +0000)]
Added keyword parameter support to all public interfaces; keyword
names match the documentation.
Removed broken code that supports the __methods__ attribute on ast
objects; the right magic was added to Py_FindMethod() since this was
originally written. <ast-object>.__methods__ now works, so dir() and
rlcompleter are happy.
Barry Warsaw [Wed, 8 Sep 1999 16:26:33 +0000 (16:26 +0000)]
call_trace(): A fix for PR#73, if an exception occurred in the
tracefunc (or profilefunc -- we're not sure which), zap the global
trace and profile funcs so that we can't get into recursive loop when
instantiating the resulting class based exception.
Changed to reflect the new "command options" regime -- in particular,
we no longer explicitly pull distribution options out of our Distribution
object, but rather let the Distribution put them into the command object.
Careful rethink of command options, distribution options, distribution
attributes, etc. Biggest change was to the Distribution constructor
-- it now looks for an 'options' attribute, which contains values
(options) that are explicitly farmed out to the commands. Also,
certain options supplied to Distribution (ie. in the 'setup()' call in
setup.py) are now "command option aliases", meaning they are dropped
right into a certain command rather than being distribution options.
This is handled by a new Distribution class attribute,
'alias_options'.
Various comment changes to reflect the new way-of-thinking.
Added 'get_command_name()' method to Command -- was assuming its
existence all along as 'command_name()', so changed the code that
needs it to call 'get_command_name()'.
Ditched redundant docstrings and comments (overlap with ccompiler.py).
Ditched redundant '_gen_preprocess_options()' and '_gen_lib_options()'
-- now provided by ccompiler.py.
Fixed some filename extension variables -- added missing period.
Cosmetic tweaks.
Ditched '_gen_preprocess_options()' and '_gen_lib_options()' -- they're
now provided (minus the leading underscore) by the ccompiler module.
Fix 'compile()' to return the list of object files generated.
Cosmetic tweaks/delete cruft.
os.name is "posix" or "nt" or we don't care.
Added big comment about the kludginess of passing 'build_options'
to the link methods and how to fix it.
Added 'gen_preprocess_options()' and 'gen_lib_options()' convenience
functions -- the two cases are very similar for Unix C Compilers and
VC++, so I figured I might as well unify the implementations.
Fix indent error in __format(): del context[objid] at the end should
be executed in all cases, not just when it's not a list, tuple or
dict. Discovered by Christian Tismer.
Greg Ward [Sun, 29 Aug 1999 18:17:36 +0000 (18:17 +0000)]
Patch from Perry Stoll:
- fix some broken abstract methods
- kludge: add 'build_info' parameter to link methods
- add 'object_name()' and 'shared_library_name()'
- support for MSVCCompiler class on NT/Win95
Guido van Rossum [Thu, 26 Aug 1999 23:06:05 +0000 (23:06 +0000)]
Find the help.txt file relative to __file__ or ".", not in sys.path.
(Suggested by Moshe Zadka, but implemented differently.)
Add <<python-docs>> event which, on Unix, brings up Netscape pointing
to http://www.python.doc/current/ (a local copy would be nice but its
location can't be predicted). Windows solution TBD.
Fred Drake [Thu, 26 Aug 1999 17:23:54 +0000 (17:23 +0000)]
posix_putenv(): Constrain memory leakage when setting the same
environment variable repeatedly. I posted this to the list
some time ago, but only now got around to asking g--d- what he
thought about it.
Guido van Rossum [Thu, 26 Aug 1999 15:52:33 +0000 (15:52 +0000)]
Sjoerd Mullender writes:
"""
Added some optional arguments to the XMLParser __init__ method to
specify that selected non-standard constructs are to be accepted.
Also removed the documentation for handle_entityrefs since it isn't
used.
"""
Guido van Rossum [Thu, 26 Aug 1999 15:50:43 +0000 (15:50 +0000)]
Sjoerd Mullender writes:
"""
Extended chunk so that it can also handle formats that are almost
according to EA IFF 85. In particular, added options to handle
little-endian and to handle formats that include the header size in
the chunk size value.
Fixed a bug where the header size was included in the chunk size, which
it isn't according to EA IFF 85.
Added a new method getsize() to get the size of the chunk (excluding
header).
Fixed chunk documentation (TIFF doesn't look like it uses chunks).
Converted wave to use chunk. Wave uses EA IFF 85 chunks except that
it uses little-endian encoding of integer data.
Removed __del__ methods from aifc and wave since I got an
AttributeError there upon exit.
"""
Guido van Rossum [Fri, 20 Aug 1999 18:26:06 +0000 (18:26 +0000)]
Add calls to self.protocol("WM_DELETE_WINDOW", self.destroy) to the Tk
and Toplevel class constructors. This means that if the window
manager closes the window, the Python-side Tkinter data structures
will be destroyed correctly. (Most apps do this anyway, and it's
recommended practice; I see no reason why making it the default
behavior could be bad.)
Fred Drake [Fri, 20 Aug 1999 14:28:29 +0000 (14:28 +0000)]
rewrite_descriptor(): Fix bug that dropped the first TEXT node from
<description> elements. Add another sanity
check to make sure a special case only becomes
involved for <opcodedesc> and <opcodedescni>
elements.
fixup_paras_helper(): Clean up control flow.
Everywhere that checks node.nodeType==ELEMENT and node.tagName now
just check node.nodeName (nodeName is guaranteed for all node types
and will be special values that don't conflict with GIs for
non-ELEMENT nodes). Simplifies a number of tests and improves
readability in a lot of places.