Ka-Ping Yee [Tue, 27 Mar 2001 08:13:42 +0000 (08:13 +0000)]
Fix some reloading problems (still more work needed).
Add hyperlinks to PEPs at http://www.python.org/peps/pep-%04d.html
Remove script directory (dirname of sys.argv[0]) from sys.path.
Jack Jansen [Mon, 26 Mar 2001 20:03:30 +0000 (20:03 +0000)]
Disable fused-add-mul instructions. They give a nonstandard result for some things that test_coercion complains about. The added performance is probably minimal for Python anyway.
Jeremy Hylton [Mon, 26 Mar 2001 19:53:38 +0000 (19:53 +0000)]
Bug fix: compile() called from a nested-scopes-enable Python was not
using nested scopes to compile its argument. Pass compiler flags
through to underlying compile call.
Fred Drake [Mon, 26 Mar 2001 15:06:15 +0000 (15:06 +0000)]
Update auto-detection for Konqueror to include KDE 2 -- the kfm command is
gone; "konqueror" is the new name, and the command-line args are different.
kfmclient has not changed, though.
Fred Drake [Sat, 24 Mar 2001 19:58:26 +0000 (19:58 +0000)]
get_version_string(): New function -- returns a Python string object that
gives the CVS revision of this file even if it does not include the
extra RCS "$Revision: " cruft.
initpyexpat(): Use get_version_string() instead of hard-coding magic
indexes into the RCS string (which may be affected by export options).
Guido van Rossum [Sat, 24 Mar 2001 19:17:35 +0000 (19:17 +0000)]
Document use_rawinput. (Although now that I think more about it, a
better solution would have been to factor out the raw_input() call and
make it into an overridable method. Oh well, maybe later...)
Barry Warsaw [Fri, 23 Mar 2001 20:24:07 +0000 (20:24 +0000)]
main(): Application of SF patch #405851, which allows this test to be
used by Jython. The tests in this module expect C locale, so be
explicit about setting that (for CPython). However, in Jython, there
is no C locale, so instead be explicit about setting the US locale.
Closes the patch.
Guido van Rossum [Fri, 23 Mar 2001 17:54:43 +0000 (17:54 +0000)]
Finishing touch to Ping's changes. This is a patch that Ping sent me
but apparently he had to go to school, so I am checking it in for him.
This makes PyRun_HandleSystemExit() a static instead, called
handle_system_exit(), and let it use the current exception rather than
passing in an exception. This slightly simplifies the code.
Barry Warsaw [Fri, 23 Mar 2001 17:53:49 +0000 (17:53 +0000)]
Two minor changes for better Jython compatibility. Finn Bock says:
Change 1: Not all 'modules' in sys.modules have a
sensible __file__ attribute. Some of our java package
can have the __file__ attribute set to None.
Change 2: In jython we have the jython license file in
<root> and the CPython license file in <root>/Lib. By
reversing the search sequence jython will find and
show the jython license file before the CPython file.
Change rfc822_escape() to ensure there's a consistent amount of whitespace
after each newline, instead of just blindly inserting a space at
the start of each line. (Improvement suggested by Thomas Wouters)
Fred Drake [Fri, 23 Mar 2001 16:42:08 +0000 (16:42 +0000)]
Re-write to no longer depend on an old version of PyXML. This now
implements a SAX XMLReader interface instead of the old Builder interface
used with PyDOM (now obsolete).
This only depends on the standard library, not PyXML.
Barry Warsaw [Fri, 23 Mar 2001 16:13:30 +0000 (16:13 +0000)]
Several changes for Jython portability. This closes SF patch
#403666. Specifically,
In codestr, force `c' to be global. It's unclear what the semantics
should be for a code object compiled at module scope, but bound and
run in a function. In CPython, `c' is global (by accident?) while in
Jython, `c' is local. The intent of the test clearly is to make `c'
global, so let's be explicit about it.
Jython also does not have a __builtins__ name in the module's
namespace, so we use a more portable alternative (though I'm not sure
why the test requires "__builtins__" in the g namespace).
Finally, skip the new.code() test if the new module doesn't have a
`code' attribute. Jython will never have this.
Ka-Ping Yee [Fri, 23 Mar 2001 13:17:50 +0000 (13:17 +0000)]
Show inherited methods, with hyperlinks to the base class they came from.
Font adjustment to improve viewing in Windows (the default monospaced font,
Courier New, seems to have no reasonable size in IE!)
Improve error handling. Try very hard to distinguish between failure to
find a module and failure during the module importing process.
Improve reloading behaviour. (Still needs some work.)
Add '.' to sys.path when running as a script at the command-line.
Don't automatically assume '-g' based on the platform. We'll just have
the batch file supply -g.
Fred Drake [Fri, 23 Mar 2001 04:39:24 +0000 (04:39 +0000)]
When creating an attribute node using createAttribute() or
createAttributeNS(), use the parallel setAttributeNode() or
setAttributeNodeNS() to add the node to the document -- do not assume
that setAttributeNode() will operate properly for both.
Guido van Rossum [Fri, 23 Mar 2001 04:01:07 +0000 (04:01 +0000)]
Fix memory leak with SyntaxError. (The DECREF was originally hidden
inside a piece of code that was deemed reduntant; the DECREF was
unfortunately *not* redundant!)
Ka-Ping Yee [Fri, 23 Mar 2001 02:46:52 +0000 (02:46 +0000)]
Add sys.excepthook.
Update docstring and library reference section on 'sys' module.
New API PyErr_Display, just for displaying errors, called by excepthook.
Uncaught exceptions now call sys.excepthook; if that fails, we fall back
to calling PyErr_Display directly.
Also comes with sys.__excepthook__ and sys.__displayhook__.
Ka-Ping Yee [Fri, 23 Mar 2001 00:12:53 +0000 (00:12 +0000)]
Fixes for various issues reported and discovered since Python 9:
Factor description of import errors into DocImportError.__str__.
Add "docother" and "fail" methods to Doc class.
Factor formatting of constants into "docother".
Increase max string repr limit to 100 characters.
Factor page generation into HTMLDoc.page.
Handle aliasing of names (objects appearing under an attribute
name different from their intrinsic __name__) by passing the
attribute name into each doc* method.
Handle methods at top level of modules (e.g. in random).
Try to do reloading efficiently.
Important fixes still to do:
Module reloading is broken by the unfortunate property that
failed imports leave an incomplete module in sys. Still
need to think of a good solution.
Can't document modules in the current directory, due to the
other unfortunate property that sys.path gets '.' when
you run 'python' but it gets the script directory when
you run a script. Need to ponder to find a solution.
The synopsis() routine does not work on .so modules.
Aliases cause duplicate copies of documentation to appear.
This is easy to fix, just more work.
Classes appear as their intrinsic name, not their attribute name,
in the class hierarchy. This should be fixed.
Inherited methods should be listed in class descriptions.
Guido van Rossum [Thu, 22 Mar 2001 21:59:20 +0000 (21:59 +0000)]
This is SF patch #405952, by Anthony Baxter:
cmd.py uses raw_input(); eats SIGCLD:
I discovered a rather nasty side effect of the standard cmd.py
library today. If it's sitting inside raw_input(), any SIGCLDs that
get sent to your application get silently eaten and ignored. I'm
assuming that this is something that readline is thoughtfully doing
for me.
This patch adds an instance attr that allows the user to select to
not use raw_input(), but instead use sys.stdin.readline()
[Changed slightly to catch EOFError only for raw_input().]
Fred Drake [Thu, 22 Mar 2001 18:26:47 +0000 (18:26 +0000)]
A small change to the C API for weakly-referencable types: Such types
must now initialize the extra field used by the weak-ref machinery to
NULL themselves, to avoid having to require PyObject_INIT() to check
if the type supports weak references and do it there. This causes less
work to be done for all objects (the type object does not need to be
consulted to check for the Py_TPFLAGS_HAVE_WEAKREFS bit).
Fred Drake [Thu, 22 Mar 2001 18:05:30 +0000 (18:05 +0000)]
Inform the cycle-detector that the a weakref object no longer needs to be
tracked as soon as it is clear; this can decrease the number of roots for
the cycle detector sooner rather than later in applications which hold on
to weak references beyond the time of the invalidation.
Fred Drake [Thu, 22 Mar 2001 17:52:17 +0000 (17:52 +0000)]
Make cPickle use the recently-added PyInstance_NewRaw() API to create
instance objects without calling the constructor. This is the same as
the new.instance() function.
Guido van Rossum [Thu, 22 Mar 2001 17:37:52 +0000 (17:37 +0000)]
Make this IDLE version 0.8. (We have to skip 0.7 because that was a
CNRI release in a corner of the basement of a government building on a
planet circling Aldebaran.)
Fred Drake [Thu, 22 Mar 2001 16:30:17 +0000 (16:30 +0000)]
Be more clear about the specific rules for supporting the cyclic GC in an
extension object. Also included an example showing exactly what needs to
be done and nothing else.
Thomas Wouters [Thu, 22 Mar 2001 14:50:24 +0000 (14:50 +0000)]
Allow the process of reading back what we wrote to a pty to transform
linefeeds into carriagereturn-linefeeds (which is apparently what IRIX
does.) Also add some comments, an extra test and reorganize it a bit.