* 'build_dir' -> 'build_lib', which by default takes its value
straight from 'build_lib' in the 'build' command
* added 'build_temp' and 'inplace' options
* change 'build_extensions()' to put object files (compiler turds) in
'build_temp' dir
* complicated the name-of-extension-file shenanigans in
'build_extensions()' to support "in-place" extension building, i.e.
put the extension right into the source tree (handy for developers)
* added 'get_ext_fullname()', renamed 'extension_filename()' to
'get_ext_filename()', and tweaked the latter a bit -- all to support
the new filename shenanigans
This patch is re: Lucas.Dejonge@awtpl.com.au: [Python-bugs-list] imaplib -
not complying with RFC (PR#218)
Lucas de Jonge reported that the code in imaplib that detects a read-write
to read-only change doesn't comply with RFC 2060.
discussed on c.l.py last January. Specifically:
- more characters allowed in section & option names
- if '=' is used to separate the option & value, the value can be
followed by a comment of the form '\s;'
OptionMenu is modified. Somewhat rewritten and elaborated by myself.
class _setit: The constructor now takes an optional argument
`callback' and stashes this in a private variable. If set, the
__call__() method will invoke this callback after the variable's value
has changed. It will pass the callback the value, followed by any
args passed to __call__().
class OptionMenu: The constructor now takes keyword arguments, the
only one that's legally recognized is `command', which can be set to a
callback. This callback is invoked when the OptionMenu value is set.
Any other keyword argument throws a TclError.
A change in my last patch could, under certain circumstances,
cause a loop if the connection to the server dropped while
waiting for a command completion. I've changed the code to
re-raise the error after possible debugging output.
standard library. Added some comments:
# XXX Note: this is now a standard library module.
# XXX The API needs to undergo changes however; the current code is too
# XXX script-like. This will be addressed later.
add clsFilesystemImporter class attribute, alter handling of suffix list
convert suffix importers to funcs rather than instances
remove backwards compat code: Importer.install and 2-tuple get_code()
result values
switch to isinstance() rather than direct type comparisons
removing chaining concept
update ImportManager.install() to take an optional namespace to install
itself in. this will be useful for setting up rexec environments.
minor comment nits
old 'dist' command, but the code for dealing with manifests is completely
redone -- and renaming the command to 'sdist' is more symmetric with the
soon-to-exist 'bdist' command.
- removed now (happily) unused second arg
- need to verify results of [].index are correct; for building consts,
need to have same value and same type, e.g. 2 not the same as 2L
(big surprise). new solution is a little less hackish.
Code gen adds a TupleArg instance in the argument slot. The tuple arg
includes a copy of the names that it is responsble for binding. The
PyAssembler uses this information to calculate the correct argcount.
all fix this wacky case: del (a, ((b,), c)), d
which is the same as: del a, b, c, d
(Can't wait for Guido to tell me why.)
solution uses findOp which walks a tree to find out whether it
contains OP_ASSIGN or OP_DELETE or ...
Reasons for patches:
1st patch (15,21):
version change
2nd patch (66,72):
This is a patch I found in a Zope product release (quite by accident!).
It relaxes the conditions for matching a literal. I've looked over the
logic, and tested it, and it seems sensible.
3rd patch (117,123):
It appears the quoting matcher was too general, and that the IMAP4
protocol requires characters like ':' in commands to be unquoted.
(This is the patch already sent to Guido.)
4th patch (699,705):
Spelling correction in comment.
5th patch (753,761):
Another patch from the Zope product. It seems that some IMAP4 servers
produce unexpected responses in the middle of valid command/response
sequences. This patch ignores the unexpected responses in this
situation. (How I wish users would send me bug reports with examples!).
last 2 patches: (1015,1028) (1038,1044):
Minor improvements to test code.
- added a number of support methods to generate code just before the
body
- hack protocol for communicating number of args to PyAssembler
fix TryExcept generation for case where exception handler has no body
fix visitAssAttr
add comment about incomplete visitAssName
stop using the ExampleASTVisitor
change script invocation to accept a list of .py files (e.g. Lib/*.py)
named OPTIMIZED, which matches compile.c and makes more sense for
classes
revamp call signature for PythonVMCode.__init__; doesn't really matter
'cuz this code is going to be refactored out of existence
add generateClassCode and modify Func & Lambda generation
add support for nodes Classdef, Keyword,
fix CallFunc to generate right op arg when calling w/ keywords
add ugly hack to properly compute offsets when the same stack ref is
used multiple times
change resolution of local name ops (LOAD_FAST). i think it makes
sense now. if it is an argument or a local var name that it used, it
must be in varnames. if it is a local var name that is used, it must
also be in names
'get_msvc_paths()'.
Renamed '_do_SET()' to 'set_path_env_var()', tweaked docstring, and
cosmetically tweaked code.
Stylistic changes to MSVCCompiler constructor (variable renaming
and type consistency).
* tweak my docstrings
* fix None returns to empty list
* reshuffle responsibilities between '_find_exe()', '_find_SET()', and
the MSVCCompiler constructor -- now the constructor worries about
fetching the version list and determining the most recent one
* added "/W3" compile option
Also, I added/tweaked some docstrings.
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.
FUNCTION_NAMESPACE. initialize in __init__ and reset in
generateFunctionCode.
replace direct issue of STORE_FAST, STORE_GLOBAL, etc. with call to
storeName; same for loadName and deleteName
the new {store,load,delete}Name methods use the namespace attr and the
local variable stack to determine the correct bytecode to issue
* 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)
* 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)
add -q option on command line to disable stdout
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!)
VERBOSE setting for the ASTVisitor
add getopt handling for one or more -v args
rename ForwardRef to StackRef, because it isn't necessarily directional
CodeGenerator:
* add assertStackEmpty method. prints warning if stack is not empty
when it should be
* define methods for AssName, UNARY_*, For
PythonVMCode:
* fix mix up between hasjrel and hasjabs for address calculation
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)