Merged revisions 74264 via svnmerge from

svn+ssh://svn.python.org/python/branches/py3k

................
  r74264 | alexandre.vassalotti | 2009-07-29 22:12:15 +0200 (Mi, 29 Jul 2009) | 32 lines

  Merged revisions 74075,74187,74197,74201,74216,74225 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r74075 | georg.brandl | 2009-07-18 05:06:31 -0400 (Sat, 18 Jul 2009) | 1 line

    #6505: fix typos.
  ........
    r74187 | benjamin.peterson | 2009-07-23 10:19:08 -0400 (Thu, 23 Jul 2009) | 1 line

    use bools for autoraise
  ........
    r74197 | benjamin.peterson | 2009-07-24 22:03:48 -0400 (Fri, 24 Jul 2009) | 1 line

    clarify
  ........
    r74201 | amaury.forgeotdarc | 2009-07-25 12:22:06 -0400 (Sat, 25 Jul 2009) | 2 lines

    Better name a variable: 'buf' seems to imply a mutable buffer.
  ........
    r74216 | michael.foord | 2009-07-26 17:12:14 -0400 (Sun, 26 Jul 2009) | 1 line

    Issue 6581. Michael Foord
  ........
    r74225 | kurt.kaiser | 2009-07-27 12:09:28 -0400 (Mon, 27 Jul 2009) | 5 lines

    1. Clean workspace more thoughly before build.
    2. Add url of branch we are building to 'results' webpage.
       (url is now available in $repo_path, could be added to failure email.)
    3. Adjust permissions to improve upload reliability.
  ........
................
This commit is contained in:
Georg Brandl 2009-08-13 08:37:59 +00:00
parent 878c3b004b
commit 01a30523f9
6 changed files with 45 additions and 30 deletions

View File

@ -152,9 +152,9 @@ Positional and keyword arguments can be arbitrarily combined::
other='Georg')) other='Georg'))
The story of Bill, Manfred, and Georg. The story of Bill, Manfred, and Georg.
An optional ``':'`` and format specifier can follow the field name. This also An optional ``':'`` and format specifier can follow the field name. This allows
greater control over how the value is formatted. The following example greater control over how the value is formatted. The following example
truncates the Pi to three places after the decimal. truncates Pi to three places after the decimal.
>>> import math >>> import math
>>> print('The value of PI is approximately {0:.3f}.'.format(math.pi)) >>> print('The value of PI is approximately {0:.3f}.'.format(math.pi))
@ -208,8 +208,8 @@ operation. For example::
The value of PI is approximately 3.142. The value of PI is approximately 3.142.
Since :meth:`str.format` is quite new, a lot of Python code still uses the ``%`` Since :meth:`str.format` is quite new, a lot of Python code still uses the ``%``
operator. However, because this old style of formatting will eventually removed operator. However, because this old style of formatting will eventually be
from the language :meth:`str.format` should generally be used. removed from the language, :meth:`str.format` should generally be used.
More information can be found in the :ref:`old-string-formatting` section. More information can be found in the :ref:`old-string-formatting` section.

View File

@ -990,7 +990,10 @@ def getinnerframes(tb, context=1):
tb = tb.tb_next tb = tb.tb_next
return framelist return framelist
currentframe = sys._getframe if hasattr(sys, '_getframe'):
currentframe = sys._getframe
else:
currentframe = lambda _=None: None
def stack(context=1): def stack(context=1):
"""Return a list of records for the stack above the caller's frame.""" """Return a list of records for the stack above the caller's frame."""

View File

@ -56,7 +56,7 @@ def get(using=None):
# It is recommended one does "import webbrowser" and uses webbrowser.open(url) # It is recommended one does "import webbrowser" and uses webbrowser.open(url)
# instead of "from webbrowser import *". # instead of "from webbrowser import *".
def open(url, new=0, autoraise=1): def open(url, new=0, autoraise=True):
for name in _tryorder: for name in _tryorder:
browser = get(name) browser = get(name)
if browser.open(url, new, autoraise): if browser.open(url, new, autoraise):
@ -145,7 +145,7 @@ class BaseBrowser(object):
self.name = name self.name = name
self.basename = name self.basename = name
def open(self, url, new=0, autoraise=1): def open(self, url, new=0, autoraise=True):
raise NotImplementedError raise NotImplementedError
def open_new(self, url): def open_new(self, url):
@ -169,7 +169,7 @@ class GenericBrowser(BaseBrowser):
self.args = name[1:] self.args = name[1:]
self.basename = os.path.basename(self.name) self.basename = os.path.basename(self.name)
def open(self, url, new=0, autoraise=1): def open(self, url, new=0, autoraise=True):
cmdline = [self.name] + [arg.replace("%s", url) cmdline = [self.name] + [arg.replace("%s", url)
for arg in self.args] for arg in self.args]
try: try:
@ -186,7 +186,7 @@ class BackgroundBrowser(GenericBrowser):
"""Class for all browsers which are to be started in the """Class for all browsers which are to be started in the
background.""" background."""
def open(self, url, new=0, autoraise=1): def open(self, url, new=0, autoraise=True):
cmdline = [self.name] + [arg.replace("%s", url) cmdline = [self.name] + [arg.replace("%s", url)
for arg in self.args] for arg in self.args]
try: try:
@ -217,7 +217,7 @@ class UnixBrowser(BaseBrowser):
raise_opt = [] raise_opt = []
if remote and self.raise_opts: if remote and self.raise_opts:
# use autoraise argument only for remote invocation # use autoraise argument only for remote invocation
autoraise = int(bool(autoraise)) autoraise = int(autoraise)
opt = self.raise_opts[autoraise] opt = self.raise_opts[autoraise]
if opt: raise_opt = [opt] if opt: raise_opt = [opt]
@ -257,7 +257,7 @@ class UnixBrowser(BaseBrowser):
else: else:
return not p.wait() return not p.wait()
def open(self, url, new=0, autoraise=1): def open(self, url, new=0, autoraise=True):
if new == 0: if new == 0:
action = self.remote_action action = self.remote_action
elif new == 1: elif new == 1:
@ -341,7 +341,7 @@ class Konqueror(BaseBrowser):
for more information on the Konqueror remote-control interface. for more information on the Konqueror remote-control interface.
""" """
def open(self, url, new=0, autoraise=1): def open(self, url, new=0, autoraise=True):
# XXX Currently I know no way to prevent KFM from opening a new win. # XXX Currently I know no way to prevent KFM from opening a new win.
if new == 2: if new == 2:
action = "newTab" action = "newTab"
@ -429,7 +429,7 @@ class Grail(BaseBrowser):
s.close() s.close()
return 1 return 1
def open(self, url, new=0, autoraise=1): def open(self, url, new=0, autoraise=True):
if new: if new:
ok = self._remote("LOADNEW " + url) ok = self._remote("LOADNEW " + url)
else: else:
@ -512,7 +512,7 @@ if os.environ.get("TERM"):
if sys.platform[:3] == "win": if sys.platform[:3] == "win":
class WindowsDefault(BaseBrowser): class WindowsDefault(BaseBrowser):
def open(self, url, new=0, autoraise=1): def open(self, url, new=0, autoraise=True):
try: try:
os.startfile(url) os.startfile(url)
except WindowsError: except WindowsError:
@ -546,7 +546,7 @@ except ImportError:
pass pass
else: else:
class InternetConfig(BaseBrowser): class InternetConfig(BaseBrowser):
def open(self, url, new=0, autoraise=1): def open(self, url, new=0, autoraise=True):
ic.launchurl(url) ic.launchurl(url)
return True # Any way to get status? return True # Any way to get status?
@ -567,7 +567,7 @@ if sys.platform == 'darwin':
def __init__(self, name): def __init__(self, name):
self.name = name self.name = name
def open(self, url, new=0, autoraise=1): def open(self, url, new=0, autoraise=True):
assert "'" not in url assert "'" not in url
# hack for local urls # hack for local urls
if not ':' in url: if not ':' in url:

View File

@ -4,9 +4,11 @@
## does this: ## does this:
## svn up ; ./configure ; make ; make test ; make install ; cd Doc ; make ## svn up ; ./configure ; make ; make test ; make install ; cd Doc ; make
## ##
## Logs are kept and rsync'ed to the host. If there are test failure(s), ## Logs are kept and rsync'ed to the webhost. If there are test failure(s),
## information about the failure(s) is mailed. ## information about the failure(s) is mailed.
## ##
## The user must be a member of the webmaster group locally and on webhost.
##
## This script is run on the PSF's machine as user neal via crontab. ## This script is run on the PSF's machine as user neal via crontab.
## ##
## Yes, this script would probably be easier in python, but then ## Yes, this script would probably be easier in python, but then
@ -76,7 +78,8 @@ ALWAYS_SKIP="-x $_ALWAYS_SKIP"
# Skip these tests altogether when looking for leaks. These tests # Skip these tests altogether when looking for leaks. These tests
# do not need to be stored above in LEAKY_TESTS too. # do not need to be stored above in LEAKY_TESTS too.
# test_logging causes hangs, skip it. # test_logging causes hangs, skip it.
LEAKY_SKIPS="-x test_logging $_ALWAYS_SKIP" # KBK 21Apr09: test_httpservers causes hangs, skip for now.
LEAKY_SKIPS="-x test_compiler test_logging test_httpservers"
# Change this flag to "yes" for old releases to only update/build the docs. # Change this flag to "yes" for old releases to only update/build the docs.
BUILD_DISABLED="no" BUILD_DISABLED="no"
@ -133,9 +136,14 @@ mail_on_failure() {
## setup ## setup
cd $DIR cd $DIR
make clobber /dev/null 2>&1
cp -p Modules/Setup.dist Modules/Setup
# But maybe there was no Makefile - we are only building docs. Clear build:
rm -rf build/
mkdir -p build mkdir -p build
rm -f $RESULT_FILE build/*.out
rm -rf $INSTALL_DIR rm -rf $INSTALL_DIR
## get the path we are building
repo_path=$(grep "url=" .svn/entries | sed -e s/\\W*url=// -e s/\"//g)
## create results file ## create results file
TITLE="Automated Python Build Results" TITLE="Automated Python Build Results"
@ -153,6 +161,8 @@ echo " </tr><tr>" >> $RESULT_FILE
echo " <td>Hostname:</td><td>`uname -n`</td>" >> $RESULT_FILE echo " <td>Hostname:</td><td>`uname -n`</td>" >> $RESULT_FILE
echo " </tr><tr>" >> $RESULT_FILE echo " </tr><tr>" >> $RESULT_FILE
echo " <td>Platform:</td><td>`uname -srmpo`</td>" >> $RESULT_FILE echo " <td>Platform:</td><td>`uname -srmpo`</td>" >> $RESULT_FILE
echo " </tr><tr>" >> $RESULT_FILE
echo " <td>URL:</td><td>$repo_path</td>" >> $RESULT_FILE
echo " </tr>" >> $RESULT_FILE echo " </tr>" >> $RESULT_FILE
echo "</table>" >> $RESULT_FILE echo "</table>" >> $RESULT_FILE
echo "<ul>" >> $RESULT_FILE echo "<ul>" >> $RESULT_FILE
@ -223,7 +233,7 @@ if [ $err = 0 -a "$BUILD_DISABLED" != "yes" ]; then
start=`current_time` start=`current_time`
## ensure that the reflog exists so the grep doesn't fail ## ensure that the reflog exists so the grep doesn't fail
touch $REFLOG touch $REFLOG
$PYTHON $REGRTEST_ARGS -R 4:3:$REFLOG -u network,urlfetch $LEAKY_SKIPS >& build/$F $PYTHON $REGRTEST_ARGS -R 4:3:$REFLOG -u network $LEAKY_SKIPS >& build/$F
LEAK_PAT="($LEAKY_TESTS|sum=0)" LEAK_PAT="($LEAKY_TESTS|sum=0)"
NUM_FAILURES=`egrep -vc "$LEAK_PAT" $REFLOG` NUM_FAILURES=`egrep -vc "$LEAK_PAT" $REFLOG`
place_summary_first build/$F place_summary_first build/$F
@ -259,13 +269,13 @@ start=`current_time`
# which will definitely fail with a conflict. # which will definitely fail with a conflict.
#CONFLICTED_FILE=commontex/boilerplate.tex #CONFLICTED_FILE=commontex/boilerplate.tex
#conflict_count=`grep -c "<<<" $CONFLICTED_FILE` #conflict_count=`grep -c "<<<" $CONFLICTED_FILE`
make clean
conflict_count=0 conflict_count=0
if [ $conflict_count != 0 ]; then if [ $conflict_count != 0 ]; then
echo "Conflict detected in $CONFLICTED_FILE. Doc build skipped." > ../build/$F echo "Conflict detected in $CONFLICTED_FILE. Doc build skipped." > ../build/$F
err=1 err=1
else else
make checkout update html >& ../build/$F make clean > ../build/$F 2>&1
make checkout update html >> ../build/$F 2>&1
err=$? err=$?
fi fi
update_status "Making doc" "$F" $start update_status "Making doc" "$F" $start
@ -279,6 +289,8 @@ echo "</body>" >> $RESULT_FILE
echo "</html>" >> $RESULT_FILE echo "</html>" >> $RESULT_FILE
## copy results ## copy results
chgrp -R webmaster build/html
chmod -R g+w build/html
rsync $RSYNC_OPTS build/html/* $REMOTE_SYSTEM:$REMOTE_DIR rsync $RSYNC_OPTS build/html/* $REMOTE_SYSTEM:$REMOTE_DIR
cd ../build cd ../build
rsync $RSYNC_OPTS index.html *.out $REMOTE_SYSTEM:$REMOTE_DIR/results/ rsync $RSYNC_OPTS index.html *.out $REMOTE_SYSTEM:$REMOTE_DIR/results/

View File

@ -718,7 +718,7 @@ PyDict_GetItem(PyObject *op, PyObject *key)
running "python -Wi" for an example related to string interning. running "python -Wi" for an example related to string interning.
Let's just hope that no exception occurs then... This must be Let's just hope that no exception occurs then... This must be
_PyThreadState_Current and not PyThreadState_GET() because in debug _PyThreadState_Current and not PyThreadState_GET() because in debug
mode, it complains if tstate is NULL. */ mode, the latter complains if tstate is NULL. */
tstate = _PyThreadState_Current; tstate = _PyThreadState_Current;
if (tstate != NULL && tstate->curexc_type != NULL) { if (tstate != NULL && tstate->curexc_type != NULL) {
/* preserve the existing exception */ /* preserve the existing exception */

View File

@ -1782,7 +1782,7 @@ static int init_builtin(char *); /* Forward */
its module object WITH INCREMENTED REFERENCE COUNT */ its module object WITH INCREMENTED REFERENCE COUNT */
static PyObject * static PyObject *
load_module(char *name, FILE *fp, char *buf, int type, PyObject *loader) load_module(char *name, FILE *fp, char *pathname, int type, PyObject *loader)
{ {
PyObject *modules; PyObject *modules;
PyObject *m; PyObject *m;
@ -1803,27 +1803,27 @@ load_module(char *name, FILE *fp, char *buf, int type, PyObject *loader)
switch (type) { switch (type) {
case PY_SOURCE: case PY_SOURCE:
m = load_source_module(name, buf, fp); m = load_source_module(name, pathname, fp);
break; break;
case PY_COMPILED: case PY_COMPILED:
m = load_compiled_module(name, buf, fp); m = load_compiled_module(name, pathname, fp);
break; break;
#ifdef HAVE_DYNAMIC_LOADING #ifdef HAVE_DYNAMIC_LOADING
case C_EXTENSION: case C_EXTENSION:
m = _PyImport_LoadDynamicModule(name, buf, fp); m = _PyImport_LoadDynamicModule(name, pathname, fp);
break; break;
#endif #endif
case PKG_DIRECTORY: case PKG_DIRECTORY:
m = load_package(name, buf); m = load_package(name, pathname);
break; break;
case C_BUILTIN: case C_BUILTIN:
case PY_FROZEN: case PY_FROZEN:
if (buf != NULL && buf[0] != '\0') if (pathname != NULL && pathname[0] != '\0')
name = buf; name = pathname;
if (type == C_BUILTIN) if (type == C_BUILTIN)
err = init_builtin(name); err = init_builtin(name);
else else