Barry Warsaw [Thu, 10 Feb 2000 20:26:45 +0000 (20:26 +0000)]
Document the API changes to the nntplib module (exceptions become
classes, NNTP.__init__() grows a new optional argument to set reader
mode on the server).
Barry Warsaw [Thu, 10 Feb 2000 20:25:53 +0000 (20:25 +0000)]
Added new exception classes:
NNTPError - derived from Exception, it's the base class for all
other exceptions in this module
NNTPReplyError - what used to be error_reply
NNTPTemporaryError - what used to be error_temp
NNTPPermanentError - what used to be error_perm
NNTPProtocolError - what used to be error_proto
NNTPDataError - what used to be error_data
All the old names are retained for backwards compatibility; they point
to the class that replaces them. Also, any code in this module that
raises an exception, now does so with the exception class.
NNTP.__init__(): Added a new optional argument `readermode', which is
a flag that defaults to false. When set to true, the "mode reader"
command is sent to the NNTP server before user authentication. Reader
mode is sometimes necessary if you are connecting to an NNTP server on
the local machine and intend to call reader-specific comamnds, such as
`group'. If you get unexpected NNTPPermanentErrors, you might need to
set readermode. Patch provided by Thomas Wouters (who include the
standard disclaimer on is patches@python.org submission), and inspired
by Jim Tittsler.
Greg Ward [Thu, 10 Feb 2000 02:15:52 +0000 (02:15 +0000)]
Patch from Thomas heller:
* don't need to mention python<ver>.lib -- it's done by a pragma
* add debug flags for compile and link, and use them
* fix 'link_shared_library()' to pass everything to 'link_shared_object()'
* change filename when shared object with debug info (ugh)
Jeremy Hylton [Thu, 10 Feb 2000 00:47:08 +0000 (00:47 +0000)]
add ExampleASTVisitor:
* prints out examples of nodes that are handled by visitor. simply a
development convenience
remove NestedCodeGenerator -- it was bogus after all
replace with generateFunctionCode, a method to call to generate code
for a function instead of a top-level module
fix impl of visitDiscard (most pop stack)
emit lineno for pass
handle the following new node types: Import, From, Getattr, Subscript,
Slice, AssAttr, AssTuple, Mod, Not, And, Or, List
LocalNameFinder: remove names declared as globals for locals
PythonVMCode: pass arg names to constructor, force varnames to contain
them all (even if they aren't referenced)
Greg Ward [Wed, 9 Feb 2000 02:18:39 +0000 (02:18 +0000)]
Added 'debug' flags to compile and link methods, and added dummy code for
someone who knows Windows/MSVC++ to come along and add the right flags.
Comment noting that 'link_static_lib()' signature is inconsistent with
the other compiler classes (uh-oh!)
Greg Ward [Wed, 9 Feb 2000 02:16:14 +0000 (02:16 +0000)]
Added 'debug' flag to compile and link method signatures.
Doc fix: several paragraphs under 'link_static_lib()' moved to
'link_shared_lib()', where they belong.
Jeremy Hylton [Tue, 8 Feb 2000 19:01:29 +0000 (19:01 +0000)]
now produces valid pyc files for a least a trivial subset of the
language.
CodeGenerator:
* modify to track stack depth
* add emit method that call's PythonVMCode's makeCodeObject
* thread filenames through in hackish way
* set flags for code objects for modules and functions
XXX the docs for the flags seem out of date and/or incomplete
PythonVMCode:
* add doc string describing the elements of a real code object
LineAddrTable:
* creates an lnotab (no quite correctly though)
Jeremy Hylton [Fri, 4 Feb 2000 19:37:35 +0000 (19:37 +0000)]
rapid evolution towards producing real .pyc files (even though I don't
handle most of the language syntax yet)
create NestedCodeGenerator used to generator the separate code object
that needs to be passed as an argument to MAKE_FUNCTION when a def
stmt is found (probably useful for class too)
change CodeGenerator.visitFunction to use the NestedCG
add CompiledModule class to handle creation of .pyc (pretty minimal
for now)
add makeCodeObject method to PythonVMCode that replaces symbolic names
with indexes into slots of the code code. the design of this
class will probably need to be revised.
More trivial comment -> docstring transformations by Ka-Ping Yee,
who writes:
Here is batch 2, as a big collection of CVS context diffs.
Along with moving comments into docstrings, i've added a
couple of missing docstrings and attempted to make sure more
module docstrings begin with a one-line summary.
I did not add docstrings to the methods in profile.py for
fear of upsetting any careful optimizations there, though
i did move class documentation into class docstrings.
The convention i'm using is to leave credits/version/copyright
type of stuff in # comments, and move the rest of the descriptive
stuff about module usage into module docstrings. Hope this is
okay.
Greg Ward [Thu, 3 Feb 2000 23:07:19 +0000 (23:07 +0000)]
Changed 'compile()' method to compile files one-at-a-time -- gives better
feedback and, theoretically, the opportunity to set compiler flags
on a per-file basis.
Mark Hammond renames the x86 projects back to what they were named
before the patch by Trent Mick. Since he now also works for
ActiveState, I suppose he overrides Trent. :-)
According to Harri Pasanen, the Solaris+gcc test for LINKFORSHARED
needed an adaptation for the latest gcc -- we need to grep stderr as
well as stdout for the magic string BFD. (Does anybody know what BFD
means?)
According to Harri Pasanen, the Solaris+gcc test for LINKFORSHARED
needed an adaptation for the latest gcc -- we need to grep stderr as
well as stdout for the magic string BFD. (Does anybody know what BFD
means?)
# module filecmp
# combo of old cmp, cmpcache and dircmp with redundancies removed
#
# bugs fixed:
# dircmp.dircmp was not ignoring IGNORES
# old stuff could falsely report files as "identical" when contents actually differed
#
# enhancements:
# dircmp has a more straightforward interface
#cmp enhanced by Moshe Zadca
#dircmp enhanced byGordon McMillan
Make read() and readlines() conform more to the file object interface:
the default arg for read() is -1, not None, and readlines() has an
optional argument (which for now is ignored).
Fixed a TypeError: not enough arguments; expected 4, got 3.
When authentication is needed, the default http_error_401 method calls
retry_http_basic_auth. The default version of that method expected a
data argument which wasn't provided, so now we provide the argument if
it was given and we also made the data argument optional.
Also changed other calls where data was optional to not pass data if
it was not passed to the calling method (in line with other similar
occurances).
Greg Ward [Sun, 30 Jan 2000 18:34:15 +0000 (18:34 +0000)]
Added 'description' class attribute to every command class (to help the
'--help-commands' option).
Shuffled imports around in a few command modules to avoid expensive
up-front import of sysconfig (and resulting delays in generating list
of all commands).
Greg Ward [Sun, 30 Jan 2000 18:30:32 +0000 (18:30 +0000)]
Improvements to the help system:
* "--help" can now come either before or after particular commands
to get help on and can give help on multiple commands, eg.
"--help install dist" gives help on those two commands
* added "--help-commands" option, implemented by the 'print_commands()'
and 'print_command_list()' methods
Jack Jansen [Mon, 24 Jan 2000 10:37:59 +0000 (10:37 +0000)]
Big oops: macfs has always been using a private exception but calling it mac.error.
It now uses MacOS.Error (the OSErr valued error) and advertises that too. This
fix shouldn't break anything, I guess.
Guido van Rossum [Thu, 20 Jan 2000 20:49:28 +0000 (20:49 +0000)]
Two patches from Jack Jansen:
Three bgen mods:
- support for FSSpecs passed-by-value and points-passed-by-reference added.
- strip single-line comments when parsing header files
- if a definition is blacklisted _do_ output it, but in comment
Greg Ward [Mon, 17 Jan 2000 18:04:04 +0000 (18:04 +0000)]
Added code to use Jim Ahlstrom's zipfile.py module if the external zip
command wasn't found or failed. (Code supplied by Thomas Heller
<thomas.heller@ion-tof.com>.)
Guido van Rossum [Fri, 14 Jan 2000 16:33:09 +0000 (16:33 +0000)]
According to Ron Bickers, and with apparent approval of Chris
Herborth, the code in list2set() that sets max unconditionally to 0
should not be used on BeOS. So be it. Anybody using BeOS, please
test!
Guido van Rossum [Wed, 12 Jan 2000 22:45:54 +0000 (22:45 +0000)]
Fix a bug in exec_statement() noted incidentally by Tim Peters in
PR#175 -- when exec is passed a code object, it didn't sync the locals
from the dictionary back into their fast representation.
Also took the time to remove some repetitive code there and to do the
syncing even when an exception is raised (since a partial effect
should still be synced).
Guido van Rossum [Wed, 12 Jan 2000 16:38:20 +0000 (16:38 +0000)]
The functions asctime() and mktime() are documented to take a 9-tuple
only. Through some mysterious interaction, they would take 9 separate
arguments as well. This misfeature is now disabled (to end a
difference with JPython).
Guido van Rossum [Wed, 12 Jan 2000 16:28:58 +0000 (16:28 +0000)]
On Linux, one sometimes sees spurious errors after interrupting
previous output. Call clearerr() to prevent past errors affecting our
ferror() test later, in PyObject_Print(). Suggested by Marc Lemburg.