Jack Jansen [Tue, 28 Dec 2004 21:33:27 +0000 (21:33 +0000)]
- getDefaultDatabase wasn't listed in __all__.
- using a different database for non-final releases should only be done
for X.Y.0. Non-final micro releases can use the default database just fine,
as they are required to be backward compatible.
Jack Jansen [Tue, 28 Dec 2004 21:30:35 +0000 (21:30 +0000)]
Just passing -undefined dynamic_lookup isn't enough: we also need to set
the MACOSX_DEPLOYMENT_TARGET environment variable to 10.3 when calling the
loader. And we do this with "env" because distutils apparently doesn't
understand environment variable assignments before command names.
Jack Jansen [Mon, 27 Dec 2004 15:51:03 +0000 (15:51 +0000)]
Fix for #1091468: DESTROOTed frameworkinstalls fail. Added a --destroot
option to various tools, and do the right thing when we're doing a destroot
install.
Jack Jansen [Sun, 26 Dec 2004 23:07:48 +0000 (23:07 +0000)]
After discussion on the PythonMac-SIG it was decided that it is better
to make using "-undefined dynamic_lookup" for linking extensions more
automatic on 10.3 and later. So if we're on that platform and
MACOSX_DEPLOYMENT_TARGET is not set we now set it to the current OSX
version during configure. Additionally, distutils will pick up the
configure-time value by default.
Jack Jansen [Sun, 26 Dec 2004 23:02:05 +0000 (23:02 +0000)]
A script to fix Apple-installed Python 2.3 (and a test whether the user
needs to run it in the Makefile).
After installing a newer framework Python the apple-installed Python can
no longer build extension modules, because they will inadvertantly be linked
against the newer framework. This script modifies lib/config/Makefile so
it will link extensions with "-undefined dynamic_lookup", which forestalls
this problem.
Armin Rigo [Thu, 23 Dec 2004 22:13:13 +0000 (22:13 +0000)]
Dima Dorfman's patch for coercion/comparison of C types (patch #995939), with
a minor change after the coercion, to accept two objects not necessarily of
the same type but with the same tp_compare.
Fred Drake [Thu, 23 Dec 2004 16:50:36 +0000 (16:50 +0000)]
discuss how the __builtin__ module is normally used, and try to clarify the
difference between __builtins__ and __builtin__ (based on an email comment)
Kurt B. Kaiser [Thu, 23 Dec 2004 04:20:59 +0000 (04:20 +0000)]
The GUI was hanging if the shell window was closed while a raw_input()
was pending. Restored the quit() of the readline() mainloop().
http://mail.python.org/pipermail/idle-dev/2004-December/002307.html
Fred Drake [Tue, 21 Dec 2004 23:46:34 +0000 (23:46 +0000)]
add __file__ to the globals available for tests loaded via DocFileSuite;
this is useful for locating supporting data files, just as it is in Python
modules
Walter Dörwald [Tue, 21 Dec 2004 22:24:00 +0000 (22:24 +0000)]
The changes to the stateful codecs in 2.4 resulted in StreamReader.readline()
trying to return a complete line even if a size parameter was given (see
http://www.python.org/sf/1076985). This leads to buffer overflows with long
source lines under Windows if e.g. cp1252 is used as the source encoding.
This patch reverts the behaviour of readline() to something that behaves more
like Python 2.3: If a size parameter is given, read() is called only once.
As a side effect of this, readline() now supports all types of linebreaks
supported by unicode.splitlines().
Note that the tokenizer is still broken and it's possible to provoke segfaults
(see http://www.python.org/sf/1089395).
Armin Rigo [Mon, 20 Dec 2004 12:25:57 +0000 (12:25 +0000)]
Any call to marshal.dumps() with the new optional argument 'version' just
immediately segfaults, due to a typo! This was obviously never tested...
Added a test for it, and also fixed the documentation.
Brett Cannon [Sat, 18 Dec 2004 20:48:09 +0000 (20:48 +0000)]
Switch from getting LDFLAGS and CPPFLAGS from the environment to the Makefile.
This is to avoid a problem that inconsistently comes up where the environment
variable is unset while the Makefile clearly has the values set and are used
during ``make``.
Refactor:
* Improve algorithm -- no more O(n) steps except sched.cancel().
* Improve thread safety of sched.run() and sched.empty()
(other threads could alter the queue between the time the queue was
first checked and when the lead event was deleted).
* Localize variable access in sched.run() to minimize overhead.
SF bug #1085744: Performance issues with PySequence_Tuple()
* Added missing error checks.
* Fixed O(n**2) growth pattern. Modeled after lists to achieve linear
amortized resizing. Improves construction of "tuple(it)" when "it" is
large and does not have a __len__ method. Other cases are unaffected.
Gregory P. Smith [Mon, 13 Dec 2004 12:01:24 +0000 (12:01 +0000)]
rewrote the bsddb module BerkeleyDB library and include file locating
code. This version is much cleaner and makes a proper attempt at
pairing up the correct header file and library.
Patch #1011890: fix inspect.getsource breaking with line-continuation &
more. Thanks to Simon Percivall!
The patch makes changes to inspect.py in two places:
* the pattern to match against functions at line 436 is
modified: lambdas should be matched even if not
preceded by whitespace, as long as "lambda" isn't part
of another word.
* the BlockFinder class is heavily modified. Changes are:
- checking for "def", "class" or "lambda" names
before setting self.started to True. Then checking the
same line for word characters after the colon (if the
colon is on that line). If so, and the line does not
end with a line continuation marker, raise EndOfBlock
immediately.
- adding self.passline to show that the line is to be
included and no more checking is necessary on that
line. Since a NEWLINE token is not generated when a
line continuation marker exists, this allows getsource
to continue with these functions even if the following
line would not be indented.
Also add a bunch of
'quite-unlikely-to-occur-in-real-life-but-working-anyway' tests.
Patch #736962: port test_inspect to unittest. As part of this, move out
the fodder modules to separate files to get rid of the imp.load_source()
trickery.
locale.py now uses an updated locale alias table (built using
Tools/i18n/makelocalealias.py, a tool to parse the X11 locale
alias file); the encoding lookup was enhanced to use Python's
encoding alias table
As sige-effect, this fixes SF bug [ 1080864 ] locale.py doesn't recognize
valid locale setting.
Brett Cannon [Tue, 7 Dec 2004 03:25:18 +0000 (03:25 +0000)]
Change code in setup.py for parsing LDFLAGS and CPPFLAGS to use optparse
instead of getopt. Required making use of gettext._ as optional (optparse
changed OK'ed by Greg Ward in private email).
Brett Cannon [Tue, 7 Dec 2004 00:42:59 +0000 (00:42 +0000)]
setup.py now uses the library directories specified in LDFLAGS (``-L``
directories) and the include directories specified in CPPFLAGS (``-I``
directories) for compiling the extension modules.
This has led to the core being compiled with the values in the shell's
CPPFLAGS. It has also removed the need for special casing to use Fink and
DarwinPorts under darwin since the needed directories can now be specified in
LDFLAGS and CPPFLAGS (e.g., DarwinPorts users can now do
``LDFLAGS=-L/opt/local/lib; CPPFLAGS=-I/opt/local/include; ./configure`` for
everything to work properly).
Parsing the values in the environment variables is done with getopt. While optparse
would have been a nicer solution it cannot be used because of dependency issues
at execution time; optparse uses gettext which uses struct which will not have
been compiled when the code is imported. If optparse ever makes its
importation of gettext optional by catching ImportError and setting _() to an
identity function then it can be used.
smtplib can not log in to some server using command AUTH PLAIN, it sends
``user\0user\0pass'' to the server, but ``\0user\0pass'' has better
compatibility.
Brett Cannon [Mon, 6 Dec 2004 06:08:59 +0000 (06:08 +0000)]
Have test_mkalias_relative check that sys.prefix already exists; otherwise test
is pointless.
Also add a note to the docs for the 'test' package that test cases should check
first that any conditions needed in the operating system are met before having
a test run.
Barry Warsaw [Sun, 5 Dec 2004 03:45:42 +0000 (03:45 +0000)]
Fixes for SF #1076485, which I'll apply to the CVS head too. The problem was
caused by a self._input.readline() call that wasn't checking for the
NeedsMoreData marker.
msg_43.txt contains a message that illustrates the problem, when
email.message_from_*() is called. That interface uses the Parser API, which
splits reads into 8192 byte chunks. It so happens that for the test message,
the 8192 chunk falls inside a message/delivery-status, which is where in the
FeedParser the readline() call was that didn't check for NeedsMoreData.
I also added an assert to unreadline() so it'll be more evident if an attempt
to push back NeedsMoreData ever happens again.