From python-checkins at python.org Fri Feb 1 00:08:24 2008 From: python-checkins at python.org (christian.heimes) Date: Fri, 1 Feb 2008 00:08:24 +0100 (CET) Subject: [Python-checkins] r60484 - in python/trunk: Include/pyport.h Misc/NEWS Modules/posixmodule.c configure configure.in pyconfig.h.in Message-ID: <20080131230824.522651E4012@bag.python.org> Author: christian.heimes Date: Fri Feb 1 00:08:23 2008 New Revision: 60484 Modified: python/trunk/Include/pyport.h python/trunk/Misc/NEWS python/trunk/Modules/posixmodule.c python/trunk/configure python/trunk/configure.in python/trunk/pyconfig.h.in Log: Fixed bug #1983: Return from fork() is pid_t, not int Modified: python/trunk/Include/pyport.h ============================================================================== --- python/trunk/Include/pyport.h (original) +++ python/trunk/Include/pyport.h Fri Feb 1 00:08:23 2008 @@ -122,6 +122,10 @@ /* Smallest negative value of type Py_ssize_t. */ #define PY_SSIZE_T_MIN (-PY_SSIZE_T_MAX-1) +#if SIZEOF_PID_T > SIZEOF_LONG +# error "Python doesn't support sizeof(pid_t) > sizeof(long)" +#endif + /* PY_FORMAT_SIZE_T is a platform-specific modifier for use in a printf * format to convert an argument with the width of a size_t or Py_ssize_t. * C99 introduced "z" for this purpose, but not all platforms support that; @@ -573,7 +577,7 @@ functions, even though they are included in libutil. */ #include extern int openpty(int *, int *, char *, struct termios *, struct winsize *); -extern int forkpty(int *, char *, struct termios *, struct winsize *); +extern pid_t forkpty(int *, char *, struct termios *, struct winsize *); #endif /* !defined(HAVE_PTY_H) && !defined(HAVE_LIBUTIL_H) */ #endif /* defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) */ Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Feb 1 00:08:23 2008 @@ -12,6 +12,9 @@ Core and builtins ----------------- +- Bug #1983: Fixed return type of fork(), fork1() and forkpty() calls. + Python expected the return type int but the fork familie returns pi_t. + - Issue #1678380: Fix a bug that identifies 0j and -0j when they appear in the same code unit. @@ -1386,6 +1389,9 @@ Build ----- +- Bug #1983: Added a check to pyport to verify that sizeof(pid_t) is + smaller or equal sizeof(long). + - Bug #1234: Fixed semaphore errors on AIX 5.2 - Issue #1726: Remove Python/atof.c from PCBuild/pythoncore.vcproj Modified: python/trunk/Modules/posixmodule.c ============================================================================== --- python/trunk/Modules/posixmodule.c (original) +++ python/trunk/Modules/posixmodule.c Fri Feb 1 00:08:23 2008 @@ -3575,11 +3575,11 @@ static PyObject * posix_fork1(PyObject *self, PyObject *noargs) { - int pid = fork1(); + pid_t pid = fork1(); if (pid == -1) return posix_error(); PyOS_AfterFork(); - return PyInt_FromLong((long)pid); + return PyInt_FromLong(pid); } #endif @@ -3593,12 +3593,12 @@ static PyObject * posix_fork(PyObject *self, PyObject *noargs) { - int pid = fork(); + pid_t pid = fork(); if (pid == -1) return posix_error(); if (pid == 0) PyOS_AfterFork(); - return PyInt_FromLong((long)pid); + return PyInt_FromLong(pid); } #endif @@ -3700,14 +3700,15 @@ static PyObject * posix_forkpty(PyObject *self, PyObject *noargs) { - int master_fd = -1, pid; + int master_fd = -1; + pid_t pid; pid = forkpty(&master_fd, NULL, NULL, NULL); if (pid == -1) return posix_error(); if (pid == 0) PyOS_AfterFork(); - return Py_BuildValue("(ii)", pid, master_fd); + return Py_BuildValue("(li)", pid, master_fd); } #endif Modified: python/trunk/configure ============================================================================== --- python/trunk/configure (original) +++ python/trunk/configure Fri Feb 1 00:08:23 2008 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 60141 . +# From configure.in Revision: 60464 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.6. # @@ -10160,6 +10160,411 @@ _ACEOF +{ echo "$as_me:$LINENO: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } +if test "${ac_cv_type_pid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef pid_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_pid_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_pid_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of pid_t" >&5 +echo $ECHO_N "checking size of pid_t... $ECHO_C" >&6; } +if test "${ac_cv_sizeof_pid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef pid_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef pid_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef pid_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef pid_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo= ac_hi= +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef pid_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr '(' $ac_mid ')' + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_pid_t=$ac_lo;; +'') if test "$ac_cv_type_pid_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (pid_t) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_pid_t=0 + fi ;; +esac +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef pid_t ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) + { + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_pid_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +if test "$ac_cv_type_pid_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (pid_t) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_pid_t=0 + fi +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.val +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_pid_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_pid_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_PID_T $ac_cv_sizeof_pid_t +_ACEOF + + { echo "$as_me:$LINENO: checking for long long support" >&5 echo $ECHO_N "checking for long long support... $ECHO_C" >&6; } Modified: python/trunk/configure.in ============================================================================== --- python/trunk/configure.in (original) +++ python/trunk/configure.in Fri Feb 1 00:08:23 2008 @@ -1202,7 +1202,7 @@ AC_TYPE_SIGNAL AC_TYPE_SIZE_T AC_TYPE_UID_T -AC_CHECK_TYPE(ssize_t, +AC_CHECK_TYPE(ssize_t, AC_DEFINE(HAVE_SSIZE_T, 1, Define if your compiler provides ssize_t),,) # Sizes of various common basic types @@ -1215,6 +1215,7 @@ AC_CHECK_SIZEOF(double, 8) AC_CHECK_SIZEOF(fpos_t, 4) AC_CHECK_SIZEOF(size_t, 4) +AC_CHECK_SIZEOF(pid_t, 4) AC_MSG_CHECKING(for long long support) have_long_long=no Modified: python/trunk/pyconfig.h.in ============================================================================== --- python/trunk/pyconfig.h.in (original) +++ python/trunk/pyconfig.h.in Fri Feb 1 00:08:23 2008 @@ -869,6 +869,9 @@ /* The number of bytes in an off_t. */ #undef SIZEOF_OFF_T +/* The size of `pid_t', as computed by sizeof. */ +#undef SIZEOF_PID_T + /* The number of bytes in a pthread_t. */ #undef SIZEOF_PTHREAD_T From guido at python.org Fri Feb 1 00:58:41 2008 From: guido at python.org (Guido van Rossum) Date: Thu, 31 Jan 2008 15:58:41 -0800 Subject: [Python-checkins] r60483 - in python/trunk: Lib/test/test_complex.py Misc/NEWS Python/compile.c In-Reply-To: <20080131221738.309021E4012@bag.python.org> References: <20080131221738.309021E4012@bag.python.org> Message-ID: Perhaps worth backporting to 2.5.2... On Jan 31, 2008 2:17 PM, mark.dickinson wrote: > Author: mark.dickinson > Date: Thu Jan 31 23:17:37 2008 > New Revision: 60483 > > Modified: > python/trunk/Lib/test/test_complex.py > python/trunk/Misc/NEWS > python/trunk/Python/compile.c > Log: > Issue #1678380. Fix a bug that identifies 0j and -0j when they appear > in the same code unit. The fix is essentially the same as the fix for a > previous bug identifying 0. and -0. > > > > Modified: python/trunk/Lib/test/test_complex.py > ============================================================================== > --- python/trunk/Lib/test/test_complex.py (original) > +++ python/trunk/Lib/test/test_complex.py Thu Jan 31 23:17:37 2008 > @@ -359,6 +359,13 @@ > except (OSError, IOError): > pass > > + if float.__getformat__("double").startswith("IEEE"): > + def test_plus_minus_0j(self): > + # test that -0j and 0j literals are not identified > + z1, z2 = 0j, -0j > + self.assertEquals(atan2(z1.imag, -1.), atan2(0., -1.)) > + self.assertEquals(atan2(z2.imag, -1.), atan2(-0., -1.)) > + > def test_main(): > test_support.run_unittest(ComplexTest) > > > Modified: python/trunk/Misc/NEWS > ============================================================================== > --- python/trunk/Misc/NEWS (original) > +++ python/trunk/Misc/NEWS Thu Jan 31 23:17:37 2008 > @@ -12,6 +12,9 @@ > Core and builtins > ----------------- > > +- Issue #1678380: Fix a bug that identifies 0j and -0j when they appear > + in the same code unit. > + > - Patch #1970 by Antoine Pitrou: Speedup unicode whitespace and linebreak > detection > > > Modified: python/trunk/Python/compile.c > ============================================================================== > --- python/trunk/Python/compile.c (original) > +++ python/trunk/Python/compile.c Thu Jan 31 23:17:37 2008 > @@ -907,24 +907,59 @@ > { > PyObject *t, *v; > Py_ssize_t arg; > + unsigned char *p, *q; > + Py_complex z; > + double d; > + int real_part_zero, imag_part_zero; > > /* necessary to make sure types aren't coerced (e.g., int and long) */ > /* _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms */ > if (PyFloat_Check(o)) { > - double d = PyFloat_AS_DOUBLE(o); > - unsigned char* p = (unsigned char*) &d; > - /* all we need is to make the tuple different in either the 0.0 > - * or -0.0 case from all others, just to avoid the "coercion". > - */ > - if (*p==0 && p[sizeof(double)-1]==0) > - t = PyTuple_Pack(3, o, o->ob_type, Py_None); > - else > - t = PyTuple_Pack(2, o, o->ob_type); > - } else { > - t = PyTuple_Pack(2, o, o->ob_type); > + d = PyFloat_AS_DOUBLE(o); > + p = (unsigned char*) &d; > + /* all we need is to make the tuple different in either the 0.0 > + * or -0.0 case from all others, just to avoid the "coercion". > + */ > + if (*p==0 && p[sizeof(double)-1]==0) > + t = PyTuple_Pack(3, o, o->ob_type, Py_None); > + else > + t = PyTuple_Pack(2, o, o->ob_type); > + } > + else if (PyComplex_Check(o)) { > + /* complex case is even messier: we need to make complex(x, > + 0.) different from complex(x, -0.) and complex(0., y) > + different from complex(-0., y), for any x and y. In > + particular, all four complex zeros should be > + distinguished.*/ > + z = PyComplex_AsCComplex(o); > + p = (unsigned char*) &(z.real); > + q = (unsigned char*) &(z.imag); > + /* all that matters here is that on IEEE platforms > + real_part_zero will be true if z.real == 0., and false if > + z.real == -0. In fact, real_part_zero will also be true > + for some other rarely occurring nonzero floats, but this > + doesn't matter. Similar comments apply to > + imag_part_zero. */ > + real_part_zero = *p==0 && p[sizeof(double)-1]==0; > + imag_part_zero = *q==0 && q[sizeof(double)-1]==0; > + if (real_part_zero && imag_part_zero) { > + t = PyTuple_Pack(4, o, o->ob_type, Py_True, Py_True); > + } > + else if (real_part_zero && !imag_part_zero) { > + t = PyTuple_Pack(4, o, o->ob_type, Py_True, Py_False); > + } > + else if (!real_part_zero && imag_part_zero) { > + t = PyTuple_Pack(4, o, o->ob_type, Py_False, Py_True); > + } > + else { > + t = PyTuple_Pack(2, o, o->ob_type); > + } > + } > + else { > + t = PyTuple_Pack(2, o, o->ob_type); > } > if (t == NULL) > - return -1; > + return -1; > > v = PyDict_GetItem(dict, t); > if (!v) { > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins > -- --Guido van Rossum (home page: http://www.python.org/~guido/) From buildbot at python.org Fri Feb 1 01:43:53 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 00:43:53 +0000 Subject: [Python-checkins] buildbot failure in alpha Tru64 5.1 trunk Message-ID: <20080201004353.8691C1E4012@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%20Tru64%205.1%20trunk/builds/2449 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-tru64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: christian.heimes,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_asynchat test_smtplib sincerely, -The Buildbot From buildbot at python.org Fri Feb 1 01:54:46 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 00:54:46 +0000 Subject: [Python-checkins] buildbot failure in x86 FreeBSD trunk Message-ID: <20080201005446.B425B1E4012@bag.python.org> The Buildbot has detected a new failure of x86 FreeBSD trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20FreeBSD%20trunk/builds/508 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-freebsd Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: christian.heimes,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 268, in process_request self.finish_request(request, client_address) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 281, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 560, in __init__ self.handle() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/BaseHTTPServer.py", line 316, in handle self.handle_one_request() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/BaseHTTPServer.py", line 299, in handle_one_request self.raw_requestline = self.rfile.readline() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/socket.py", line 369, in readline data = self._sock.recv(self._rbufsize) error: [Errno 35] Resource temporarily unavailable Traceback (most recent call last): File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 268, in process_request self.finish_request(request, client_address) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 281, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 560, in __init__ self.handle() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/BaseHTTPServer.py", line 316, in handle self.handle_one_request() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/BaseHTTPServer.py", line 299, in handle_one_request self.raw_requestline = self.rfile.readline() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/socket.py", line 369, in readline data = self._sock.recv(self._rbufsize) error: [Errno 35] Resource temporarily unavailable 1 test failed: test_smtplib ====================================================================== ERROR: testEXPN (test.test_smtplib.SMTPSimTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/test/test_smtplib.py", line 411, in testEXPN smtp = smtplib.SMTP(HOST, PORT, local_hostname='localhost', timeout=3) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/smtplib.py", line 237, in __init__ (code, msg) = self.connect(host, port) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/smtplib.py", line 294, in connect (code, msg) = self.getreply() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/smtplib.py", line 335, in getreply line = self.file.readline() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/socket.py", line 369, in readline data = self._sock.recv(self._rbufsize) timeout: timed out sincerely, -The Buildbot From buildbot at python.org Fri Feb 1 03:45:39 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 02:45:39 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20080201024539.EEDE91E4012@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.0/builds/34 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: bill.janssen BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/threading.py", line 485, in _bootstrap_inner self.run() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/threading.py", line 445, in run self._target(*self._args, **self._kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/bsddb/test/test_thread.py", line 88, in writerThread self._writerThread(*args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/bsddb/test/test_thread.py", line 277, in _writerThread self.assertEqual(data, self.makeData(key)) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/unittest.py", line 325, in failUnlessEqual raise self.failureException(msg or '%r != %r' % (first, second)) AssertionError: None != b'0002-0002-0002-0002-0002' Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/threading.py", line 485, in _bootstrap_inner self.run() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/threading.py", line 445, in run self._target(*self._args, **self._kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/bsddb/test/test_thread.py", line 88, in writerThread self._writerThread(*args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/bsddb/test/test_thread.py", line 277, in _writerThread self.assertEqual(data, self.makeData(key)) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/unittest.py", line 325, in failUnlessEqual raise self.failureException(msg or '%r != %r' % (first, second)) AssertionError: None != b'1001-1001-1001-1001-1001' Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/threading.py", line 485, in _bootstrap_inner self.run() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/threading.py", line 445, in run self._target(*self._args, **self._kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/bsddb/test/test_thread.py", line 88, in writerThread self._writerThread(*args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/bsddb/test/test_thread.py", line 277, in _writerThread self.assertEqual(data, self.makeData(key)) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/unittest.py", line 325, in failUnlessEqual raise self.failureException(msg or '%r != %r' % (first, second)) AssertionError: None != b'2000-2000-2000-2000-2000' 2 tests failed: test_urllib2 test_urllib2net ====================================================================== ERROR: testURLread (test.test_urllib2net.URLTimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 39, in testURLread f = _urlopen_with_retry("http://www.python.org/") File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 19, in _urlopen_with_retry return urllib2.urlopen(host, *args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 121, in urlopen _opener = build_opener() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_bad_address (test.test_urllib2net.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 160, in test_bad_address urllib2.urlopen, "http://www.python.invalid./") File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/unittest.py", line 311, in failUnlessRaises callableObj(*args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 121, in urlopen _opener = build_opener() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_basic (test.test_urllib2net.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 118, in test_basic open_url = _urlopen_with_retry("http://www.python.org/") File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 19, in _urlopen_with_retry return urllib2.urlopen(host, *args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 121, in urlopen _opener = build_opener() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_geturl (test.test_urllib2net.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 142, in test_geturl open_url = _urlopen_with_retry(URL) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 19, in _urlopen_with_retry return urllib2.urlopen(host, *args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 121, in urlopen _opener = build_opener() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_info (test.test_urllib2net.urlopenNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 129, in test_info open_url = _urlopen_with_retry("http://www.python.org/") File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 19, in _urlopen_with_retry return urllib2.urlopen(host, *args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 121, in urlopen _opener = build_opener() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_file (test.test_urllib2net.OtherNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 200, in test_file self._test_urls(urls, self._extra_handlers(), urllib2.urlopen) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 248, in _test_urls urllib2.install_opener(urllib2.build_opener(*handlers)) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_ftp (test.test_urllib2net.OtherNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 188, in test_ftp self._test_urls(urls, self._extra_handlers()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 248, in _test_urls urllib2.install_opener(urllib2.build_opener(*handlers)) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_http (test.test_urllib2net.OtherNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 212, in test_http self._test_urls(urls, self._extra_handlers()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 248, in _test_urls urllib2.install_opener(urllib2.build_opener(*handlers)) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_range (test.test_urllib2net.OtherNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 173, in test_range result = _urlopen_with_retry(req) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 19, in _urlopen_with_retry return urllib2.urlopen(host, *args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 121, in urlopen _opener = build_opener() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_close (test.test_urllib2net.CloseSocketTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 91, in test_close response = _urlopen_with_retry("http://www.python.org/") File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 19, in _urlopen_with_retry return urllib2.urlopen(host, *args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 121, in urlopen _opener = build_opener() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_ftp_NoneNodefault (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 319, in test_ftp_NoneNodefault u = _urlopen_with_retry(self.FTP_HOST, timeout=None) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 19, in _urlopen_with_retry return urllib2.urlopen(host, *args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 121, in urlopen _opener = build_opener() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_ftp_NoneWithdefault (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 313, in test_ftp_NoneWithdefault u = _urlopen_with_retry(self.FTP_HOST, timeout=None) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 19, in _urlopen_with_retry return urllib2.urlopen(host, *args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 121, in urlopen _opener = build_opener() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_ftp_Value (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 323, in test_ftp_Value u = _urlopen_with_retry(self.FTP_HOST, timeout=60) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 19, in _urlopen_with_retry return urllib2.urlopen(host, *args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 121, in urlopen _opener = build_opener() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_ftp_basic (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 306, in test_ftp_basic u = _urlopen_with_retry(self.FTP_HOST) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 19, in _urlopen_with_retry return urllib2.urlopen(host, *args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 121, in urlopen _opener = build_opener() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_http_NoneNodefault (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 300, in test_http_NoneNodefault u = _urlopen_with_retry("http://www.python.org", timeout=None) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 19, in _urlopen_with_retry return urllib2.urlopen(host, *args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 121, in urlopen _opener = build_opener() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_http_NoneWithdefault (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 290, in test_http_NoneWithdefault u = _urlopen_with_retry("http://www.python.org", timeout=None) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 19, in _urlopen_with_retry return urllib2.urlopen(host, *args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 121, in urlopen _opener = build_opener() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_http_Value (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 296, in test_http_Value u = _urlopen_with_retry("http://www.python.org", timeout=120) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 19, in _urlopen_with_retry return urllib2.urlopen(host, *args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 121, in urlopen _opener = build_opener() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' ====================================================================== ERROR: test_http_basic (test.test_urllib2net.TimeoutTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 283, in test_http_basic u = _urlopen_with_retry("http://www.python.org") File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_urllib2net.py", line 19, in _urlopen_with_retry return urllib2.urlopen(host, *args, **kwargs) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 121, in urlopen _opener = build_opener() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 458, in build_opener opener.add_handler(klass()) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib2.py", line 667, in __init__ proxies = getproxies() File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/urllib.py", line 1244, in getproxies_environment for name, value in os.environ.items(): AttributeError: 'NoneType' object has no attribute 'environ' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 1 04:23:19 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 03:23:19 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.0 Message-ID: <20080201032320.3342A1E4012@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.0/builds/473 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: bill.janssen BUILD FAILED: failed test Excerpt from the test logfile: 6 tests failed: test_anydbm test_bsddb test_bsddb3 test_mailbox test_shelve test_whichdb ====================================================================== ERROR: test_anydbm_access (test.test_anydbm.AnyDBMTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_anydbm.py", line 90, in test_anydbm_access self.init_db() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_anydbm.py", line 103, in init_db f = anydbm.open(_fname, 'n') File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_anydbm_creation (test.test_anydbm.AnyDBMTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_anydbm.py", line 63, in test_anydbm_creation f = anydbm.open(_fname, 'c') File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_anydbm_keys (test.test_anydbm.AnyDBMTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_anydbm.py", line 84, in test_anydbm_keys self.init_db() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_anydbm.py", line 103, in init_db f = anydbm.open(_fname, 'n') File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_anydbm_modification (test.test_anydbm.AnyDBMTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_anydbm.py", line 71, in test_anydbm_modification self.init_db() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_anydbm.py", line 103, in init_db f = anydbm.open(_fname, 'n') File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_anydbm_read (test.test_anydbm.AnyDBMTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_anydbm.py", line 78, in test_anydbm_read self.init_db() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_anydbm.py", line 103, in init_db f = anydbm.open(_fname, 'n') File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test__no_deadlock_first (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_change (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_clear (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_close_and_reopen (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_contains (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_first_next_looping (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_first_while_deleting (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_for_cursor_memleak (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_get (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_getitem (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_iter_while_modifying_values (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_iteritems_while_modifying_values (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_keyordering (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_last_while_deleting (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_len (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_mapping_iteration_methods (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_pop (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_popitem (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_previous_last_looping (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_set_location (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_setdefault (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_update (test.test_bsddb.TestBTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test__no_deadlock_first (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_change (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_clear (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_close_and_reopen (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_contains (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_first_next_looping (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_first_while_deleting (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_for_cursor_memleak (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_get (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_getitem (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_iter_while_modifying_values (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_iteritems_while_modifying_values (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_keyordering (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_last_while_deleting (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_len (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_mapping_iteration_methods (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_pop (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_popitem (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_previous_last_looping (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_set_location (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_setdefault (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_update (test.test_bsddb.TestHashTable) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test__no_deadlock_first (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_change (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_clear (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_close_and_reopen (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_contains (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_first_next_looping (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_first_while_deleting (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_for_cursor_memleak (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_get (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_getitem (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_iter_while_modifying_values (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_iteritems_while_modifying_values (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_keyordering (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_last_while_deleting (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_len (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_mapping_iteration_methods (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_pop (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_popitem (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_previous_last_looping (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_set_location (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_setdefault (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_update (test.test_bsddb.TestBTree_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test__no_deadlock_first (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_change (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_clear (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_close_and_reopen (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_contains (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_first_next_looping (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_first_while_deleting (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_for_cursor_memleak (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_get (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_getitem (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_iter_while_modifying_values (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_iteritems_while_modifying_values (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_keyordering (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_last_while_deleting (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_len (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_mapping_iteration_methods (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_pop (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_popitem (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_previous_last_looping (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_set_location (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_setdefault (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_update (test.test_bsddb.TestHashTable_InMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test__no_deadlock_first (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_change (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_clear (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_close_and_reopen (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_contains (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_first_next_looping (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_first_while_deleting (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_for_cursor_memleak (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_get (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_getitem (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_iter_while_modifying_values (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_iteritems_while_modifying_values (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_keyordering (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_last_while_deleting (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_len (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_mapping_iteration_methods (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_pop (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_popitem (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_previous_last_looping (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_set_location (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_setdefault (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_update (test.test_bsddb.TestBTree_InMemory_Truncate) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 20, in setUp self.f = self.do_open(self.fname, self.openflag, cachesize=32768) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb.py", line 17, in do_open return bsddb.StringValues(bsddb.StringKeys(self.openmethod[0](*args, **kw))) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 452, in btopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 488, in _openDBEnv e.set_cachesize(0, cachesize) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') Traceback (most recent call last): File "../lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb3.py", line 90, in test_main run_unittest(suite()) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_bsddb3.py", line 53, in suite import bsddb.test.test_1413192 File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\test\test_1413192.py", line 38, in context = Context() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\test\test_1413192.py", line 26, in __init__ db.DB_CREATE | db.DB_INIT_TXN | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_consistent_factory (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 520, in test_consistent_factory msg2 = box.get_message(key) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\mailbox.py", line 313, in get_message subpath = self._lookup(key) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\mailbox.py", line 482, in _lookup raise KeyError('No message with key: %s' % key) KeyError: 'No message with key: 1201836086.M473999P1272Q201.buildbot' ====================================================================== ERROR: test_flush (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 717, in tearDown self._delete_recursively(self._path) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 47, in _delete_recursively os.remove(target) WindowsError: [Error 32] The process cannot access the file because it is being used by another process: '@test' ====================================================================== ERROR: test_popitem (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 336, in test_popitem self.assertEqual(int(msg.get_payload()), keys.index(key)) ValueError: invalid literal for int() with base 10: 'From: foo 0 F' ====================================================================== ERROR: test_flush (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 717, in tearDown self._delete_recursively(self._path) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 47, in _delete_recursively os.remove(target) WindowsError: [Error 32] The process cannot access the file because it is being used by another process: '@test' ====================================================================== ERROR: test_popitem (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 336, in test_popitem self.assertEqual(int(msg.get_payload()), keys.index(key)) ValueError: invalid literal for int() with base 10: 'From: foo 0 \x01' ====================================================================== ERROR: test_flush (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 940, in tearDown self._delete_recursively(self._path) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 47, in _delete_recursively os.remove(target) WindowsError: [Error 32] The process cannot access the file because it is being used by another process: '@test' ====================================================================== ERROR: test_popitem (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 336, in test_popitem self.assertEqual(int(msg.get_payload()), keys.index(key)) ValueError: invalid literal for int() with base 10: 'From: foo *** EOOH *** From: foo 0 1,, From: foo *** EOOH *** From: foo 1 1,, From: foo *** EOOH *** From: foo 2 1,, From: foo *** EOOH *** From: foo 3 ' ====================================================================== FAIL: test_dump_message (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 412, in test_dump_message _sample_message.replace('\n', os.linesep)) AssertionError: 'Return-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n' != 'Return-Path: \r\nX-Original-To: gkj+person at localhost\r\nDelivered-To: gkj+person at localhost\r\nReceived: from localhost (localhost [127.0.0.1])\r\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\r\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\r\nDelivered-To: gkj at sundance.gregorykjohnson.com\r\nReceived: from localhost [127.0.0.1]\r\n by localhost with POP3 (fetchmail-6.2.5)\r\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\r\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\r\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\r\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\r\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\r\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\r\nDate: Wed, 13 Jul 2005 17:23:11 -0400\r\nFrom: "Gregory K. Johnson" \r\nTo: gkj at gregorykjohnson.com\r\nSubject: Sample message\r\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\r\nMime-Version: 1.0\r\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\r\nContent-Disposition: inline\r\nUser-Agent: Mutt/1.5.9i\r\n\r\n\r\n--NMuMz9nt05w80d4+\r\nContent-Type: text/plain; charset=us-ascii\r\nContent-Disposition: inline\r\n\r\nThis is a sample message.\r\n\r\n--\r\nGregory K. Johnson\r\n\r\n--NMuMz9nt05w80d4+\r\nContent-Type: application/octet-stream\r\nContent-Disposition: attachment; filename="text.gz"\r\nContent-Transfer-Encoding: base64\r\n\r\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\r\n3FYlAAAA\r\n\r\n--NMuMz9nt05w80d4+--\r\n' ====================================================================== FAIL: test_add (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 77, in test_add self.assertEqual(self._box.get_string(keys[0]), self._template % 0) AssertionError: '\nFrom: foo\n\n0\n\nF' != 'From: foo\n\n0' ====================================================================== FAIL: test_add_and_close (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 757, in test_add_and_close self.assertEqual(contents, open(self._path, 'r').read()) AssertionError: 'From MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nReturn-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nFrom: foo\n\n0\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nFrom: foo\n\n1\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nFrom: foo\n\n2\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nReturn-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n' != 'From MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nReturn-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nFrom: foo\n\n0\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nFrom: foo\n\n1\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nFrom: foo\n\n2\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nReturn-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nFrom: foo\n\n0\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nFrom: foo\n\n1\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nFrom: foo\n\n2\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nReturn-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nFrom: foo\n\n1\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nFrom: foo\n\n2\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nReturn-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nFrom: foo\n\n2\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nReturn-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:45 2008\n\nReturn-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n' ====================================================================== FAIL: test_add_from_string (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 724, in test_add_from_string self.assertEqual(self._box[key].get_from(), 'foo at bar blah') AssertionError: 'foo at bar blah\n' != 'foo at bar blah' ====================================================================== FAIL: test_close (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 389, in test_close self._test_flush_or_close(self._box.close) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 400, in _test_flush_or_close self.assertEqual(len(keys), 3) AssertionError: 6 != 3 ====================================================================== FAIL: test_delitem (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 87, in test_delitem self._test_remove_or_delitem(self._box.__delitem__) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 99, in _test_remove_or_delitem self.assertEqual(self._box.get_string(key1), self._template % 1) AssertionError: '\nFrom: foo\n\n1' != 'From: foo\n\n1' ====================================================================== FAIL: test_dump_message (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 412, in test_dump_message _sample_message.replace('\n', os.linesep)) AssertionError: 'Return-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n' != 'Return-Path: \r\nX-Original-To: gkj+person at localhost\r\nDelivered-To: gkj+person at localhost\r\nReceived: from localhost (localhost [127.0.0.1])\r\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\r\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\r\nDelivered-To: gkj at sundance.gregorykjohnson.com\r\nReceived: from localhost [127.0.0.1]\r\n by localhost with POP3 (fetchmail-6.2.5)\r\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\r\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\r\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\r\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\r\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\r\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\r\nDate: Wed, 13 Jul 2005 17:23:11 -0400\r\nFrom: "Gregory K. Johnson" \r\nTo: gkj at gregorykjohnson.com\r\nSubject: Sample message\r\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\r\nMime-Version: 1.0\r\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\r\nContent-Disposition: inline\r\nUser-Agent: Mutt/1.5.9i\r\n\r\n\r\n--NMuMz9nt05w80d4+\r\nContent-Type: text/plain; charset=us-ascii\r\nContent-Disposition: inline\r\n\r\nThis is a sample message.\r\n\r\n--\r\nGregory K. Johnson\r\n\r\n--NMuMz9nt05w80d4+\r\nContent-Type: application/octet-stream\r\nContent-Disposition: attachment; filename="text.gz"\r\nContent-Transfer-Encoding: base64\r\n\r\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\r\n3FYlAAAA\r\n\r\n--NMuMz9nt05w80d4+--\r\n' ====================================================================== FAIL: test_flush (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 377, in test_flush self._test_flush_or_close(self._box.flush) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 400, in _test_flush_or_close self.assertEqual(len(keys), 3) AssertionError: 6 != 3 ====================================================================== FAIL: test_get (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 129, in test_get self.assertEqual(msg['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_get_file (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 174, in test_get_file self._template % 0) AssertionError: '\nFrom: foo\n\n0\n\nF' != 'From: foo\n\n0' ====================================================================== FAIL: test_get_message (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 156, in test_get_message self.assertEqual(msg0['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_get_string (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 164, in test_get_string self.assertEqual(self._box.get_string(key0), self._template % 0) AssertionError: '\nFrom: foo\n\n0\n\nF' != 'From: foo\n\n0' ====================================================================== FAIL: test_getitem (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 144, in test_getitem self.assertEqual(msg['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_items (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 207, in test_items self._check_iteration(self._box.items, do_keys=True, do_values=True) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 231, in _check_iteration self.assertEqual(value['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_iter (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 194, in test_iter do_values=True) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 231, in _check_iteration self.assertEqual(value['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_iteritems (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 203, in test_iteritems do_values=True) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 231, in _check_iteration self.assertEqual(value['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_itervalues (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 189, in test_itervalues do_values=True) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 231, in _check_iteration self.assertEqual(value['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_open_close_open (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 741, in test_open_close_open self.assertEqual(len(self._box), 3) AssertionError: 6 != 3 ====================================================================== FAIL: test_pop (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 313, in test_pop self.assertEqual(self._box.pop(key0).get_payload(), '0') AssertionError: 'From: foo\n\n0\n\nF' != '0' ====================================================================== FAIL: test_remove (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 83, in test_remove self._test_remove_or_delitem(self._box.remove) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 99, in _test_remove_or_delitem self.assertEqual(self._box.get_string(key1), self._template % 1) AssertionError: '\nFrom: foo\n\n1' != 'From: foo\n\n1' ====================================================================== FAIL: test_set_item (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 272, in test_set_item self._template % 'original 0') AssertionError: '\nFrom: foo\n\noriginal 0' != 'From: foo\n\noriginal 0' ====================================================================== FAIL: test_update (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 350, in test_update self._template % 'changed 0') AssertionError: '\nFrom: foo\n\nchanged 0\n\nF' != 'From: foo\n\nchanged 0' ====================================================================== FAIL: test_values (test.test_mailbox.TestMbox) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 198, in test_values self._check_iteration(self._box.values, do_keys=False, do_values=True) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 231, in _check_iteration self.assertEqual(value['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_add (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 77, in test_add self.assertEqual(self._box.get_string(keys[0]), self._template % 0) AssertionError: '\nFrom: foo\n\n0\n\n\x01' != 'From: foo\n\n0' ====================================================================== FAIL: test_add_and_close (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 757, in test_add_and_close self.assertEqual(contents, open(self._path, 'r').read()) AssertionError: '\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nReturn-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nFrom: foo\n\n0\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nFrom: foo\n\n1\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nFrom: foo\n\n2\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nReturn-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n\n\n\x01\x01\x01\x01\n\n' != '\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nReturn-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nFrom: foo\n\n0\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nFrom: foo\n\n1\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nFrom: foo\n\n2\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nReturn-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n\n\n\x01\x01\x01\x01\n\n\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nFrom: foo\n\n0\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nFrom: foo\n\n1\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nFrom: foo\n\n2\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nReturn-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n\n\n\x01\x01\x01\x01\n\n\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nFrom: foo\n\n1\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nFrom: foo\n\n2\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nReturn-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n\n\n\x01\x01\x01\x01\n\n\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nFrom: foo\n\n2\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nReturn-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n\n\n\x01\x01\x01\x01\n\n\n\n\x01\x01\x01\x01\n\n\x01\x01\x01\x01\n\nFrom MAILER-DAEMON Fri Feb 01 03:21:57 2008\n\nReturn-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n\n\n\x01\x01\x01\x01\n\n\n\n\x01\x01\x01\x01\n\n' ====================================================================== FAIL: test_add_from_string (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 724, in test_add_from_string self.assertEqual(self._box[key].get_from(), 'foo at bar blah') AssertionError: 'foo at bar blah\n' != 'foo at bar blah' ====================================================================== FAIL: test_close (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 389, in test_close self._test_flush_or_close(self._box.close) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 400, in _test_flush_or_close self.assertEqual(len(keys), 3) AssertionError: 0 != 3 ====================================================================== FAIL: test_delitem (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 87, in test_delitem self._test_remove_or_delitem(self._box.__delitem__) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 99, in _test_remove_or_delitem self.assertEqual(self._box.get_string(key1), self._template % 1) AssertionError: '\nFrom: foo\n\n1\n\n\x01' != 'From: foo\n\n1' ====================================================================== FAIL: test_dump_message (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 412, in test_dump_message _sample_message.replace('\n', os.linesep)) AssertionError: 'Return-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n' != 'Return-Path: \r\nX-Original-To: gkj+person at localhost\r\nDelivered-To: gkj+person at localhost\r\nReceived: from localhost (localhost [127.0.0.1])\r\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\r\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\r\nDelivered-To: gkj at sundance.gregorykjohnson.com\r\nReceived: from localhost [127.0.0.1]\r\n by localhost with POP3 (fetchmail-6.2.5)\r\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\r\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\r\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\r\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\r\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\r\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\r\nDate: Wed, 13 Jul 2005 17:23:11 -0400\r\nFrom: "Gregory K. Johnson" \r\nTo: gkj at gregorykjohnson.com\r\nSubject: Sample message\r\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\r\nMime-Version: 1.0\r\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\r\nContent-Disposition: inline\r\nUser-Agent: Mutt/1.5.9i\r\n\r\n\r\n--NMuMz9nt05w80d4+\r\nContent-Type: text/plain; charset=us-ascii\r\nContent-Disposition: inline\r\n\r\nThis is a sample message.\r\n\r\n--\r\nGregory K. Johnson\r\n\r\n--NMuMz9nt05w80d4+\r\nContent-Type: application/octet-stream\r\nContent-Disposition: attachment; filename="text.gz"\r\nContent-Transfer-Encoding: base64\r\n\r\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\r\n3FYlAAAA\r\n\r\n--NMuMz9nt05w80d4+--\r\n' ====================================================================== FAIL: test_flush (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 377, in test_flush self._test_flush_or_close(self._box.flush) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 400, in _test_flush_or_close self.assertEqual(len(keys), 3) AssertionError: 0 != 3 ====================================================================== FAIL: test_get (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 129, in test_get self.assertEqual(msg['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_get_file (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 174, in test_get_file self._template % 0) AssertionError: '\nFrom: foo\n\n0\n\n\x01' != 'From: foo\n\n0' ====================================================================== FAIL: test_get_message (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 156, in test_get_message self.assertEqual(msg0['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_get_string (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 164, in test_get_string self.assertEqual(self._box.get_string(key0), self._template % 0) AssertionError: '\nFrom: foo\n\n0\n\n\x01' != 'From: foo\n\n0' ====================================================================== FAIL: test_getitem (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 144, in test_getitem self.assertEqual(msg['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_items (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 207, in test_items self._check_iteration(self._box.items, do_keys=True, do_values=True) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 231, in _check_iteration self.assertEqual(value['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_iter (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 194, in test_iter do_values=True) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 231, in _check_iteration self.assertEqual(value['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_iteritems (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 203, in test_iteritems do_values=True) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 231, in _check_iteration self.assertEqual(value['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_itervalues (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 189, in test_itervalues do_values=True) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 231, in _check_iteration self.assertEqual(value['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_open_close_open (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 741, in test_open_close_open self.assertEqual(len(self._box), 3) AssertionError: 0 != 3 ====================================================================== FAIL: test_pop (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 313, in test_pop self.assertEqual(self._box.pop(key0).get_payload(), '0') AssertionError: 'From: foo\n\n0\n\n\x01' != '0' ====================================================================== FAIL: test_remove (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 83, in test_remove self._test_remove_or_delitem(self._box.remove) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 99, in _test_remove_or_delitem self.assertEqual(self._box.get_string(key1), self._template % 1) AssertionError: '\nFrom: foo\n\n1\n\n\x01' != 'From: foo\n\n1' ====================================================================== FAIL: test_set_item (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 272, in test_set_item self._template % 'original 0') AssertionError: '\nFrom: foo\n\noriginal 0\n\n\x01' != 'From: foo\n\noriginal 0' ====================================================================== FAIL: test_update (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 350, in test_update self._template % 'changed 0') AssertionError: '\nFrom: foo\n\nchanged 0\n\n\x01' != 'From: foo\n\nchanged 0' ====================================================================== FAIL: test_values (test.test_mailbox.TestMMDF) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 198, in test_values self._check_iteration(self._box.values, do_keys=False, do_values=True) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 231, in _check_iteration self.assertEqual(value['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_dump_message (test.test_mailbox.TestMH) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 412, in test_dump_message _sample_message.replace('\n', os.linesep)) AssertionError: 'Return-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n' != 'Return-Path: \r\nX-Original-To: gkj+person at localhost\r\nDelivered-To: gkj+person at localhost\r\nReceived: from localhost (localhost [127.0.0.1])\r\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\r\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\r\nDelivered-To: gkj at sundance.gregorykjohnson.com\r\nReceived: from localhost [127.0.0.1]\r\n by localhost with POP3 (fetchmail-6.2.5)\r\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\r\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\r\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\r\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\r\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\r\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\r\nDate: Wed, 13 Jul 2005 17:23:11 -0400\r\nFrom: "Gregory K. Johnson" \r\nTo: gkj at gregorykjohnson.com\r\nSubject: Sample message\r\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\r\nMime-Version: 1.0\r\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\r\nContent-Disposition: inline\r\nUser-Agent: Mutt/1.5.9i\r\n\r\n\r\n--NMuMz9nt05w80d4+\r\nContent-Type: text/plain; charset=us-ascii\r\nContent-Disposition: inline\r\n\r\nThis is a sample message.\r\n\r\n--\r\nGregory K. Johnson\r\n\r\n--NMuMz9nt05w80d4+\r\nContent-Type: application/octet-stream\r\nContent-Disposition: attachment; filename="text.gz"\r\nContent-Transfer-Encoding: base64\r\n\r\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\r\n3FYlAAAA\r\n\r\n--NMuMz9nt05w80d4+--\r\n' ====================================================================== FAIL: test_add (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 77, in test_add self.assertEqual(self._box.get_string(keys[0]), self._template % 0) AssertionError: '\nFrom: foo\n\n\n\n*** EOOH ***\n\nFrom: foo\n\n\n\n0\n\n\x1f\x0c\n\n1,,\n\nReturn-Path: \n\nX-Original-To: gkj+person at localhost\n\nDelivered-To: gkj+person at localhost\n\nReceived: from localhost (localhost [127.0.0.1])\n\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nDelivered-To: gkj at sundance.gregorykjohnson.com\n\nReceived: from localhost [127.0.0.1]\n\n by localhost with POP3 (fetchmail-6.2.5)\n\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nDate: Wed, 13 Jul 2005 17:23:11 -0400\n\nFrom: "Gregory K. Johnson" \n\nTo: gkj at gregorykjohnson.com\n\nSubject: Sample message\n\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\n\nMime-Version: 1.0\n\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\n\nContent-Disposition: inline\n\nUser-Agent: Mutt/1.5.9i\n\n\n\n*** EOOH ***\n\nReturn-Path: \n\nX-Original-To: gkj+person at localhost\n\nDelivered-To: gkj+person at localhost\n\nReceived: from localhost (localhost [127.0.0.1])\n\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nDelivered-To: gkj at sundance.gregorykjohnson.com\n\nReceived: from localhost [127.0.0.1]\n\n by localhost with POP3 (fetchmail-6.2.5)\n\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nDate: Wed, 13 Jul 2005 17:23:11 -0400\n\nFrom: "Gregory K. Johnson" \n\nTo: gkj at gregorykjohnson.com\n\nSubject: Sample message\n\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\n\nMime-Version: 1.0\n\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\n\nContent-Disposition: inline\n\nUser-Agent: Mutt/1.5.9i\n\n\n\n\n\n--NMuMz9nt05w80d4+\n\nContent-Type: text/plain; charset=us-ascii\n\nContent-Disposition: inline\n\n\n\nThis is a sample message.\n\n\n\n--\n\nGregory K. Johnson\n\n\n\n--NMuMz9nt05w80d4+\n\nContent-Type: application/octet-stream\n\nContent-Disposition: attachment; filename="text.gz"\n\nContent-Transfer-Encoding: base64\n\n\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n\n3FYlAAAA\n\n\n\n--NMuMz9nt05w80d4+--\n\n\n\n\x1f\x0c\n\n1,,\n\nReturn-Path: \n\nX-Original-To: gkj+person at localhost\n\nDelivered-To: gkj+person at localhost\n\nReceived: from localhost (localhost [127.0.0.1])\n\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nDelivered-To: gkj at sundance.gregorykjohnson.com\n\nReceived: from localhost [127.0.0.1]\n\n by localhost with POP3 (fetchmail-6.2.5)\n\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nDate: Wed, 13 Jul 2005 17:23:11 -0400\n\nFrom: "Gregory K. Johnson" \n\nTo: gkj at gregorykjohnson.com\n\nSubject: Sample message\n\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\n\nMime-Version: 1.0\n\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\n\nContent-Disposition: inline\n\nUser-Agent: Mutt/1.5.9i\n\n\n\n*** EOOH ***\n\nReturn-Path: \n\nX-Original-To: gkj+person at localhost\n\nDelivered-To: gkj+person at localhost\n\nReceived: from localhost (localhost [127.0.0.1])\n\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nDelivered-To: gkj at sundance.gregorykjohnson.com\n\nReceived: from localhost [127.0.0.1]\n\n by localhost with POP3 (fetchmail-6.2.5)\n\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nDate: Wed, 13 Jul 2005 17:23:11 -0400\n\nFrom: "Gregory K. Johnson" \n\nTo: gkj at gregorykjohnson.com\n\nSubject: Sample message\n\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\n\nMime-Version: 1.0\n\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\n\nContent-Disposition: inline\n\nUser-Agent: Mutt/1.5.9i\n\n\n\n\n\n--NMuMz9nt05w80d4+\n\nContent-Type: text/plain; charset=us-ascii\n\nContent-Disposition: inline\n\n\n\nThis is a sample message.\n\n\n\n--\n\nGregory K. Johnson\n\n\n\n--NMuMz9nt05w80d4+\n\nContent-Type: application/octet-stream\n\nContent-Disposition: attachment; filename="text.gz"\n\nContent-Transfer-Encoding: base64\n\n\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n\n3FYlAAAA\n\n\n\n--NMuMz9nt05w80d4+--\n\n\n\n\x1f\x0c\n\n1,,\n\nReturn-Path: \n\nX-Original-To: gkj+person at localhost\n\nDelivered-To: gkj+person at localhost\n\nReceived: from localhost (localhost [127.0.0.1])\n\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nDelivered-To: gkj at sundance.gregorykjohnson.com\n\nReceived: from localhost [127.0.0.1]\n\n by localhost with POP3 (fetchmail-6.2.5)\n\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nDate: Wed, 13 Jul 2005 17:23:11 -0400\n\nFrom: "Gregory K. Johnson" \n\nTo: gkj at gregorykjohnson.com\n\nSubject: Sample message\n\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\n\nMime-Version: 1.0\n\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\n\nContent-Disposition: inline\n\nUser-Agent: Mutt/1.5.9i\n\n\n\n*** EOOH ***\n\nReturn-Path: \n\nX-Original-To: gkj+person at localhost\n\nDelivered-To: gkj+person at localhost\n\nReceived: from localhost (localhost [127.0.0.1])\n\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nDelivered-To: gkj at sundance.gregorykjohnson.com\n\nReceived: from localhost [127.0.0.1]\n\n by localhost with POP3 (fetchmail-6.2.5)\n\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nDate: Wed, 13 Jul 2005 17:23:11 -0400\n\nFrom: "Gregory K. Johnson" \n\nTo: gkj at gregorykjohnson.com\n\nSubject: Sample message\n\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\n\nMime-Version: 1.0\n\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\n\nContent-Disposition: inline\n\nUser-Agent: Mutt/1.5.9i\n\n\n\n*** EOOH ***\n\n\n\n--NMuMz9nt05w80d4+\n\nContent-Type: text/plain; charset=us-ascii\n\nContent-Disposition: inline\n\n\n\nThis is a sample message.\n\n\n\n--\n\nGregory K. Johnson\n\n\n\n--NMuMz9nt05w80d4+\n\nContent-Type: application/octet-stream\n\nContent-Disposition: attachment; filename="text.gz"\n\nContent-Transfer-Encoding: base64\n\n\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n\n3FYlAAAA\n\n\n\n--NMuMz9nt05w80d4+--\n\n\n\n\x1f\x0c\n\n1,,\n\nReturn-Path: \n\nX-Original-To: gkj+person at localhost\n\nDelivered-To: gkj+person at localhost\n\nReceived: from localhost (localhost [127.0.0.1])\n\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nDelivered-To: gkj at sundance.gregorykjohnson.com\n\nReceived: from localhost [127.0.0.1]\n\n by localhost with POP3 (fetchmail-6.2.5)\n\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nDate: Wed, 13 Jul 2005 17:23:11 -0400\n\nFrom: "Gregory K. Johnson" \n\nTo: gkj at gregorykjohnson.com\n\nSubject: Sample message\n\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\n\nMime-Version: 1.0\n\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\n\nContent-Disposition: inline\n\nUser-Agent: Mutt/1.5.9i\n\n\n\n*** EOOH ***\n\nReturn-Path: \n\nX-Original-To: gkj+person at localhost\n\nDelivered-To: gkj+person at localhost\n\nReceived: from localhost (localhost [127.0.0.1])\n\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nDelivered-To: gkj at sundance.gregorykjohnson.com\n\nReceived: from localhost [127.0.0.1]\n\n by localhost with POP3 (fetchmail-6.2.5)\n\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nDate: Wed, 13 Jul 2005 17:23:11 -0400\n\nFrom: "Gregory K. Johnson" \n\nTo: gkj at gregorykjohnson.com\n\nSubject: Sample message\n\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\n\nMime-Version: 1.0\n\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\n\nContent-Disposition: inline\n\nUser-Agent: Mutt/1.5.9i\n\n\n\n\n\n--NMuMz9nt05w80d4+\n\nContent-Type: text/plain; charset=us-ascii\n\nContent-Disposition: inline\n\n\n\nThis is a sample message.\n\n\n\n--\n\nGregory K. Johnson\n\n\n\n--NMuMz9nt05w80d4+\n\nContent-Type: application/octet-stream\n\nContent-Disposition: attachment; filename="text.gz"\n\nContent-Transfer-Encoding: base64\n\n\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n\n3FYlAAAA\n\n\n\n--NMuMz9nt05w80d4+--\n\n\n\n\x1f' != 'From: foo\n\n0' ====================================================================== FAIL: test_close (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 389, in test_close self._test_flush_or_close(self._box.close) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 400, in _test_flush_or_close self.assertEqual(len(keys), 3) AssertionError: 0 != 3 ====================================================================== FAIL: test_delitem (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 87, in test_delitem self._test_remove_or_delitem(self._box.__delitem__) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 99, in _test_remove_or_delitem self.assertEqual(self._box.get_string(key1), self._template % 1) AssertionError: '\nFrom: foo\n\n\n\n*** EOOH ***\n\nFrom: foo\n\n\n\n1\n\n\x1f' != 'From: foo\n\n1' ====================================================================== FAIL: test_dump_message (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 412, in test_dump_message _sample_message.replace('\n', os.linesep)) AssertionError: 'Return-Path: \nX-Original-To: gkj+person at localhost\nDelivered-To: gkj+person at localhost\nReceived: from localhost (localhost [127.0.0.1])\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nDelivered-To: gkj at sundance.gregorykjohnson.com\nReceived: from localhost [127.0.0.1]\n by localhost with POP3 (fetchmail-6.2.5)\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\nDate: Wed, 13 Jul 2005 17:23:11 -0400\nFrom: "Gregory K. Johnson" \nTo: gkj at gregorykjohnson.com\nSubject: Sample message\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\nMime-Version: 1.0\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\nContent-Disposition: inline\nUser-Agent: Mutt/1.5.9i\n\n\n--NMuMz9nt05w80d4+\nContent-Type: text/plain; charset=us-ascii\nContent-Disposition: inline\n\nThis is a sample message.\n\n--\nGregory K. Johnson\n\n--NMuMz9nt05w80d4+\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename="text.gz"\nContent-Transfer-Encoding: base64\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n3FYlAAAA\n\n--NMuMz9nt05w80d4+--\n' != 'Return-Path: \r\nX-Original-To: gkj+person at localhost\r\nDelivered-To: gkj+person at localhost\r\nReceived: from localhost (localhost [127.0.0.1])\r\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\r\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\r\nDelivered-To: gkj at sundance.gregorykjohnson.com\r\nReceived: from localhost [127.0.0.1]\r\n by localhost with POP3 (fetchmail-6.2.5)\r\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\r\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\r\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\r\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\r\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\r\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\r\nDate: Wed, 13 Jul 2005 17:23:11 -0400\r\nFrom: "Gregory K. Johnson" \r\nTo: gkj at gregorykjohnson.com\r\nSubject: Sample message\r\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\r\nMime-Version: 1.0\r\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\r\nContent-Disposition: inline\r\nUser-Agent: Mutt/1.5.9i\r\n\r\n\r\n--NMuMz9nt05w80d4+\r\nContent-Type: text/plain; charset=us-ascii\r\nContent-Disposition: inline\r\n\r\nThis is a sample message.\r\n\r\n--\r\nGregory K. Johnson\r\n\r\n--NMuMz9nt05w80d4+\r\nContent-Type: application/octet-stream\r\nContent-Disposition: attachment; filename="text.gz"\r\nContent-Transfer-Encoding: base64\r\n\r\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\r\n3FYlAAAA\r\n\r\n--NMuMz9nt05w80d4+--\r\n' ====================================================================== FAIL: test_flush (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 377, in test_flush self._test_flush_or_close(self._box.flush) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 400, in _test_flush_or_close self.assertEqual(len(keys), 3) AssertionError: 0 != 3 ====================================================================== FAIL: test_get (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 129, in test_get self.assertEqual(msg['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_get_file (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 174, in test_get_file self._template % 0) AssertionError: '\nFrom: foo\n\n\n\n*** EOOH ***\n\nFrom: foo\n\n\n\n0\n\n\x1f\x0c\n\n1,,\n\nReturn-Path: \n\nX-Original-To: gkj+person at localhost\n\nDelivered-To: gkj+person at localhost\n\nReceived: from localhost (localhost [127.0.0.1])\n\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nDelivered-To: gkj at sundance.gregorykjohnson.com\n\nReceived: from localhost [127.0.0.1]\n\n by localhost with POP3 (fetchmail-6.2.5)\n\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nDate: Wed, 13 Jul 2005 17:23:11 -0400\n\nFrom: "Gregory K. Johnson" \n\nTo: gkj at gregorykjohnson.com\n\nSubject: Sample message\n\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\n\nMime-Version: 1.0\n\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\n\nContent-Disposition: inline\n\nUser-Agent: Mutt/1.5.9i\n\n\n\n*** EOOH ***\n\nReturn-Path: \n\nX-Original-To: gkj+person at localhost\n\nDelivered-To: gkj+person at localhost\n\nReceived: from localhost (localhost [127.0.0.1])\n\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nDelivered-To: gkj at sundance.gregorykjohnson.com\n\nReceived: from localhost [127.0.0.1]\n\n by localhost with POP3 (fetchmail-6.2.5)\n\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nDate: Wed, 13 Jul 2005 17:23:11 -0400\n\nFrom: "Gregory K. Johnson" \n\nTo: gkj at gregorykjohnson.com\n\nSubject: Sample message\n\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\n\nMime-Version: 1.0\n\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\n\nContent-Disposition: inline\n\nUser-Agent: Mutt/1.5.9i\n\n\n\n\n\n--NMuMz9nt05w80d4+\n\nContent-Type: text/plain; charset=us-ascii\n\nContent-Disposition: inline\n\n\n\nThis is a sample message.\n\n\n\n--\n\nGregory K. Johnson\n\n\n\n--NMuMz9nt05w80d4+\n\nContent-Type: application/octet-stream\n\nContent-Disposition: attachment; filename="text.gz"\n\nContent-Transfer-Encoding: base64\n\n\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n\n3FYlAAAA\n\n\n\n--NMuMz9nt05w80d4+--\n\n\n\n\x1f' != 'From: foo\n\n0' ====================================================================== FAIL: test_get_message (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 156, in test_get_message self.assertEqual(msg0['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_get_string (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 164, in test_get_string self.assertEqual(self._box.get_string(key0), self._template % 0) AssertionError: '\nFrom: foo\n\n\n\n*** EOOH ***\n\nFrom: foo\n\n\n\n0\n\n\x1f\x0c\n\n1,,\n\nReturn-Path: \n\nX-Original-To: gkj+person at localhost\n\nDelivered-To: gkj+person at localhost\n\nReceived: from localhost (localhost [127.0.0.1])\n\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nDelivered-To: gkj at sundance.gregorykjohnson.com\n\nReceived: from localhost [127.0.0.1]\n\n by localhost with POP3 (fetchmail-6.2.5)\n\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nDate: Wed, 13 Jul 2005 17:23:11 -0400\n\nFrom: "Gregory K. Johnson" \n\nTo: gkj at gregorykjohnson.com\n\nSubject: Sample message\n\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\n\nMime-Version: 1.0\n\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\n\nContent-Disposition: inline\n\nUser-Agent: Mutt/1.5.9i\n\n\n\n*** EOOH ***\n\nReturn-Path: \n\nX-Original-To: gkj+person at localhost\n\nDelivered-To: gkj+person at localhost\n\nReceived: from localhost (localhost [127.0.0.1])\n\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nDelivered-To: gkj at sundance.gregorykjohnson.com\n\nReceived: from localhost [127.0.0.1]\n\n by localhost with POP3 (fetchmail-6.2.5)\n\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nDate: Wed, 13 Jul 2005 17:23:11 -0400\n\nFrom: "Gregory K. Johnson" \n\nTo: gkj at gregorykjohnson.com\n\nSubject: Sample message\n\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\n\nMime-Version: 1.0\n\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\n\nContent-Disposition: inline\n\nUser-Agent: Mutt/1.5.9i\n\n\n\n\n\n--NMuMz9nt05w80d4+\n\nContent-Type: text/plain; charset=us-ascii\n\nContent-Disposition: inline\n\n\n\nThis is a sample message.\n\n\n\n--\n\nGregory K. Johnson\n\n\n\n--NMuMz9nt05w80d4+\n\nContent-Type: application/octet-stream\n\nContent-Disposition: attachment; filename="text.gz"\n\nContent-Transfer-Encoding: base64\n\n\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n\n3FYlAAAA\n\n\n\n--NMuMz9nt05w80d4+--\n\n\n\n\x1f' != 'From: foo\n\n0' ====================================================================== FAIL: test_getitem (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 144, in test_getitem self.assertEqual(msg['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_items (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 207, in test_items self._check_iteration(self._box.items, do_keys=True, do_values=True) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 231, in _check_iteration self.assertEqual(value['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_iter (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 194, in test_iter do_values=True) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 231, in _check_iteration self.assertEqual(value['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_iteritems (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 203, in test_iteritems do_values=True) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 231, in _check_iteration self.assertEqual(value['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_itervalues (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 189, in test_itervalues do_values=True) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 231, in _check_iteration self.assertEqual(value['from'], 'foo') AssertionError: None != 'foo' ====================================================================== FAIL: test_pop (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 313, in test_pop self.assertEqual(self._box.pop(key0).get_payload(), '0') AssertionError: 'From: foo\n\n\n\n*** EOOH ***\n\nFrom: foo\n\n\n\n0\n\n\x1f\x0c\n\n1,,\n\nFrom: foo\n\n\n\n*** EOOH ***\n\nFrom: foo\n\n\n\n1\n\n\x1f' != '0' ====================================================================== FAIL: test_remove (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 83, in test_remove self._test_remove_or_delitem(self._box.remove) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 99, in _test_remove_or_delitem self.assertEqual(self._box.get_string(key1), self._template % 1) AssertionError: '\nFrom: foo\n\n\n\n*** EOOH ***\n\nFrom: foo\n\n\n\n1\n\n\x1f' != 'From: foo\n\n1' ====================================================================== FAIL: test_set_item (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 272, in test_set_item self._template % 'original 0') AssertionError: '\nFrom: foo\n\n\n\n*** EOOH ***\n\nFrom: foo\n\n\n\noriginal 0\n\n\x1f' != 'From: foo\n\noriginal 0' ====================================================================== FAIL: test_update (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 350, in test_update self._template % 'changed 0') AssertionError: '\nFrom: foo\n\n\n\n*** EOOH ***\n\nFrom: foo\n\n\n\nchanged 0\n\n\x1f\x0c\n\n1,,\n\nReturn-Path: \n\nX-Original-To: gkj+person at localhost\n\nDelivered-To: gkj+person at localhost\n\nReceived: from localhost (localhost [127.0.0.1])\n\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nDelivered-To: gkj at sundance.gregorykjohnson.com\n\nReceived: from localhost [127.0.0.1]\n\n by localhost with POP3 (fetchmail-6.2.5)\n\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nDate: Wed, 13 Jul 2005 17:23:11 -0400\n\nFrom: "Gregory K. Johnson" \n\nTo: gkj at gregorykjohnson.com\n\nSubject: Sample message\n\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\n\nMime-Version: 1.0\n\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\n\nContent-Disposition: inline\n\nUser-Agent: Mutt/1.5.9i\n\n\n\n*** EOOH ***\n\nReturn-Path: \n\nX-Original-To: gkj+person at localhost\n\nDelivered-To: gkj+person at localhost\n\nReceived: from localhost (localhost [127.0.0.1])\n\n by andy.gregorykjohnson.com (Postfix) with ESMTP id 356ED9DD17\n\n for ; Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nDelivered-To: gkj at sundance.gregorykjohnson.com\n\nReceived: from localhost [127.0.0.1]\n\n by localhost with POP3 (fetchmail-6.2.5)\n\n for gkj+person at localhost (single-drop); Wed, 13 Jul 2005 17:23:16 -0400 (EDT)\n\nReceived: from andy.gregorykjohnson.com (andy.gregorykjohnson.com [64.32.235.228])\n\n by sundance.gregorykjohnson.com (Postfix) with ESMTP id 5B056316746\n\n for ; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nReceived: by andy.gregorykjohnson.com (Postfix, from userid 1000)\n\n id 490CD9DD17; Wed, 13 Jul 2005 17:23:11 -0400 (EDT)\n\nDate: Wed, 13 Jul 2005 17:23:11 -0400\n\nFrom: "Gregory K. Johnson" \n\nTo: gkj at gregorykjohnson.com\n\nSubject: Sample message\n\nMessage-ID: <20050713212311.GC4701 at andy.gregorykjohnson.com>\n\nMime-Version: 1.0\n\nContent-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+"\n\nContent-Disposition: inline\n\nUser-Agent: Mutt/1.5.9i\n\n\n\n\n\n--NMuMz9nt05w80d4+\n\nContent-Type: text/plain; charset=us-ascii\n\nContent-Disposition: inline\n\n\n\nThis is a sample message.\n\n\n\n--\n\nGregory K. Johnson\n\n\n\n--NMuMz9nt05w80d4+\n\nContent-Type: application/octet-stream\n\nContent-Disposition: attachment; filename="text.gz"\n\nContent-Transfer-Encoding: base64\n\n\n\nH4sICM2D1UIAA3RleHQAC8nILFYAokSFktSKEoW0zJxUPa7wzJIMhZLyfIWczLzUYj0uAHTs\n\n3FYlAAAA\n\n\n\n--NMuMz9nt05w80d4+--\n\n\n\n\x1f' != 'From: foo\n\nchanged 0' ====================================================================== FAIL: test_values (test.test_mailbox.TestBabyl) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 198, in test_values self._check_iteration(self._box.values, do_keys=False, do_values=True) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_mailbox.py", line 231, in _check_iteration self.assertEqual(value['from'], 'foo') AssertionError: None != 'foo' ====================================================================== ERROR: test_bool (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 136, in test_bool self.assert_(not self._empty_mapping()) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_constructor (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 133, in test_constructor self.assertEqual(self._empty_mapping(), self._empty_mapping()) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_get (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 270, in test_get d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_items (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 156, in test_items d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_keys (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 142, in test_keys d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_len (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 162, in test_len d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_pop (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 293, in test_pop d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_popitem (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 288, in test_popitem d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_read (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 44, in test_read p = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_setdefault (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 284, in test_setdefault d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_update (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 174, in test_update d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_values (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 150, in test_values d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_write (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 92, in test_write p = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_bool (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 136, in test_bool self.assert_(not self._empty_mapping()) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_constructor (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 133, in test_constructor self.assertEqual(self._empty_mapping(), self._empty_mapping()) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_get (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 270, in test_get d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_items (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 156, in test_items d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_keys (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 142, in test_keys d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_len (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 162, in test_len d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_pop (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 293, in test_pop d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_popitem (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 288, in test_popitem d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_read (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 44, in test_read p = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_setdefault (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 284, in test_setdefault d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_update (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 174, in test_update d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_values (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 150, in test_values d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_write (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 92, in test_write p = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_bool (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 136, in test_bool self.assert_(not self._empty_mapping()) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_constructor (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 133, in test_constructor self.assertEqual(self._empty_mapping(), self._empty_mapping()) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_get (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 270, in test_get d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_items (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 156, in test_items d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_keys (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 142, in test_keys d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_len (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 162, in test_len d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_pop (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 293, in test_pop d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_popitem (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 288, in test_popitem d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_read (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 44, in test_read p = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_setdefault (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 284, in test_setdefault d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_update (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 174, in test_update d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_values (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 150, in test_values d = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_write (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\mapping_tests.py", line 92, in test_write p = self._empty_mapping() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 122, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_ascii_file_shelf (test.test_shelve.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 46, in test_ascii_file_shelf s = shelve.open(self.fn, protocol=0) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_binary_file_shelf (test.test_shelve.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 54, in test_binary_file_shelf s = shelve.open(self.fn, protocol=1) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_proto2_file_shelf (test.test_shelve.TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_shelve.py", line 62, in test_proto2_file_shelf s = shelve.open(self.fn, protocol=2) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 217, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\shelve.py", line 201, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\anydbm.py", line 83, in open return mod.open(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') ====================================================================== ERROR: test_whichdb (test.test_whichdb.WhichDBTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_whichdb.py", line 32, in test_whichdb f = module.open(_fname, 'c') File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 435, in hashopen e = _openDBEnv(cachesize) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\bsddb\__init__.py", line 492, in _openDBEnv e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) bsddb.db.DBInvalidArgError: (22, 'Invalid argument') sincerely, -The Buildbot From python-checkins at python.org Fri Feb 1 07:22:48 2008 From: python-checkins at python.org (jeffrey.yasskin) Date: Fri, 1 Feb 2008 07:22:48 +0100 (CET) Subject: [Python-checkins] r60486 - in python/trunk: Doc/library/functions.rst Doc/library/math.rst Lib/test/test_abstract_numbers.py Lib/test/test_builtin.py Lib/test/test_decimal.py Lib/test/test_math.py Lib/test/test_rational.py Modules/mathmodule.c Python/bltinmodule.c Message-ID: <20080201062248.65E2E1E4021@bag.python.org> Author: jeffrey.yasskin Date: Fri Feb 1 07:22:46 2008 New Revision: 60486 Modified: python/trunk/Doc/library/functions.rst python/trunk/Doc/library/math.rst python/trunk/Lib/test/test_abstract_numbers.py python/trunk/Lib/test/test_builtin.py python/trunk/Lib/test/test_decimal.py python/trunk/Lib/test/test_math.py python/trunk/Lib/test/test_rational.py python/trunk/Modules/mathmodule.c python/trunk/Python/bltinmodule.c Log: Move __builtins__.trunc() to math.trunc() per http://mail.python.org/pipermail/python-dev/2008-January/076626.html and issue 1965. Modified: python/trunk/Doc/library/functions.rst ============================================================================== --- python/trunk/Doc/library/functions.rst (original) +++ python/trunk/Doc/library/functions.rst Fri Feb 1 07:22:46 2008 @@ -1145,14 +1145,6 @@ .. versionadded:: 2.2 -.. function:: trunc(x) - - Return the :class:`Real` value *x* truncated to an :class:`Integral` (usually - a long integer). Delegates to ``x.__trunc__()``. - - .. versionadded:: 2.6 - - .. function:: tuple([iterable]) Return a tuple whose items are the same and in the same order as *iterable*'s Modified: python/trunk/Doc/library/math.rst ============================================================================== --- python/trunk/Doc/library/math.rst (original) +++ python/trunk/Doc/library/math.rst Fri Feb 1 07:22:46 2008 @@ -103,6 +103,14 @@ Return the fractional and integer parts of *x*. Both results carry the sign of *x*, and both are floats. + +.. function:: trunc(x) + + Return the :class:`Real` value *x* truncated to an :class:`Integral` (usually + a long integer). Delegates to ``x.__trunc__()``. + + .. versionadded:: 2.6 + Note that :func:`frexp` and :func:`modf` have a different call/return pattern than their C equivalents: they take a single argument and return a pair of values, rather than returning their second return value through an 'output Modified: python/trunk/Lib/test/test_abstract_numbers.py ============================================================================== --- python/trunk/Lib/test/test_abstract_numbers.py (original) +++ python/trunk/Lib/test/test_abstract_numbers.py Fri Feb 1 07:22:46 2008 @@ -1,11 +1,12 @@ """Unit tests for numbers.py.""" +import math +import operator import unittest -from test import test_support -from numbers import Number -from numbers import Exact, Inexact from numbers import Complex, Real, Rational, Integral -import operator +from numbers import Exact, Inexact +from numbers import Number +from test import test_support class TestNumbers(unittest.TestCase): def test_int(self): @@ -49,8 +50,8 @@ self.failUnless(issubclass(complex, Inexact)) c1, c2 = complex(3, 2), complex(4,1) - # XXX: This is not ideal, but see the comment in builtin_trunc(). - self.assertRaises(AttributeError, trunc, c1) + # XXX: This is not ideal, but see the comment in math_trunc(). + self.assertRaises(AttributeError, math.trunc, c1) self.assertRaises(TypeError, float, c1) self.assertRaises(TypeError, int, c1) Modified: python/trunk/Lib/test/test_builtin.py ============================================================================== --- python/trunk/Lib/test/test_builtin.py (original) +++ python/trunk/Lib/test/test_builtin.py Fri Feb 1 07:22:46 2008 @@ -1766,38 +1766,6 @@ raise ValueError self.assertRaises(ValueError, sum, BadSeq()) - def test_trunc(self): - - self.assertEqual(trunc(1), 1) - self.assertEqual(trunc(-1), -1) - self.assertEqual(type(trunc(1)), int) - self.assertEqual(type(trunc(1.5)), int) - self.assertEqual(trunc(1.5), 1) - self.assertEqual(trunc(-1.5), -1) - self.assertEqual(trunc(1.999999), 1) - self.assertEqual(trunc(-1.999999), -1) - self.assertEqual(trunc(-0.999999), -0) - self.assertEqual(trunc(-100.999), -100) - - class TestTrunc(object): - def __trunc__(self): - return 23 - - class TestNoTrunc(object): - pass - - self.assertEqual(trunc(TestTrunc()), 23) - - self.assertRaises(TypeError, trunc) - self.assertRaises(TypeError, trunc, 1, 2) - # XXX: This is not ideal, but see the comment in builtin_trunc(). - self.assertRaises(AttributeError, trunc, TestNoTrunc()) - - t = TestNoTrunc() - t.__trunc__ = lambda *args: args - self.assertEquals((), trunc(t)) - self.assertRaises(TypeError, trunc, t, 0) - def test_tuple(self): self.assertEqual(tuple(()), ()) t0_3 = (0, 1, 2, 3) Modified: python/trunk/Lib/test/test_decimal.py ============================================================================== --- python/trunk/Lib/test/test_decimal.py (original) +++ python/trunk/Lib/test/test_decimal.py Fri Feb 1 07:22:46 2008 @@ -25,10 +25,11 @@ """ from __future__ import with_statement -import unittest import glob +import math import os, sys import pickle, copy +import unittest from decimal import * from test.test_support import (TestSkipped, run_unittest, run_doctest, is_resource_enabled) @@ -1225,7 +1226,7 @@ # should work the same as to_integral in the ROUND_DOWN mode d = Decimal(s) r = d.to_integral(ROUND_DOWN) - self.assertEqual(Decimal(trunc(d)), r) + self.assertEqual(Decimal(math.trunc(d)), r) class ContextAPItests(unittest.TestCase): Modified: python/trunk/Lib/test/test_math.py ============================================================================== --- python/trunk/Lib/test/test_math.py (original) +++ python/trunk/Lib/test/test_math.py Fri Feb 1 07:22:46 2008 @@ -237,6 +237,37 @@ self.ftest('tanh(0)', math.tanh(0), 0) self.ftest('tanh(1)+tanh(-1)', math.tanh(1)+math.tanh(-1), 0) + def test_trunc(self): + self.assertEqual(math.trunc(1), 1) + self.assertEqual(math.trunc(-1), -1) + self.assertEqual(type(math.trunc(1)), int) + self.assertEqual(type(math.trunc(1.5)), int) + self.assertEqual(math.trunc(1.5), 1) + self.assertEqual(math.trunc(-1.5), -1) + self.assertEqual(math.trunc(1.999999), 1) + self.assertEqual(math.trunc(-1.999999), -1) + self.assertEqual(math.trunc(-0.999999), -0) + self.assertEqual(math.trunc(-100.999), -100) + + class TestTrunc(object): + def __trunc__(self): + return 23 + + class TestNoTrunc(object): + pass + + self.assertEqual(math.trunc(TestTrunc()), 23) + + self.assertRaises(TypeError, math.trunc) + self.assertRaises(TypeError, math.trunc, 1, 2) + # XXX: This is not ideal, but see the comment in math_trunc(). + self.assertRaises(AttributeError, math.trunc, TestNoTrunc()) + + t = TestNoTrunc() + t.__trunc__ = lambda *args: args + self.assertEquals((), math.trunc(t)) + self.assertRaises(TypeError, math.trunc, t, 0) + def testCopysign(self): self.assertEqual(math.copysign(1, 42), 1.0) self.assertEqual(math.copysign(0., 42), 0.0) Modified: python/trunk/Lib/test/test_rational.py ============================================================================== --- python/trunk/Lib/test/test_rational.py (original) +++ python/trunk/Lib/test/test_rational.py Fri Feb 1 07:22:46 2008 @@ -195,7 +195,7 @@ self.assertEqual(R.from_float(0.0).approximate(10000), R(0)) def testConversions(self): - self.assertTypedEquals(-1, trunc(R(-11, 10))) + self.assertTypedEquals(-1, math.trunc(R(-11, 10))) self.assertTypedEquals(-1, int(R(-11, 10))) self.assertEquals(False, bool(R(0, 1))) @@ -322,11 +322,11 @@ # Because 10**23 can't be represented exactly as a float: self.assertFalse(R(10**23) == float(10**23)) # The first test demonstrates why these are important. - self.assertFalse(1e23 < float(R(trunc(1e23) + 1))) - self.assertTrue(1e23 < R(trunc(1e23) + 1)) - self.assertFalse(1e23 <= R(trunc(1e23) - 1)) - self.assertTrue(1e23 > R(trunc(1e23) - 1)) - self.assertFalse(1e23 >= R(trunc(1e23) + 1)) + self.assertFalse(1e23 < float(R(math.trunc(1e23) + 1))) + self.assertTrue(1e23 < R(math.trunc(1e23) + 1)) + self.assertFalse(1e23 <= R(math.trunc(1e23) - 1)) + self.assertTrue(1e23 > R(math.trunc(1e23) - 1)) + self.assertFalse(1e23 >= R(math.trunc(1e23) + 1)) def testBigComplexComparisons(self): self.assertFalse(R(10**23) == complex(10**23)) Modified: python/trunk/Modules/mathmodule.c ============================================================================== --- python/trunk/Modules/mathmodule.c (original) +++ python/trunk/Modules/mathmodule.c Fri Feb 1 07:22:46 2008 @@ -155,6 +155,21 @@ "tanh(x)\n\nReturn the hyperbolic tangent of x.") static PyObject * +math_trunc(PyObject *self, PyObject *number) +{ + /* XXX: The py3k branch gets better errors for this by using + _PyType_Lookup(), but since float's mro isn't set in py2.6, + we just use PyObject_CallMethod here. */ + return PyObject_CallMethod(number, "__trunc__", NULL); +} + +PyDoc_STRVAR(math_trunc_doc, +"trunc(x:Real) -> Integral\n" +"\n" +"Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic" +"method."); + +static PyObject * math_frexp(PyObject *self, PyObject *arg) { int i; @@ -377,6 +392,7 @@ {"sqrt", math_sqrt, METH_O, math_sqrt_doc}, {"tan", math_tan, METH_O, math_tan_doc}, {"tanh", math_tanh, METH_O, math_tanh_doc}, + {"trunc", math_trunc, METH_O, math_trunc_doc}, {NULL, NULL} /* sentinel */ }; Modified: python/trunk/Python/bltinmodule.c ============================================================================== --- python/trunk/Python/bltinmodule.c (original) +++ python/trunk/Python/bltinmodule.c Fri Feb 1 07:22:46 2008 @@ -2044,20 +2044,6 @@ Without arguments, equivalent to locals().\n\ With an argument, equivalent to object.__dict__."); -static PyObject * -builtin_trunc(PyObject *self, PyObject *number) -{ - /* XXX: The py3k branch gets better errors for this by using - _PyType_Lookup(), but since float's mro isn't set in py2.6, - we just use PyObject_CallMethod here. */ - return PyObject_CallMethod(number, "__trunc__", NULL); -} - -PyDoc_STRVAR(trunc_doc, -"trunc(Real) -> Integral\n\ -\n\ -returns the integral closest to x between 0 and x."); - static PyObject* builtin_sum(PyObject *self, PyObject *args) @@ -2406,7 +2392,6 @@ {"unichr", builtin_unichr, METH_VARARGS, unichr_doc}, #endif {"vars", builtin_vars, METH_VARARGS, vars_doc}, - {"trunc", builtin_trunc, METH_O, trunc_doc}, {"zip", builtin_zip, METH_VARARGS, zip_doc}, {NULL, NULL}, }; From buildbot at python.org Fri Feb 1 07:49:39 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 06:49:39 +0000 Subject: [Python-checkins] buildbot failure in ARM Linux EABI trunk Message-ID: <20080201064939.6B1231E4015@bag.python.org> The Buildbot has detected a new failure of ARM Linux EABI trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ARM%20Linux%20EABI%20trunk/builds/30 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-linux-armeabi Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: jeffrey.yasskin BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Fri Feb 1 08:05:46 2008 From: python-checkins at python.org (jeffrey.yasskin) Date: Fri, 1 Feb 2008 08:05:46 +0100 (CET) Subject: [Python-checkins] r60487 - in python/trunk/Lib: rational.py test/test_rational.py Message-ID: <20080201070546.EA6C51E4012@bag.python.org> Author: jeffrey.yasskin Date: Fri Feb 1 08:05:46 2008 New Revision: 60487 Modified: python/trunk/Lib/rational.py python/trunk/Lib/test/test_rational.py Log: Roll back r60248. It's useful to encourage users not to change Rational instances. Modified: python/trunk/Lib/rational.py ============================================================================== --- python/trunk/Lib/rational.py (original) +++ python/trunk/Lib/rational.py Fri Feb 1 08:05:46 2008 @@ -43,7 +43,7 @@ """ - __slots__ = ('numerator', 'denominator') + __slots__ = ('_numerator', '_denominator') # We're immutable, so use __new__ not __init__ def __new__(cls, numerator=0, denominator=1): @@ -93,8 +93,8 @@ raise ZeroDivisionError('Rational(%s, 0)' % numerator) g = gcd(numerator, denominator) - self.numerator = int(numerator // g) - self.denominator = int(denominator // g) + self._numerator = int(numerator // g) + self._denominator = int(denominator // g) return self @classmethod @@ -168,6 +168,14 @@ result = new return result + @property + def numerator(a): + return a._numerator + + @property + def denominator(a): + return a._denominator + def __repr__(self): """repr(self)""" return ('Rational(%r,%r)' % (self.numerator, self.denominator)) Modified: python/trunk/Lib/test/test_rational.py ============================================================================== --- python/trunk/Lib/test/test_rational.py (original) +++ python/trunk/Lib/test/test_rational.py Fri Feb 1 08:05:46 2008 @@ -119,6 +119,17 @@ r.__init__(2, 15) self.assertEquals((7, 3), _components(r)) + self.assertRaises(AttributeError, setattr, r, 'numerator', 12) + self.assertRaises(AttributeError, setattr, r, 'denominator', 6) + self.assertEquals((7, 3), _components(r)) + + # But if you _really_ need to: + r._numerator = 4 + r._denominator = 2 + self.assertEquals((4, 2), _components(r)) + # Which breaks some important operations: + self.assertNotEquals(R(4, 2), r) + def testFromFloat(self): self.assertRaisesMessage( TypeError, "Rational.from_float() only takes floats, not 3 (int)", From python-checkins at python.org Fri Feb 1 08:22:59 2008 From: python-checkins at python.org (neal.norwitz) Date: Fri, 1 Feb 2008 08:22:59 +0100 (CET) Subject: [Python-checkins] r60488 - python/trunk/Python/marshal.c Message-ID: <20080201072259.627CC1E4012@bag.python.org> Author: neal.norwitz Date: Fri Feb 1 08:22:59 2008 New Revision: 60488 Modified: python/trunk/Python/marshal.c Log: Fix refleak Modified: python/trunk/Python/marshal.c ============================================================================== --- python/trunk/Python/marshal.c (original) +++ python/trunk/Python/marshal.c Fri Feb 1 08:22:59 2008 @@ -881,6 +881,7 @@ v = NULL; break; } + Py_DECREF(v2); } retval = v; break; From buildbot at python.org Fri Feb 1 09:26:00 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 08:26:00 +0000 Subject: [Python-checkins] buildbot failure in hppa Ubuntu trunk Message-ID: <20080201082600.F11A61E4012@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%20Ubuntu%20trunk/builds/576 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-hppa Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: jeffrey.yasskin,neal.norwitz BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Fri Feb 1 09:51:34 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 08:51:34 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 Message-ID: <20080201085134.886971E4012@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.0/builds/517 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: christian.heimes BUILD FAILED: failed test Excerpt from the test logfile: 5 tests failed: test_codecmaps_cn test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_normalization Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_codecmaps_cn.py", line 30, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 113] No route to host Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_codecmaps_jp.py", line 64, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 113] No route to host Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_codecmaps_kr.py", line 41, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 113] No route to host Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_codecmaps_tw.py", line 28, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 113] No route to host Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_normalization.py", line 92, in test_main open_urlresource(TESTDATAURL) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-debian-ppc/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 113] No route to host make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 1 10:40:31 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 09:40:31 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.0 Message-ID: <20080201094031.BAC011E4012@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.0/builds/498 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: christian.heimes BUILD FAILED: failed test Excerpt from the test logfile: 5 tests failed: test_codecmaps_cn test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_normalization Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_codecmaps_cn.py", line 30, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 110] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_codecmaps_jp.py", line 64, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 110] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_codecmaps_kr.py", line 41, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 110] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_codecmaps_tw.py", line 28, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 110] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_normalization.py", line 92, in test_main open_urlresource(TESTDATAURL) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-debian-ia64/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 110] Connection timed out make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 1 11:00:46 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 10:00:46 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20080201100046.7747E1E4012@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/546 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: christian.heimes BUILD FAILED: failed test Excerpt from the test logfile: 5 tests failed: test_codecmaps_cn test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_normalization Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_codecmaps_cn.py", line 30, in test_main test_support.run_unittest(__name__) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 704, in send self.connect() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 688, in connect self.timeout) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 145] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_codecmaps_jp.py", line 64, in test_main test_support.run_unittest(__name__) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 704, in send self.connect() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 688, in connect self.timeout) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 145] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_codecmaps_kr.py", line 41, in test_main test_support.run_unittest(__name__) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 704, in send self.connect() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 688, in connect self.timeout) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 145] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_codecmaps_tw.py", line 28, in test_main test_support.run_unittest(__name__) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 704, in send self.connect() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 688, in connect self.timeout) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 145] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_normalization.py", line 92, in test_main open_urlresource(TESTDATAURL) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 704, in send self.connect() File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/httplib.py", line 688, in connect self.timeout) File "/opt/users/buildbot/slave/3.0.loewis-sun/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 145] Connection timed out sincerely, -The Buildbot From buildbot at python.org Fri Feb 1 11:04:02 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 10:04:02 +0000 Subject: [Python-checkins] buildbot failure in g4 osx.4 3.0 Message-ID: <20080201100402.5E6D21E4012@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/g4%20osx.4%203.0/builds/494 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: psf-g4 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: christian.heimes BUILD FAILED: failed test Excerpt from the test logfile: 5 tests failed: test_codecmaps_cn test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_normalization Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_codecmaps_cn.py", line 30, in test_main test_support.run_unittest(__name__) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 704, in send self.connect() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 688, in connect self.timeout) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 60] Operation timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_codecmaps_jp.py", line 64, in test_main test_support.run_unittest(__name__) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 704, in send self.connect() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 688, in connect self.timeout) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 60] Operation timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_codecmaps_kr.py", line 41, in test_main test_support.run_unittest(__name__) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 704, in send self.connect() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 688, in connect self.timeout) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 60] Operation timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_codecmaps_tw.py", line 28, in test_main test_support.run_unittest(__name__) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 704, in send self.connect() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 688, in connect self.timeout) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 60] Operation timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_normalization.py", line 92, in test_main open_urlresource(TESTDATAURL) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 704, in send self.connect() File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/httplib.py", line 688, in connect self.timeout) File "/Users/buildslave/bb/3.0.psf-g4/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 60] Operation timed out make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 1 11:08:40 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 10:08:40 +0000 Subject: [Python-checkins] buildbot failure in hppa Ubuntu 3.0 Message-ID: <20080201100840.2DF031E4012@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%20Ubuntu%203.0/builds/481 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-hppa Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: christian.heimes BUILD FAILED: failed test Excerpt from the test logfile: 5 tests failed: test_codecmaps_cn test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_normalization Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_codecmaps_cn.py", line 30, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 238] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_codecmaps_jp.py", line 64, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 238] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_codecmaps_kr.py", line 41, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 238] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_codecmaps_tw.py", line 28, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 238] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_normalization.py", line 92, in test_main open_urlresource(TESTDATAURL) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-ubuntu-hppa/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 238] Connection timed out make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri Feb 1 11:30:57 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 10:30:57 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu 3.0 Message-ID: <20080201103057.B42031E4012@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%203.0/builds/67 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: christian.heimes BUILD FAILED: failed test Excerpt from the test logfile: 5 tests failed: test_codecmaps_cn test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_normalization Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_codecmaps_cn.py", line 30, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 60] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_codecmaps_jp.py", line 64, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 60] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_codecmaps_kr.py", line 41, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 60] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_codecmaps_tw.py", line 28, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 60] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_normalization.py", line 92, in test_main open_urlresource(TESTDATAURL) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea/3.0.klose-ubuntu-sparc/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 60] Connection timed out make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Feb 1 11:53:24 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 1 Feb 2008 11:53:24 +0100 (CET) Subject: [Python-checkins] r60490 - doctools/trunk/sphinx/texinputs/howto.cls doctools/trunk/sphinx/texinputs/manual.cls doctools/trunk/sphinx/texinputs/sphinx.sty Message-ID: <20080201105324.CAF551E4015@bag.python.org> Author: georg.brandl Date: Fri Feb 1 11:53:24 2008 New Revision: 60490 Modified: doctools/trunk/sphinx/texinputs/howto.cls doctools/trunk/sphinx/texinputs/manual.cls doctools/trunk/sphinx/texinputs/sphinx.sty Log: Put doc title and release in the header. Modified: doctools/trunk/sphinx/texinputs/howto.cls ============================================================================== --- doctools/trunk/sphinx/texinputs/howto.cls (original) +++ doctools/trunk/sphinx/texinputs/howto.cls Fri Feb 1 11:53:24 2008 @@ -78,7 +78,7 @@ \@thanks \setcounter{footnote}{0} \let\thanks\relax\let\maketitle\relax - \gdef\@thanks{}\gdef\@author{}\gdef\@title{} + %\gdef\@thanks{}\gdef\@author{}\gdef\@title{} } Modified: doctools/trunk/sphinx/texinputs/manual.cls ============================================================================== --- doctools/trunk/sphinx/texinputs/manual.cls (original) +++ doctools/trunk/sphinx/texinputs/manual.cls Fri Feb 1 11:53:24 2008 @@ -96,7 +96,7 @@ \end{titlepage}% \setcounter{footnote}{0}% \let\thanks\relax\let\maketitle\relax - \gdef\@thanks{}\gdef\@author{}\gdef\@title{} + %\gdef\@thanks{}\gdef\@author{}\gdef\@title{} } Modified: doctools/trunk/sphinx/texinputs/sphinx.sty ============================================================================== --- doctools/trunk/sphinx/texinputs/sphinx.sty (original) +++ doctools/trunk/sphinx/texinputs/sphinx.sty Fri Feb 1 11:53:24 2008 @@ -179,7 +179,8 @@ \fancyfoot[LE,RO]{{\py at HeaderFamily\thepage}} \fancyfoot[LO]{{\py at HeaderFamily\nouppercase{\rightmark}}} \fancyfoot[RE]{{\py at HeaderFamily\nouppercase{\leftmark}}} - \renewcommand{\headrulewidth}{0pt} + \fancyhead[LE,RO]{{\py at HeaderFamily \@title, \py at release}} + \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0.4pt} } % Update the plain style so we get the page number & footer line, From buildbot at python.org Fri Feb 1 12:43:37 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 11:43:37 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 3.0 Message-ID: <20080201114338.0B0C21E4012@bag.python.org> The Buildbot has detected a new failure of sparc Debian 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%203.0/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: christian.heimes BUILD FAILED: failed test Excerpt from the test logfile: 5 tests failed: test_codecmaps_cn test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_normalization Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_codecmaps_cn.py", line 30, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 60] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_codecmaps_jp.py", line 64, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 60] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_codecmaps_kr.py", line 41, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 60] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_codecmaps_tw.py", line 28, in test_main test_support.run_unittest(__name__) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_support.py", line 542, in run_unittest suite.addTest(unittest.findTestCases(sys.modules[cls])) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 636, in findTestCases return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 540, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 532, in loadTestsFromTestCase return self.suiteClass(map(testCaseClass, testCaseNames)) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 387, in __init__ self.addTests(tests) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/unittest.py", line 423, in addTests for test in tests: File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_multibytecodec_support.py", line 279, in __init__ self.open_mapping_file() # test it to report the error early File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_multibytecodec_support.py", line 282, in open_mapping_file return test_support.open_urlresource(self.mapfileurl) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 60] Connection timed out Traceback (most recent call last): File "./Lib/test/regrtest.py", line 596, in runtest_inner indirect_test() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_normalization.py", line 92, in test_main open_urlresource(TESTDATAURL) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/test/test_support.py", line 268, in open_urlresource fn, _ = urllib.urlretrieve(url, filename) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 88, in urlretrieve return _urlopener.retrieve(url, filename, reporthook, data) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 230, in retrieve fp = self.open(url, data) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 202, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 198, in open return getattr(self, name)(url) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 372, in open_http return self._open_generic_http(httplib.HTTPConnection, url, data) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/urllib.py", line 351, in _open_generic_http http_conn.request("GET", selector, headers=headers) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 884, in request self._send_request(method, url, body, headers) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 921, in _send_request self.endheaders() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 879, in endheaders self._send_output() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 745, in _send_output self.send(msg) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 704, in send self.connect() File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/httplib.py", line 688, in connect self.timeout) File "/home/pybot/buildarea-sid/3.0.klose-debian-sparc/build/Lib/socket.py", line 294, in create_connection raise error(msg) IOError: [Errno socket error] [Errno 60] Connection timed out make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Feb 1 12:59:09 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 1 Feb 2008 12:59:09 +0100 (CET) Subject: [Python-checkins] r60493 - python/trunk/Doc/library/socket.rst Message-ID: <20080201115909.309B01E4015@bag.python.org> Author: georg.brandl Date: Fri Feb 1 12:59:08 2008 New Revision: 60493 Modified: python/trunk/Doc/library/socket.rst Log: Update IPv6 RFC number. Modified: python/trunk/Doc/library/socket.rst ============================================================================== --- python/trunk/Doc/library/socket.rst (original) +++ python/trunk/Doc/library/socket.rst Fri Feb 1 12:59:08 2008 @@ -23,7 +23,7 @@ socket-related system calls are also a valuable source of information on the details of socket semantics. For Unix, refer to the manual pages; for Windows, see the WinSock (or Winsock 2) specification. For IPv6-ready APIs, readers may -want to refer to :rfc:`2553` titled Basic Socket Interface Extensions for IPv6. +want to refer to :rfc:`3493` titled Basic Socket Interface Extensions for IPv6. .. index:: object: socket From buildbot at python.org Fri Feb 1 14:16:47 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 13:16:47 +0000 Subject: [Python-checkins] buildbot failure in 3.0.msi Message-ID: <20080201131647.EF5581E4015@bag.python.org> The Buildbot has detected a new failure of 3.0.msi. Full details are available at: http://www.python.org/dev/buildbot/all/3.0.msi/builds/149 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: The Nightly scheduler named '3.0.msi' triggered this build Build Source Stamp: HEAD Blamelist: BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Fri Feb 1 15:05:06 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 14:05:06 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian trunk Message-ID: <20080201140506.91B2D1E4018@bag.python.org> The Buildbot has detected a new failure of sparc Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%20trunk/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: jeffrey.yasskin,neal.norwitz BUILD FAILED: failed test Excerpt from the test logfile: 5 tests failed: test_codecmaps_cn test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_normalization make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri Feb 1 16:49:59 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 1 Feb 2008 16:49:59 +0100 (CET) Subject: [Python-checkins] r60496 - doctools/trunk/sphinx/builder.py Message-ID: <20080201154959.3DEC41E4021@bag.python.org> Author: georg.brandl Date: Fri Feb 1 16:49:58 2008 New Revision: 60496 Modified: doctools/trunk/sphinx/builder.py Log: Add link checker builder, written for GHOP by Thomas Lamb. Modified: doctools/trunk/sphinx/builder.py ============================================================================== --- doctools/trunk/sphinx/builder.py (original) +++ doctools/trunk/sphinx/builder.py Fri Feb 1 16:49:58 2008 @@ -5,7 +5,7 @@ Builder classes for different output formats. - :copyright: 2007-2008 by Georg Brandl. + :copyright: 2007-2008 by Georg Brandl, Thomas Lamb. :license: BSD. """ @@ -13,9 +13,11 @@ import time import codecs import shutil +import socket import cPickle as pickle from os import path from cgi import escape +from urllib2 import urlopen, HTTPError from docutils import nodes from docutils.io import StringOutput, FileOutput, DocTreeInput @@ -31,7 +33,7 @@ from sphinx.latexwriter import LaTeXWriter from sphinx.environment import BuildEnvironment, NoUri from sphinx.highlighting import pygments, get_stylesheet -from sphinx.util.console import bold, purple, green +from sphinx.util.console import bold, purple, green, red, darkgreen # side effect: registers roles and directives from sphinx import roles @@ -678,21 +680,21 @@ destination = FileOutput( destination_path=path.join(self.outdir, targetname), encoding='utf-8') - print "processing", targetname + "...", + self.info("processing " + targetname + "... ", nonl=1) doctree = self.assemble_doctree( sourcename, appendices=(docclass == 'manual') and appendices or []) - print "writing...", + self.info("writing... ", nonl=1) doctree.settings = docsettings doctree.settings.author = author doctree.settings.filename = sourcename doctree.settings.docclass = docclass docwriter.write(doctree, destination) - print "done" + self.info("done") def assemble_doctree(self, indexfile, appendices): self.filenames = set([indexfile, 'glossary.rst', 'about.rst', 'license.rst', 'copyright.rst']) - print green(indexfile), + self.info(green(indexfile) + " ", nonl=1) def process_tree(filename, tree): tree = tree.deepcopy() for toctreenode in tree.traverse(addnodes.toctree): @@ -700,7 +702,7 @@ includefiles = map(str, toctreenode['includefiles']) for includefile in includefiles: try: - print green(includefile), + self.info(green(includefile) + " ", nonl=1) subtree = process_tree(includefile, self.env.get_doctree(includefile)) self.filenames.add(includefile) @@ -713,8 +715,8 @@ return tree largetree = process_tree(indexfile, self.env.get_doctree(indexfile)) largetree.extend(appendices) - print - print "resolving references..." + self.info() + self.info("resolving references...") self.env.resolve_references(largetree, indexfile, self) # resolve :ref:s to distant tex files -- we can't add a cross-reference, # but append the document name @@ -856,10 +858,114 @@ pass +class CheckExternalLinksBuilder(Builder): + """ + Checks for broken external links. + """ + name = 'linkcheck' + + def init(self): + self.good = set() + self.broken = {} + self.redirected = {} + # set a timeout for non-responding servers + socket.setdefaulttimeout(5.0) + # create output file + open(path.join(self.outdir, 'output.txt'), 'w').close() + + def get_target_uri(self, source_filename, typ=None): + return '' + + def get_outdated_files(self): + return self.env.all_files + + def prepare_writing(self, filenames): + return + + def write_file(self, filename, doctree): + self.info() + for node in doctree.traverse(nodes.reference): + try: + self.check(node, filename) + except KeyError: + continue + return + + def check(self, node, filename): + uri = node['refuri'] + + if '#' in uri: + uri = uri.split('#')[0] + + if uri in self.good: + return + + if uri[0:5] == 'http:' or uri[0:6] == 'https:': + self.info(uri, nonl=1) + lineno = None + while lineno is None and node: + node = node.parent + lineno = node.line + + if uri in self.broken: + (r, s) = self.broken[uri] + elif uri in self.redirected: + (r, s) = self.redirected[uri] + else: + (r, s) = self.resolve(uri) + + if r == 0: + self.info(' - ' + darkgreen('working')) + self.good.add(uri) + elif r == 2: + self.info(' - ' + red('broken: ') + s) + self.broken[uri] = (r, s) + self.write_entry('broken', filename, lineno, uri + ': ' + s) + else: + self.info(' - ' + purple('redirected') + ' to ' + s) + self.redirected[uri] = (r, s) + self.write_entry('redirected', filename, lineno, uri + ' to ' + s) + + elif len(uri) == 0 or uri[0:7] == 'mailto:' or uri[0:4] == 'ftp:': + return + else: + self.info(uri + ' - ' + red('malformed!')) + self.write_entry('malformed', filename, lineno, uri) + + return + + def write_entry(self, what, filename, line, uri): + output = open(path.join(self.outdir, 'output.txt'), 'a') + output.write("%s:%s [%s] %s\n" % (filename, line, what, uri)) + output.close() + + def resolve(self, uri): + try: + f = urlopen(uri) + f.close() + except HTTPError, err: + if err.code == 403 and uri.startwith('http://en.wikipedia.org/'): + # Wikipedia blocks requests from urllib User-Agent + return 0 + return (2, str(err)) + except Exception, err: + return (2, str(err)) + if f.url.rstrip('/') == uri.rstrip('/'): + return (0, 0) + else: + return (1, f.url) + + def finish(self): + return + + + + builtin_builders = { 'html': StandaloneHTMLBuilder, 'web': WebHTMLBuilder, 'htmlhelp': HTMLHelpBuilder, 'latex': LaTeXBuilder, 'changes': ChangesBuilder, + 'linkcheck': CheckExternalLinksBuilder, } From python-checkins at python.org Fri Feb 1 16:50:16 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 1 Feb 2008 16:50:16 +0100 (CET) Subject: [Python-checkins] r60497 - python/trunk/Doc/Makefile python/trunk/Doc/README.txt Message-ID: <20080201155016.32B141E4034@bag.python.org> Author: georg.brandl Date: Fri Feb 1 16:50:15 2008 New Revision: 60497 Modified: python/trunk/Doc/Makefile python/trunk/Doc/README.txt Log: Add link checker builder, written for GHOP by Thomas Lamb. Modified: python/trunk/Doc/Makefile ============================================================================== --- python/trunk/Doc/Makefile (original) +++ python/trunk/Doc/Makefile Fri Feb 1 16:50:15 2008 @@ -16,11 +16,12 @@ help: @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " web to make file usable by Sphinx.web" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " changes to make an overview over all changed/added/deprecated items" + @echo " html to make standalone HTML files" + @echo " web to make file usable by Sphinx.web" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " changes to make an overview over all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" checkout: @if [ ! -d tools/sphinx ]; then \ @@ -71,6 +72,11 @@ changes: build @echo "The overview file is in build/changes." +linkcheck: BUILDER = linkcheck +linkcheck: build + @echo "Link check complete; look for any errors in the above or in" \ + "build/$(BUILDER)/output.txt" + clean: -rm -rf build/* -rm -rf tools/sphinx Modified: python/trunk/Doc/README.txt ============================================================================== --- python/trunk/Doc/README.txt (original) +++ python/trunk/Doc/README.txt Fri Feb 1 16:50:15 2008 @@ -50,6 +50,10 @@ * "latex", which builds LaTeX source files that can be run with "pdflatex" to produce PDF documents. + + * "linkcheck", which checks all external references to see whether they are + broken, redirected or malformed, and outputs this information to stdout + as well as a plain-text (.txt) file. * "changes", which builds an overview over all versionadded/versionchanged/ deprecated items in the current version. This is meant as a help for the From buildbot at python.org Fri Feb 1 18:51:59 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 17:51:59 +0000 Subject: [Python-checkins] buildbot failure in ARM Linux EABI 3.0 Message-ID: <20080201175159.DC6D11E400A@bag.python.org> The Buildbot has detected a new failure of ARM Linux EABI 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/ARM%20Linux%20EABI%203.0/builds/26 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-linux-armeabi Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: bill.janssen BUILD FAILED: failed compile sincerely, -The Buildbot From python-checkins at python.org Fri Feb 1 19:08:09 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 1 Feb 2008 19:08:09 +0100 (CET) Subject: [Python-checkins] r60500 - python/trunk/Doc/builddoc.bat python/trunk/Doc/make.bat Message-ID: <20080201180809.D58D61E400A@bag.python.org> Author: georg.brandl Date: Fri Feb 1 19:08:09 2008 New Revision: 60500 Added: python/trunk/Doc/make.bat - copied unchanged from r60349, python/trunk/Doc/builddoc.bat Removed: python/trunk/Doc/builddoc.bat Log: Rename batch file. Deleted: /python/trunk/Doc/builddoc.bat ============================================================================== --- /python/trunk/Doc/builddoc.bat Fri Feb 1 19:08:09 2008 +++ (empty file) @@ -1,52 +0,0 @@ - at echo off -setlocal - -set SVNROOT=http://svn.python.org/projects -if "%PYTHON%" EQU "" set PYTHON=python25 - -if "%1" EQU "" goto help -if "%1" EQU "html" goto build -if "%1" EQU "htmlhelp" goto build -if "%1" EQU "web" goto build -if "%1" EQU "webrun" goto webrun -if "%1" EQU "checkout" goto checkout -if "%1" EQU "update" goto update - -:help -echo HELP -echo. -echo builddoc checkout -echo builddoc update -echo builddoc html -echo builddoc htmlhelp -echo builddoc web -echo builddoc webrun -echo. -goto end - -:checkout -svn co %SVNROOT%/doctools/trunk/sphinx tools/sphinx -svn co %SVNROOT%/external/docutils-0.4/docutils tools/docutils -svn co %SVNROOT%/external/Pygments-0.9/pygments tools/pygments -goto end - -:update -svn update tools/sphinx -svn update tools/docutils -svn update tools/pygments -goto end - -:build -if not exist build mkdir build -if not exist build\%1 mkdir build\%1 -if not exist build\doctrees mkdir build\doctrees -cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%1 -if "%1" EQU "htmlhelp" "%ProgramFiles%\HTML Help Workshop\hhc.exe" build\htmlhelp\pydoc.hhp -goto end - -:webrun -set PYTHONPATH=tools -%PYTHON% -m sphinx.web build\web -goto end - -:end From python-checkins at python.org Fri Feb 1 19:49:27 2008 From: python-checkins at python.org (christian.heimes) Date: Fri, 1 Feb 2008 19:49:27 +0100 (CET) Subject: [Python-checkins] r60504 - python/trunk/Modules/posixmodule.c Message-ID: <20080201184927.46EB21E400A@bag.python.org> Author: christian.heimes Date: Fri Feb 1 19:49:26 2008 New Revision: 60504 Modified: python/trunk/Modules/posixmodule.c Log: More int -> pid_t. Modified: python/trunk/Modules/posixmodule.c ============================================================================== --- python/trunk/Modules/posixmodule.c (original) +++ python/trunk/Modules/posixmodule.c Fri Feb 1 19:49:26 2008 @@ -3868,7 +3868,7 @@ static PyObject * posix_getppid(PyObject *self, PyObject *noargs) { - return PyInt_FromLong((long)getppid()); + return PyInt_FromLong(getppid()); } #endif @@ -3923,7 +3923,8 @@ static PyObject * posix_kill(PyObject *self, PyObject *args) { - int pid, sig; + pid_t pid; + int sig; if (!PyArg_ParseTuple(args, "ii:kill", &pid, &sig)) return NULL; #if defined(PYOS_OS2) && !defined(PYCC_GCC) @@ -4267,7 +4268,8 @@ struct file_ref stdio[3]; struct pipe_ref p_fd[3]; FILE *p_s[3]; - int file_count, i, pipe_err, pipe_pid; + int file_count, i, pipe_err; + pid_t pipe_pid; char *shell, *sh_name, *opt, *rd_mode, *wr_mode; PyObject *f, *p_f[3]; @@ -4595,7 +4597,7 @@ { int result; int exit_code; - int pipe_pid; + pid_t pipe_pid; PyObject *procObj, *pidObj, *intObj, *fileObj; int file_count; #ifdef WITH_THREAD @@ -5643,7 +5645,7 @@ #if defined(HAVE_WAIT3) || defined(HAVE_WAIT4) static PyObject * -wait_helper(int pid, int status, struct rusage *ru) +wait_helper(pid_t pid, int status, struct rusage *ru) { PyObject *result; static PyObject *struct_rusage; @@ -5709,7 +5711,8 @@ static PyObject * posix_wait3(PyObject *self, PyObject *args) { - int pid, options; + pid_t pid; + int options; struct rusage ru; WAIT_TYPE status; WAIT_STATUS_INT(status) = 0; @@ -5733,7 +5736,8 @@ static PyObject * posix_wait4(PyObject *self, PyObject *args) { - int pid, options; + pid_t pid; + int options; struct rusage ru; WAIT_TYPE status; WAIT_STATUS_INT(status) = 0; @@ -5757,7 +5761,8 @@ static PyObject * posix_waitpid(PyObject *self, PyObject *args) { - int pid, options; + pid_t pid; + int options; WAIT_TYPE status; WAIT_STATUS_INT(status) = 0; @@ -5806,7 +5811,7 @@ static PyObject * posix_wait(PyObject *self, PyObject *noargs) { - int pid; + pid_t pid; WAIT_TYPE status; WAIT_STATUS_INT(status) = 0; @@ -6007,7 +6012,8 @@ static PyObject * posix_getsid(PyObject *self, PyObject *args) { - int pid, sid; + pid_t pid; + int sid; if (!PyArg_ParseTuple(args, "i:getsid", &pid)) return NULL; sid = getsid(pid); @@ -6041,7 +6047,8 @@ static PyObject * posix_setpgid(PyObject *self, PyObject *args) { - int pid, pgrp; + pid_t pid; + int pgrp; if (!PyArg_ParseTuple(args, "ii:setpgid", &pid, &pgrp)) return NULL; if (setpgid(pid, pgrp) < 0) From stackless-checkins-bounces at stackless.com Fri Feb 1 19:34:02 2008 From: stackless-checkins-bounces at stackless.com (stackless-checkins-bounces at stackless.com) Date: Fri, 01 Feb 2008 19:34:02 +0100 Subject: [Python-checkins] Your message to Stackless-checkins awaits moderator approval Message-ID: Your mail to 'Stackless-checkins' with the subject r60502 - stackless/branches/release25-maint/configure Is being held until the list moderator can review it for approval. The reason it is being held: Message body is too big: 827997 bytes with a limit of 500 KB Either the message will get posted to the list, or you will receive notification of the moderator's decision. If you would like to cancel this posting, please visit the following URL: http://www.stackless.com/mailman/confirm/stackless-checkins/16ad6b50ef247634c3de1699e8fbd0b263633bda From theller at ctypes.org Fri Feb 1 20:10:07 2008 From: theller at ctypes.org (Thomas Heller) Date: Fri, 01 Feb 2008 20:10:07 +0100 Subject: [Python-checkins] r60504 - python/trunk/Modules/posixmodule.c In-Reply-To: <20080201184927.46EB21E400A@bag.python.org> References: <20080201184927.46EB21E400A@bag.python.org> Message-ID: > Author: christian.heimes > Date: Fri Feb 1 19:49:26 2008 > New Revision: 60504 > > Modified: > python/trunk/Modules/posixmodule.c > Log: > More int -> pid_t. > > - int pid, sig; > + pid_t pid; > + int sig; > if (!PyArg_ParseTuple(args, "ii:kill", &pid, &sig)) > return NULL; Hm, what happens if sizeof(pid_t) != sizeof(int) ? From lists at cheimes.de Fri Feb 1 20:21:34 2008 From: lists at cheimes.de (Christian Heimes) Date: Fri, 01 Feb 2008 20:21:34 +0100 Subject: [Python-checkins] r60504 - python/trunk/Modules/posixmodule.c In-Reply-To: References: <20080201184927.46EB21E400A@bag.python.org> Message-ID: <47A3713E.3090009@cheimes.de> Thomas Heller wrote: > Hm, what happens if sizeof(pid_t) != sizeof(int) ? The problem is discussed in issue #1983. Python may need to get a format string for pid_t and PyInt_FromPid_t() / PyInt_AsPid_t(). From python-checkins at python.org Fri Feb 1 20:24:02 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 1 Feb 2008 20:24:02 +0100 (CET) Subject: [Python-checkins] r60507 - python/trunk/Doc/Makefile Message-ID: <20080201192402.2A75A1E400A@bag.python.org> Author: georg.brandl Date: Fri Feb 1 20:24:01 2008 New Revision: 60507 Modified: python/trunk/Doc/Makefile Log: Wording nit. Modified: python/trunk/Doc/Makefile ============================================================================== --- python/trunk/Doc/Makefile (original) +++ python/trunk/Doc/Makefile Fri Feb 1 20:24:01 2008 @@ -74,8 +74,8 @@ linkcheck: BUILDER = linkcheck linkcheck: build - @echo "Link check complete; look for any errors in the above or in" \ - "build/$(BUILDER)/output.txt" + @echo "Link check complete; look for any errors in the above output "\ + "or in build/$(BUILDER)/output.txt" clean: -rm -rf build/* From python-checkins at python.org Fri Feb 1 21:44:17 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 1 Feb 2008 21:44:17 +0100 (CET) Subject: [Python-checkins] r60509 - in doctools/trunk: HACKING README sphinx-build.py sphinx/addons/ifconfig.py sphinx/application.py sphinx/builder.py sphinx/config.py sphinx/directives.py sphinx/environment.py sphinx/htmlhelp.py sphinx/latexwriter.py sphinx/templates/changes/versionchanges.html sphinx/templates/layout.html sphinx/util/__init__.py sphinx/web/application.py Message-ID: <20080201204417.CE4641E400A@bag.python.org> Author: georg.brandl Date: Fri Feb 1 21:44:17 2008 New Revision: 60509 Modified: doctools/trunk/HACKING doctools/trunk/README doctools/trunk/sphinx-build.py doctools/trunk/sphinx/addons/ifconfig.py doctools/trunk/sphinx/application.py doctools/trunk/sphinx/builder.py doctools/trunk/sphinx/config.py doctools/trunk/sphinx/directives.py doctools/trunk/sphinx/environment.py doctools/trunk/sphinx/htmlhelp.py doctools/trunk/sphinx/latexwriter.py doctools/trunk/sphinx/templates/changes/versionchanges.html doctools/trunk/sphinx/templates/layout.html doctools/trunk/sphinx/util/__init__.py doctools/trunk/sphinx/web/application.py Log: More refactoring, this time allowing different file extensions and a different master file. Also fix environment warning reporting and improve handling of error conditions. Modified: doctools/trunk/HACKING ============================================================================== --- doctools/trunk/HACKING (original) +++ doctools/trunk/HACKING Fri Feb 1 21:44:17 2008 @@ -6,6 +6,8 @@ This document tries to give you a cursory overview of the doctools code. +TODO: update this. + Dependencies ------------ Modified: doctools/trunk/README ============================================================================== --- doctools/trunk/README (original) +++ doctools/trunk/README Fri Feb 1 21:44:17 2008 @@ -4,6 +4,8 @@ FIXME: This is already outdated since the conversion has happened and the reST sources are in the Python tree now. +TODO: update this. + What you need to know --------------------- Modified: doctools/trunk/sphinx-build.py ============================================================================== --- doctools/trunk/sphinx-build.py (original) +++ doctools/trunk/sphinx-build.py Fri Feb 1 21:44:17 2008 @@ -11,10 +11,4 @@ if __name__ == '__main__': from sphinx import main - try: - sys.exit(main(sys.argv)) - except Exception: - import traceback - traceback.print_exc() - import pdb - pdb.post_mortem(sys.exc_traceback) + sys.exit(main(sys.argv)) Modified: doctools/trunk/sphinx/addons/ifconfig.py ============================================================================== --- doctools/trunk/sphinx/addons/ifconfig.py (original) +++ doctools/trunk/sphinx/addons/ifconfig.py Fri Feb 1 21:44:17 2008 @@ -34,7 +34,7 @@ return [node] -def process_ifconfig_nodes(app, doctree, docfilename): +def process_ifconfig_nodes(app, doctree, docname): ns = app.config.__dict__.copy() ns['builder'] = app.builder.name for node in doctree.traverse(ifconfig): Modified: doctools/trunk/sphinx/application.py ============================================================================== --- doctools/trunk/sphinx/application.py (original) +++ doctools/trunk/sphinx/application.py Fri Feb 1 21:44:17 2008 @@ -42,9 +42,9 @@ # List of all known events. Maps name to arguments description. events = { - 'builder-inited': 'builder instance', + 'builder-inited': '', 'doctree-read' : 'the doctree before being pickled', - 'doctree-resolved' : 'the doctree, the filename, the builder', + 'doctree-resolved' : 'the doctree, the docname', } class Application(object): Modified: doctools/trunk/sphinx/builder.py ============================================================================== --- doctools/trunk/sphinx/builder.py (original) +++ doctools/trunk/sphinx/builder.py Fri Feb 1 21:44:17 2008 @@ -27,13 +27,13 @@ from docutils.readers.doctree import Reader as DoctreeReader from sphinx import addnodes -from sphinx.util import (get_matching_files, ensuredir, relative_uri, os_path, SEP) +from sphinx.util import (get_matching_docs, ensuredir, relative_uri, SEP, os_path) from sphinx.htmlhelp import build_hhx from sphinx.htmlwriter import HTMLWriter, HTMLTranslator, SmartyPantsHTMLTranslator from sphinx.latexwriter import LaTeXWriter from sphinx.environment import BuildEnvironment, NoUri from sphinx.highlighting import pygments, get_stylesheet -from sphinx.util.console import bold, purple, green, red, darkgreen +from sphinx.util.console import bold, purple, red, darkgreen # side effect: registers roles and directives from sphinx import roles @@ -64,6 +64,7 @@ self.freshenv = freshenv self.init() + self.load_env() # helper methods @@ -91,8 +92,11 @@ template = self.templates[name] = self.jinja_env.get_template(name) return template - def get_target_uri(self, source_filename, typ=None): - """Return the target URI for a source filename.""" + def get_target_uri(self, docname, typ=None): + """ + Return the target URI for a document name (typ can be used to qualify + the link characteristic for individual builders). + """ raise NotImplementedError def get_relative_uri(self, from_, to, typ=None): @@ -102,7 +106,7 @@ return relative_uri(self.get_target_uri(from_), self.get_target_uri(to, typ)) - def get_outdated_files(self): + def get_outdated_docs(self): """Return a list of output files that are outdated.""" raise NotImplementedError @@ -132,29 +136,33 @@ self.info('done') except Exception, err: self.info('failed: %s' % err) - self.env = BuildEnvironment(self.srcdir, self.doctreedir) + self.env = BuildEnvironment(self.srcdir, self.doctreedir, self.config) else: - self.env = BuildEnvironment(self.srcdir, self.doctreedir) + self.env = BuildEnvironment(self.srcdir, self.doctreedir, self.config) + self.env.set_warnfunc(self.warn) def build_all(self): """Build all source files.""" - self.load_env() self.build(None, summary='all source files') - def build_specific(self, source_filenames): + def build_specific(self, filenames): """Only rebuild as much as needed for changes in the source_filenames.""" # bring the filenames to the canonical format, that is, - # relative to the source directory. + # relative to the source directory and without source_suffix. dirlen = len(self.srcdir) + 1 - to_write = [path.abspath(filename)[dirlen:] for filename in source_filenames] - self.load_env() + to_write = [] + suffix = self.config.source_suffix + for filename in filenames: + filename = path.abspath(filename)[dirlen:] + if filename.endswith(suffix): + filename = filename[:-len(suffix)] + to_write.append(filename) self.build(to_write, summary='%d source files given on command line' % len(to_write)) def build_update(self): """Only rebuild files changed or added since last build.""" - self.load_env() - to_build = self.get_outdated_files() + to_build = self.get_outdated_docs() if not to_build: self.info(bold('no target files are out of date, exiting.')) return @@ -166,12 +174,12 @@ summary='targets for %d source files that are ' 'out of date' % len(to_build)) - def build(self, filenames, summary=None): + def build(self, docnames, summary=None): if summary: self.info(bold('building [%s]: ' % self.name), nonl=1) self.info(summary) - updated_filenames = [] + updated_docnames = [] # while reading, collect all warnings from docutils warnings = [] self.env.set_warnfunc(warnings.append) @@ -179,14 +187,15 @@ iterator = self.env.update(self.config, self.app) # the first item in the iterator is a summary message self.info(iterator.next()) - for filename in self.status_iterator(iterator, 'reading... ', purple): - updated_filenames.append(filename) + for docname in self.status_iterator(iterator, 'reading... ', purple): + updated_docnames.append(docname) # nothing further to do, the environment has already done the reading for warning in warnings: - self.warn(warning) + if warning.strip(): + self.warn(warning) self.env.set_warnfunc(self.warn) - if updated_filenames: + if updated_docnames: # save the environment self.info(bold('pickling the env... '), nonl=True) self.env.topickle(path.join(self.doctreedir, ENV_PICKLE_FILENAME)) @@ -198,43 +207,44 @@ # another indirection to support methods which don't build files # individually - self.write(filenames, updated_filenames) + self.write(docnames, updated_docnames) # finish (write style files etc.) self.info(bold('finishing... ')) self.finish() self.info(bold('build succeeded.')) - def write(self, build_filenames, updated_filenames): - if build_filenames is None: # build_all - build_filenames = self.env.all_files - filenames = set(build_filenames) | set(updated_filenames) + def write(self, build_docnames, updated_docnames): + if build_docnames is None: # build_all + build_docnames = self.env.all_docs + docnames = set(build_docnames) | set(updated_docnames) # add all toctree-containing files that may have changed - for filename in list(filenames): - for tocfilename in self.env.files_to_rebuild.get(filename, []): - filenames.add(tocfilename) - filenames.add('contents.rst') + for docname in list(docnames): + for tocdocname in self.env.files_to_rebuild.get(docname, []): + docnames.add(tocdocname) + docnames.add(self.config.master_doc) self.info(bold('creating index...')) self.env.create_index(self) - self.prepare_writing(filenames) + self.prepare_writing(docnames) # write target files warnings = [] self.env.set_warnfunc(warnings.append) - for filename in self.status_iterator(sorted(filenames), - 'writing output... ', green): - doctree = self.env.get_and_resolve_doctree(filename, self) - self.write_file(filename, doctree) + for docname in self.status_iterator(sorted(docnames), + 'writing output... ', darkgreen): + doctree = self.env.get_and_resolve_doctree(docname, self) + self.write_doc(docname, doctree) for warning in warnings: - self.warn(warning) + if warning.strip(): + self.warn(warning) self.env.set_warnfunc(self.warn) - def prepare_writing(self, filenames): + def prepare_writing(self, docnames): raise NotImplementedError - def write_file(self, filename, doctree): + def write_doc(self, docname, doctree): raise NotImplementedError def finish(self): @@ -252,6 +262,9 @@ def init(self): """Load templates.""" self.init_templates() + self.init_translator_class() + + def init_translator_class(self): if self.config.html_translator_class: self.translator_class = self.app.import_object( self.config.html_translator_class, 'html_translator_class setting') @@ -272,10 +285,10 @@ settings_overrides={'output_encoding': 'unicode'} ) - def prepare_writing(self, filenames): + def prepare_writing(self, docnames): from sphinx.search import IndexBuilder self.indexer = IndexBuilder() - self.load_indexer(filenames) + self.load_indexer(docnames) self.docwriter = HTMLWriter(self) self.docsettings = OptionParser( defaults=self.env.settings, @@ -301,8 +314,7 @@ len = len, # the built-in ) - def write_file(self, filename, doctree): - pagename = filename[:-4] + def write_doc(self, docname, doctree): destination = StringOutput(encoding='utf-8') doctree.settings = self.docsettings @@ -311,43 +323,43 @@ prev = next = None parents = [] - related = self.env.toctree_relations.get(filename) + related = self.env.toctree_relations.get(docname) if related: - prev = {'link': self.get_relative_uri(filename, related[1]), + prev = {'link': self.get_relative_uri(docname, related[1]), 'title': self.render_partial(self.env.titles[related[1]])['title']} - next = {'link': self.get_relative_uri(filename, related[2]), + next = {'link': self.get_relative_uri(docname, related[2]), 'title': self.render_partial(self.env.titles[related[2]])['title']} while related: parents.append( - {'link': self.get_relative_uri(filename, related[0]), + {'link': self.get_relative_uri(docname, related[0]), 'title': self.render_partial(self.env.titles[related[0]])['title']}) related = self.env.toctree_relations.get(related[0]) if parents: - parents.pop() # remove link to "contents.rst"; we have a generic + parents.pop() # remove link to the master file; we have a generic # "back to index" link already parents.reverse() - title = self.env.titles.get(filename) + title = self.env.titles.get(docname) if title: title = self.render_partial(title)['title'] else: title = '' - self.globalcontext['titles'][filename] = title - sourcename = pagename + '.txt' - context = dict( + self.globalcontext['titles'][docname] = title + sourcename = self.config.html_copy_source and docname + '.txt' or '' + ctx = dict( title = title, sourcename = sourcename, body = self.docwriter.parts['fragment'], - toc = self.render_partial(self.env.get_toc_for(filename))['fragment'], + toc = self.render_partial(self.env.get_toc_for(docname))['fragment'], # only display a TOC if there's more than one item to show - display_toc = (self.env.toc_num_entries[filename] > 1), + display_toc = (self.env.toc_num_entries[docname] > 1), parents = parents, prev = prev, next = next, ) - self.index_page(pagename, doctree, title) - self.handle_page(pagename, context) + self.index_page(docname, doctree, title) + self.handle_page(docname, ctx) def finish(self): self.info(bold('writing additional files...')) @@ -369,7 +381,7 @@ # the global module index # the sorted list of all modules, for the global module index - modules = sorted(((mn, (self.get_relative_uri('modindex.rst', fn) + + modules = sorted(((mn, (self.get_relative_uri('modindex', fn) + '#module-' + mn, sy, pl, dep)) for (mn, (fn, sy, pl, dep)) in self.env.modules.iteritems()), key=lambda x: x[0].lower()) @@ -442,24 +454,25 @@ # --------- these are overwritten by the Web builder - def get_target_uri(self, source_filename, typ=None): - return source_filename[:-4] + '.html' + def get_target_uri(self, docname, typ=None): + return docname + '.html' - def get_outdated_files(self): - for filename in get_matching_files( - self.srcdir, '*.rst', exclude=set(self.config.unused_files)): + def get_outdated_docs(self): + for docname in get_matching_docs( + self.srcdir, self.config.source_suffix, + exclude=set(self.config.unused_files)): + targetname = self.env.doc2path(docname, self.outdir, '.html') try: - rstname = path.join(self.outdir, os_path(filename)) - targetmtime = path.getmtime(rstname[:-4] + '.html') + targetmtime = path.getmtime(targetname) except: targetmtime = 0 - if filename not in self.env.all_files: - yield filename - elif path.getmtime(path.join(self.srcdir, os_path(filename))) > targetmtime: - yield filename + if docname not in self.env.all_docs: + yield docname + elif path.getmtime(self.env.doc2path(docname)) > targetmtime: + yield docname - def load_indexer(self, filenames): + def load_indexer(self, docnames): try: f = open(path.join(self.outdir, 'searchindex.json'), 'r') try: @@ -469,7 +482,7 @@ except (IOError, OSError): pass # delete all entries for files that will be rebuilt - self.indexer.prune([fn[:-4] for fn in set(self.env.all_files) - set(filenames)]) + self.indexer.prune(set(self.env.all_docs) - set(docnames)) def index_page(self, pagename, doctree, title): # only index pages with title @@ -481,12 +494,12 @@ ctx['current_page_name'] = pagename def pathto(otheruri, resource=False, - baseuri=self.get_target_uri(pagename+'.rst')): + baseuri=self.get_target_uri(pagename)): if not resource: - otheruri = self.get_target_uri(otheruri+'.rst') + otheruri = self.get_target_uri(otheruri) return relative_uri(baseuri, otheruri) ctx['pathto'] = pathto - ctx['hasdoc'] = lambda name: name+'.rst' in self.env.all_files + ctx['hasdoc'] = lambda name: name in self.env.all_docs sidebarfile = self.config.html_sidebars.get(pagename) if sidebarfile: ctx['customsidebar'] = path.join(self.srcdir, sidebarfile) @@ -505,12 +518,13 @@ self.warn("Error writing file %s: %s" % (outfilename, err)) if self.copysource and ctx.get('sourcename'): # copy the source file for the "show source" link - shutil.copyfile(path.join(self.srcdir, os_path(pagename+'.rst')), - path.join(self.outdir, os_path(ctx['sourcename']))) + source_name = path.join(self.outdir, '_sources', os_path(ctx['sourcename'])) + ensuredir(path.dirname(source_name)) + shutil.copyfile(self.env.doc2path(pagename), source_name) def handle_finish(self): self.info(bold('dumping search index...')) - self.indexer.prune([fn[:-4] for fn in self.env.all_files]) + self.indexer.prune(self.env.all_docs) f = open(path.join(self.outdir, 'searchindex.json'), 'w') try: self.indexer.dump(f, 'json') @@ -525,29 +539,28 @@ name = 'web' def init(self): - # Nothing to do here. - pass + self.init_translator_class() - def get_outdated_files(self): - for filename in get_matching_files( - self.srcdir, '*.rst', exclude=set(self.config.unused_files)): + def get_outdated_docs(self): + for docname in get_matching_docs( + self.srcdir, self.config.source_suffix, + exclude=set(self.config.unused_files)): + targetname = self.env.doc2path(docname, self.outdir, '.fpickle') try: - targetmtime = path.getmtime( - path.join(self.outdir, os_path(filename)[:-4] + '.fpickle')) + targetmtime = path.getmtime(targetname) except: targetmtime = 0 - if path.getmtime(path.join(self.srcdir, - os_path(filename))) > targetmtime: - yield filename + if path.getmtime(self.env.doc2path(docname)) > targetmtime: + yield docname - def get_target_uri(self, source_filename, typ=None): - if source_filename == 'index.rst': + def get_target_uri(self, docname, typ=None): + if docname == 'index': return '' - if source_filename.endswith(SEP+'index.rst'): - return source_filename[:-9] # up to sep - return source_filename[:-4] + SEP + if docname.endswith(SEP + 'index'): + return docname[:-5] # up to sep + return docname + SEP - def load_indexer(self, filenames): + def load_indexer(self, docnames): try: f = open(path.join(self.outdir, 'searchindex.pickle'), 'r') try: @@ -557,32 +570,32 @@ except (IOError, OSError): pass # delete all entries for files that will be rebuilt - self.indexer.prune(set(self.env.all_files) - set(filenames)) + self.indexer.prune(set(self.env.all_docs) - set(docnames)) def index_page(self, pagename, doctree, title): # only index pages with title if self.indexer is not None and title: - self.indexer.feed(pagename+'.rst', title, doctree) + self.indexer.feed(pagename, title, doctree) - def handle_page(self, pagename, context, templatename='page.html'): - context['current_page_name'] = pagename + def handle_page(self, pagename, ctx, templatename='page.html'): + ctx['current_page_name'] = pagename sidebarfile = self.config.html_sidebars.get(pagename, '') if sidebarfile: - context['customsidebar'] = path.join(self.srcdir, sidebarfile) + ctx['customsidebar'] = path.join(self.srcdir, sidebarfile) outfilename = path.join(self.outdir, os_path(pagename) + '.fpickle') ensuredir(path.dirname(outfilename)) f = open(outfilename, 'wb') try: - pickle.dump(context, f, 2) + pickle.dump(ctx, f, 2) finally: f.close() # if there is a source file, copy the source file for the "show source" link - if context.get('sourcename'): + if ctx.get('sourcename'): source_name = path.join(self.outdir, 'sources', - os_path(context['sourcename'])) + os_path(ctx['sourcename'])) ensuredir(path.dirname(source_name)) - shutil.copyfile(path.join(self.srcdir, os_path(pagename)+'.rst'), source_name) + shutil.copyfile(self.env.doc2path(pagename), source_name) def handle_finish(self): # dump the global context @@ -594,7 +607,7 @@ f.close() self.info(bold('dumping search index...')) - self.indexer.prune(self.env.all_files) + self.indexer.prune(self.env.all_docs) f = open(path.join(self.outdir, 'searchindex.pickle'), 'wb') try: self.indexer.dump(f, 'pickle') @@ -636,31 +649,41 @@ name = 'latex' def init(self): - self.filenames = [] - self.document_data = map(list, self.config.latex_documents) + self.docnames = [] + self.document_data = [] - # assign subdirs to titles - self.titles = [] - for entry in self.document_data: - # replace version with real version - sourcename = entry[0] - if sourcename.endswith('/index.rst'): - sourcename = sourcename[:-9] - self.titles.append((sourcename, entry[2])) - - def get_outdated_files(self): + def get_outdated_docs(self): return 'all documents' # for now - def get_target_uri(self, source_filename, typ=None): + def get_target_uri(self, docname, typ=None): if typ == 'token': # token references are always inside production lists and must be # replaced by \token{} in LaTeX return '@token' - if source_filename not in self.filenames: + if docname not in self.docnames: raise NoUri else: return '' + def init_document_data(self): + preliminary_document_data = map(list, self.config.latex_documents) + if not preliminary_document_data: + self.warn('No "latex_documents" config value found; no documents ' + 'will be written.') + return + # assign subdirs to titles + self.titles = [] + for entry in preliminary_document_data: + docname = entry[0] + if docname not in self.env.all_docs: + self.warn('"latex_documents" config value references unknown ' + 'document %s' % docname) + continue + self.document_data.append(entry) + if docname.endswith(SEP+'index'): + docname = docname[:-5] + self.titles.append((docname, entry[2])) + def write(self, *ignored): # first, assemble the "appendix" docs that are in every PDF appendices = [] @@ -672,43 +695,40 @@ defaults=self.env.settings, components=(docwriter,)).get_default_values() - if not self.document_data: - self.warn('No "latex_documents" config setting found; no documents ' - 'will be written.') + self.init_document_data() - for sourcename, targetname, title, author, docclass in self.document_data: + for docname, targetname, title, author, docclass in self.document_data: destination = FileOutput( destination_path=path.join(self.outdir, targetname), encoding='utf-8') self.info("processing " + targetname + "... ", nonl=1) doctree = self.assemble_doctree( - sourcename, appendices=(docclass == 'manual') and appendices or []) + docname, appendices=(docclass == 'manual') and appendices or []) self.info("writing... ", nonl=1) doctree.settings = docsettings doctree.settings.author = author - doctree.settings.filename = sourcename + doctree.settings.docname = docname doctree.settings.docclass = docclass docwriter.write(doctree, destination) self.info("done") def assemble_doctree(self, indexfile, appendices): - self.filenames = set([indexfile, 'glossary.rst', 'about.rst', - 'license.rst', 'copyright.rst']) - self.info(green(indexfile) + " ", nonl=1) - def process_tree(filename, tree): + self.docnames = set([indexfile] + appendices) + self.info(darkgreen(indexfile) + " ", nonl=1) + def process_tree(docname, tree): tree = tree.deepcopy() for toctreenode in tree.traverse(addnodes.toctree): newnodes = [] includefiles = map(str, toctreenode['includefiles']) for includefile in includefiles: try: - self.info(green(includefile) + " ", nonl=1) + self.info(darkgreen(includefile) + " ", nonl=1) subtree = process_tree(includefile, self.env.get_doctree(includefile)) - self.filenames.add(includefile) + self.docnames.add(includefile) except: self.warn('%s: toctree contains ref to nonexisting file %r' % - (filename, includefile)) + (docname, includefile)) else: newnodes.extend(subtree.children) toctreenode.parent.replace(toctreenode, newnodes) @@ -721,11 +741,11 @@ # resolve :ref:s to distant tex files -- we can't add a cross-reference, # but append the document name for pendingnode in largetree.traverse(addnodes.pending_xref): - filename = pendingnode['reffilename'] + docname = pendingnode['refdocname'] sectname = pendingnode['refsectname'] newnodes = [nodes.emphasis(sectname, sectname)] for subdir, title in self.titles: - if filename.startswith(subdir): + if docname.startswith(subdir): newnodes.append(nodes.Text(' (in ', ' (in ')) newnodes.append(nodes.emphasis(title, title)) newnodes.append(nodes.Text(')', ')')) @@ -756,7 +776,7 @@ self.vtemplate = self.get_template('changes/versionchanges.html') self.stemplate = self.get_template('changes/rstsource.html') - def get_outdated_files(self): + def get_outdated_docs(self): return self.outdir typemap = { @@ -771,18 +791,18 @@ apichanges = [] otherchanges = {} self.info(bold('writing summary file...')) - for type, filename, lineno, module, descname, content in \ + for type, docname, lineno, module, descname, content in \ self.env.versionchanges[version]: ttext = self.typemap[type] context = content.replace('\n', ' ') - if descname and filename.startswith('c-api'): + if descname and docname.startswith('c-api'): if not descname: continue if context: entry = '%s: %s: %s' % (descname, ttext, context) else: entry = '%s: %s.' % (descname, ttext) - apichanges.append((entry, filename, lineno)) + apichanges.append((entry, docname, lineno)) elif descname or module: if not module: module = 'Builtins' @@ -792,14 +812,14 @@ entry = '%s: %s: %s' % (descname, ttext, context) else: entry = '%s: %s.' % (descname, ttext) - libchanges.setdefault(module, []).append((entry, filename, lineno)) + libchanges.setdefault(module, []).append((entry, docname, lineno)) else: if not context: continue entry = '%s: %s' % (ttext.capitalize(), context) - title = self.env.titles[filename].astext() - otherchanges.setdefault((filename, title), []).append( - (entry, filename, lineno)) + title = self.env.titles[docname].astext() + otherchanges.setdefault((docname, title), []).append( + (entry, docname, lineno)) ctx = { 'project': self.config.project, @@ -832,15 +852,15 @@ return line self.info(bold('copying source files...')) - for filename in self.env.all_files: - f = open(path.join(self.srcdir, os_path(filename))) + for docname in self.env.all_docs: + f = open(self.env.doc2path(docname)) lines = f.readlines() - targetfn = path.join(self.outdir, 'rst', os_path(filename)) + '.html' + targetfn = path.join(self.outdir, 'rst', os_path(docname)) + '.html' ensuredir(path.dirname(targetfn)) f = codecs.open(targetfn, 'w', 'utf8') try: text = ''.join(hl(i+1, line) for (i, line) in enumerate(lines)) - ctx = {'filename': filename, 'text': text} + ctx = {'filename': self.env.doc2path(docname, None), 'text': text} f.write(self.stemplate.render(ctx)) finally: f.close() @@ -873,25 +893,25 @@ # create output file open(path.join(self.outdir, 'output.txt'), 'w').close() - def get_target_uri(self, source_filename, typ=None): + def get_target_uri(self, docname, typ=None): return '' - def get_outdated_files(self): - return self.env.all_files + def get_outdated_docs(self): + return self.env.all_docs - def prepare_writing(self, filenames): + def prepare_writing(self, docnames): return - def write_file(self, filename, doctree): + def write_doc(self, docname, doctree): self.info() for node in doctree.traverse(nodes.reference): try: - self.check(node, filename) + self.check(node, docname) except KeyError: continue return - def check(self, node, filename): + def check(self, node, docname): uri = node['refuri'] if '#' in uri: @@ -920,23 +940,24 @@ elif r == 2: self.info(' - ' + red('broken: ') + s) self.broken[uri] = (r, s) - self.write_entry('broken', filename, lineno, uri + ': ' + s) + self.write_entry('broken', docname, lineno, uri + ': ' + s) else: self.info(' - ' + purple('redirected') + ' to ' + s) self.redirected[uri] = (r, s) - self.write_entry('redirected', filename, lineno, uri + ' to ' + s) + self.write_entry('redirected', docname, lineno, uri + ' to ' + s) elif len(uri) == 0 or uri[0:7] == 'mailto:' or uri[0:4] == 'ftp:': return else: self.info(uri + ' - ' + red('malformed!')) - self.write_entry('malformed', filename, lineno, uri) + self.write_entry('malformed', docname, lineno, uri) return - def write_entry(self, what, filename, line, uri): + def write_entry(self, what, docname, line, uri): output = open(path.join(self.outdir, 'output.txt'), 'a') - output.write("%s:%s [%s] %s\n" % (filename, line, what, uri)) + output.write("%s:%s [%s] %s\n" % (self.env.doc2path(docname, None), + line, what, uri)) output.close() def resolve(self, uri): Modified: doctools/trunk/sphinx/config.py ============================================================================== --- doctools/trunk/sphinx/config.py (original) +++ doctools/trunk/sphinx/config.py Fri Feb 1 21:44:17 2008 @@ -33,6 +33,8 @@ extensions = ([], True), # general reading options + master_doc = ('contents', True), + source_suffix = ('.rst', True), unused_files = ([], True), add_function_parentheses = (True, True), add_module_names = (True, True), @@ -44,6 +46,7 @@ html_index = ('', False), html_sidebars = ({}, False), html_additional_pages = ({}, False), + html_copy_source = (True, False), # HTML help options htmlhelp_basename = ('pydoc', False), Modified: doctools/trunk/sphinx/directives.py ============================================================================== --- doctools/trunk/sphinx/directives.py (original) +++ doctools/trunk/sphinx/directives.py Fri Feb 1 21:44:17 2008 @@ -539,15 +539,28 @@ def toctree_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): env = state.document.settings.env - dirname = posixpath.dirname(env.filename) + suffix = env.config.source_suffix + dirname = posixpath.dirname(env.docname) + ret = [] subnode = addnodes.toctree() - includefiles = filter(None, content) - # absolutize filenames - includefiles = [posixpath.normpath(posixpath.join(dirname, x)) for x in includefiles] + includefiles = [] + for docname in content: + if not docname: + continue + # absolutize filenames, remove suffixes + if docname.endswith(suffix): + docname = docname[:-len(suffix)] + docname = posixpath.normpath(posixpath.join(dirname, docname)) + if docname not in env.found_docs: + ret.append(state.document.reporter.warning( + 'toctree references unknown document %s' % docname, line=lineno)) + else: + includefiles.append(docname) subnode['includefiles'] = includefiles subnode['maxdepth'] = options.get('maxdepth', -1) - return [subnode] + ret.append(subnode) + return ret toctree_directive.content = 1 toctree_directive.options = {'maxdepth': int} Modified: doctools/trunk/sphinx/environment.py ============================================================================== --- doctools/trunk/sphinx/environment.py (original) +++ doctools/trunk/sphinx/environment.py Fri Feb 1 21:44:17 2008 @@ -43,7 +43,7 @@ Body.enum.converters['upperroman'] = lambda x: None from sphinx import addnodes -from sphinx.util import get_matching_files, os_path, SEP +from sphinx.util import get_matching_docs, SEP default_settings = { 'embed_stylesheet': False, @@ -56,7 +56,7 @@ # This is increased every time a new environment attribute is added # to properly invalidate pickle files. -ENV_VERSION = 15 +ENV_VERSION = 16 def walk_depth(node, depth, maxdepth): @@ -79,8 +79,11 @@ class RedirStream(object): - def __init__(self, write): - self.write = write + def __init__(self, writefunc): + self.writefunc = writefunc + def write(self, text): + if text.strip(): + self.writefunc(text) class NoUri(Exception): @@ -183,10 +186,10 @@ # --------- ENVIRONMENT INITIALIZATION ------------------------------------- - def __init__(self, srcdir, doctreedir): + def __init__(self, srcdir, doctreedir, config): self.doctreedir = doctreedir self.srcdir = srcdir - self.config = None + self.config = config # the docutils settings for building self.settings = default_settings.copy() @@ -198,41 +201,42 @@ # this is to invalidate old pickles self.version = ENV_VERSION - # Build times -- to determine changed files - # Also use this as an inventory of all existing and built filenames. - # All "filenames" here are /-separated and relative and include '.rst'. - self.all_files = {} # filename -> (mtime, md5sum) at the time of build + # All "docnames" here are /-separated and relative and exclude the source suffix. + + self.found_docs = set() # contains all existing docnames + self.all_docs = {} # docname -> (mtime, md5sum) at the time of build + # contains all built docnames # File metadata - self.metadata = {} # filename -> dict of metadata items + self.metadata = {} # docname -> dict of metadata items # TOC inventory - self.titles = {} # filename -> title node - self.tocs = {} # filename -> table of contents nodetree - self.toc_num_entries = {} # filename -> number of real entries + self.titles = {} # docname -> title node + self.tocs = {} # docname -> table of contents nodetree + self.toc_num_entries = {} # docname -> number of real entries # used to determine when to show the TOC in a sidebar # (don't show if it's only one item) - self.toctree_relations = {} # filename -> ["parent", "previous", "next"] filename + self.toctree_relations = {} # docname -> ["parent", "previous", "next"] docname # for navigating in the toctree - self.files_to_rebuild = {} # filename -> set of files (containing its TOCs) + self.files_to_rebuild = {} # docname -> set of files (containing its TOCs) # to rebuild too # X-ref target inventory - self.descrefs = {} # fullname -> filename, desctype - self.filemodules = {} # filename -> [modules] - self.modules = {} # modname -> filename, synopsis, platform, deprecated - self.labels = {} # labelname -> filename, labelid, sectionname - self.reftargets = {} # (type, name) -> filename, labelid + self.descrefs = {} # fullname -> docname, desctype + self.filemodules = {} # docname -> [modules] + self.modules = {} # modname -> docname, synopsis, platform, deprecated + self.labels = {} # labelname -> docname, labelid, sectionname + self.reftargets = {} # (type, name) -> docname, labelid # where type is term, token, option, envvar # Other inventories - self.indexentries = {} # filename -> list of + self.indexentries = {} # docname -> list of # (type, string, target, aliasname) self.versionchanges = {} # version -> list of - # (type, filename, lineno, module, descname, content) + # (type, docname, lineno, module, descname, content) # These are set while parsing a file - self.filename = None # current file name + self.docname = None # current document name self.currmodule = None # current module name self.currclass = None # current class name self.currdesc = None # current descref name @@ -241,78 +245,95 @@ def set_warnfunc(self, func): self._warnfunc = func - self.settings['warnfunc'] = func + self.settings['warning_stream'] = RedirStream(func) + + def warn(self, docname, msg): + if docname: + self._warnfunc(self.doc2path(docname) + ':: ' + msg) + else: + self._warnfunc('GLOBAL:: ' + msg) - def clear_file(self, filename): + def clear_doc(self, docname): """Remove all traces of a source file in the inventory.""" - if filename in self.all_files: - self.all_files.pop(filename, None) - self.metadata.pop(filename, None) - self.titles.pop(filename, None) - self.tocs.pop(filename, None) - self.toc_num_entries.pop(filename, None) + if docname in self.all_docs: + self.all_docs.pop(docname, None) + self.metadata.pop(docname, None) + self.titles.pop(docname, None) + self.tocs.pop(docname, None) + self.toc_num_entries.pop(docname, None) for subfn, fnset in self.files_to_rebuild.iteritems(): - fnset.discard(filename) + fnset.discard(docname) for fullname, (fn, _) in self.descrefs.items(): - if fn == filename: + if fn == docname: del self.descrefs[fullname] - self.filemodules.pop(filename, None) + self.filemodules.pop(docname, None) for modname, (fn, _, _, _) in self.modules.items(): - if fn == filename: + if fn == docname: del self.modules[modname] for labelname, (fn, _, _) in self.labels.items(): - if fn == filename: + if fn == docname: del self.labels[labelname] for key, (fn, _) in self.reftargets.items(): - if fn == filename: + if fn == docname: del self.reftargets[key] - self.indexentries.pop(filename, None) + self.indexentries.pop(docname, None) for version, changes in self.versionchanges.items(): - new = [change for change in changes if change[1] != filename] + new = [change for change in changes if change[1] != docname] changes[:] = new + def doc2path(self, docname, base=True, suffix=None): + """ + Return the filename for the document name. + If base is True, return absolute path under self.srcdir. + If base is None, return relative path to self.srcdir. + If base is a path string, return absolute path under that. + If suffix is not None, add it instead of config.source_suffix. + """ + suffix = suffix or self.config.source_suffix + if base is True: + return path.join(self.srcdir, docname.replace(SEP, path.sep)) + suffix + elif base is None: + return docname.replace(SEP, path.sep) + suffix + else: + return path.join(base, docname.replace(SEP, path.sep)) + suffix + def get_outdated_files(self, config, config_changed): """ - Return (added, changed, removed) iterables. + Return (added, changed, removed) sets. """ - all_source_files = list(get_matching_files( - self.srcdir, '*.rst', exclude=set(config.unused_files))) + self.found_docs = set(get_matching_docs(self.srcdir, config.source_suffix, + exclude=set(config.unused_files))) # clear all files no longer present - removed = set(self.all_files) - set(all_source_files) + removed = set(self.all_docs) - self.found_docs - added = [] - changed = [] + added = set() + changed = set() if config_changed: # config values affect e.g. substitutions - added = all_source_files + added = self.found_docs else: - for filename in all_source_files: - if filename not in self.all_files: - added.append(filename) + for docname in self.found_docs: + if docname not in self.all_docs: + added.add(docname) else: # if the doctree file is not there, rebuild - if not path.isfile(path.join(self.doctreedir, - os_path(filename)[:-3] + 'doctree')): - changed.append(filename) + if not path.isfile(self.doc2path(docname, self.doctreedir, '.doctree')): + changed.add(docname) continue - mtime, md5sum = self.all_files[filename] - newmtime = path.getmtime(path.join(self.srcdir, os_path(filename))) + mtime, md5sum = self.all_docs[docname] + newmtime = path.getmtime(self.doc2path(docname)) if newmtime == mtime: continue - # check the MD5 - #with file(path.join(self.srcdir, filename), 'rb') as f: - # newmd5sum = md5(f.read()).digest() - #if newmd5sum != md5sum: - changed.append(filename) + changed.add(docname) return added, changed, removed def update(self, config, app=None): """(Re-)read all files new or changed since last update. Yields a summary - and then filenames as it processes them. Store all environment filenames + and then docnames as it processes them. Store all environment docnames in the canonical format (ie using SEP as a separator in place of os.path.sep).""" config_changed = False @@ -338,36 +359,36 @@ self.config = config # clear all files no longer present - for filename in removed: - self.clear_file(filename) + for docname in removed: + self.clear_doc(docname) # read all new and changed files - for filename in added + changed: - yield filename - self.read_file(filename, app=app) + for docname in sorted(added | changed): + yield docname + self.read_doc(docname, app=app) - if 'contents.rst' not in self.all_files: - self._warnfunc('no master file contents.rst found') + if config.master_doc not in self.all_docs: + self.warn(None, 'no master file %s found' % self.doc2path(config.master_doc)) # --------- SINGLE FILE BUILDING ------------------------------------------- - def read_file(self, filename, src_path=None, save_parsed=True, app=None): + def read_doc(self, docname, src_path=None, save_parsed=True, app=None): """Parse a file and add/update inventory entries for the doctree. If srcpath is given, read from a different source file.""" # remove all inventory entries for that file - self.clear_file(filename) + self.clear_doc(docname) if src_path is None: - src_path = path.join(self.srcdir, os_path(filename)) + src_path = self.doc2path(docname) - self.filename = filename + self.docname = docname doctree = publish_doctree(None, src_path, FileInput, settings_overrides=self.settings, reader=MyStandaloneReader()) - self.process_metadata(filename, doctree) - self.create_title_from(filename, doctree) - self.note_labels_from(filename, doctree) - self.build_toc_from(filename, doctree) + self.process_metadata(docname, doctree) + self.create_title_from(docname, doctree) + self.note_labels_from(docname, doctree) + self.build_toc_from(docname, doctree) # calculate the MD5 of the file at time of build f = open(src_path, 'rb') @@ -375,7 +396,7 @@ md5sum = md5(f.read()).digest() finally: f.close() - self.all_files[filename] = (path.getmtime(src_path), md5sum) + self.all_docs[docname] = (path.getmtime(src_path), md5sum) if app: app.emit('doctree-read', doctree) @@ -383,11 +404,11 @@ # make it picklable doctree.reporter = None doctree.transformer = None + doctree.settings.warning_stream = None doctree.settings.env = None - doctree.settings.warnfunc = None # cleanup - self.filename = None + self.docname = None self.currmodule = None self.currclass = None self.indexnum = 0 @@ -395,8 +416,7 @@ if save_parsed: # save the parsed doctree - doctree_filename = path.join(self.doctreedir, - os_path(filename)[:-3] + 'doctree') + doctree_filename = self.doc2path(docname, self.doctreedir, '.doctree') dirname = path.dirname(doctree_filename) if not path.isdir(dirname): os.makedirs(dirname) @@ -408,11 +428,11 @@ else: return doctree - def process_metadata(self, filename, doctree): + def process_metadata(self, docname, doctree): """ Process the docinfo part of the doctree as metadata. """ - self.metadata[filename] = md = {} + self.metadata[docname] = md = {} docinfo = doctree[0] if docinfo.__class__ is not nodes.docinfo: # nothing to see here @@ -426,7 +446,7 @@ md[name.astext()] = body.astext() del doctree[0] - def create_title_from(self, filename, document): + def create_title_from(self, docname, document): """ Add a title node to the document (just copy the first section title), and store that title in the environment. @@ -436,10 +456,10 @@ visitor = MyContentsFilter(document) node[0].walkabout(visitor) titlenode += visitor.get_entry_text() - self.titles[filename] = titlenode + self.titles[docname] = titlenode return - def note_labels_from(self, filename, document): + def note_labels_from(self, docname, document): for name, explicit in document.nametypes.iteritems(): if not explicit: continue @@ -450,27 +470,27 @@ continue sectname = node[0].astext() # node[0] == title node if name in self.labels: - self._warnfunc('duplicate label %s, ' % name + - 'in %s and %s' % (self.labels[name][0], filename)) - self.labels[name] = filename, labelid, sectname + self.warn(docname, 'duplicate label %s, ' % name + + 'other instance in %s' % self.doc2path(self.labels[name][0])) + self.labels[name] = docname, labelid, sectname - def note_toctree(self, filename, toctreenode): + def note_toctree(self, docname, toctreenode): """Note a TOC tree directive in a document and gather information about file relations from it.""" includefiles = toctreenode['includefiles'] includefiles_len = len(includefiles) for i, includefile in enumerate(includefiles): # the "previous" file for the first toctree item is the parent - previous = i > 0 and includefiles[i-1] or filename + previous = i > 0 and includefiles[i-1] or docname # the "next" file for the last toctree item is the parent again - next = i < includefiles_len-1 and includefiles[i+1] or filename - self.toctree_relations[includefile] = [filename, previous, next] + next = i < includefiles_len-1 and includefiles[i+1] or docname + self.toctree_relations[includefile] = [docname, previous, next] # note that if the included file is rebuilt, this one must be # too (since the TOC of the included file could have changed) - self.files_to_rebuild.setdefault(includefile, set()).add(filename) + self.files_to_rebuild.setdefault(includefile, set()).add(docname) - def build_toc_from(self, filename, document): + def build_toc_from(self, docname, document): """Build a TOC from the doctree and store it in the inventory.""" numentries = [0] # nonlocal again... @@ -483,7 +503,7 @@ item = subnode.copy() entries.append(item) # do the inventory stuff - self.note_toctree(filename, subnode) + self.note_toctree(docname, subnode) continue if not isinstance(subnode, nodes.section): continue @@ -500,7 +520,7 @@ else: anchorname = '#' + subnode['ids'][0] numentries[0] += 1 - reference = nodes.reference('', '', refuri=filename, + reference = nodes.reference('', '', refuri=docname, anchorname=anchorname, *nodetext) para = addnodes.compact_paragraph('', '', reference) @@ -512,64 +532,66 @@ return [] toc = build_toc(document) if toc: - self.tocs[filename] = toc + self.tocs[docname] = toc else: - self.tocs[filename] = nodes.bullet_list('') - self.toc_num_entries[filename] = numentries[0] + self.tocs[docname] = nodes.bullet_list('') + self.toc_num_entries[docname] = numentries[0] - def get_toc_for(self, filename): + def get_toc_for(self, docname): """Return a TOC nodetree -- for use on the same page only!""" - toc = self.tocs[filename].deepcopy() + toc = self.tocs[docname].deepcopy() for node in toc.traverse(nodes.reference): node['refuri'] = node['anchorname'] return toc # ------- - # these are called from docutils directives and therefore use self.filename + # these are called from docutils directives and therefore use self.docname # def note_descref(self, fullname, desctype): if fullname in self.descrefs: - self._warnfunc('duplicate canonical description name %s, ' % fullname + - 'in %s and %s' % (self.descrefs[fullname][0], self.filename)) - self.descrefs[fullname] = (self.filename, desctype) + self.warn(self.docname, + 'duplicate canonical description name %s, ' % fullname + + 'other instance in %s' % self.doc2path(self.descrefs[fullname][0])) + self.descrefs[fullname] = (self.docname, desctype) def note_module(self, modname, synopsis, platform, deprecated): - self.modules[modname] = (self.filename, synopsis, platform, deprecated) - self.filemodules.setdefault(self.filename, []).append(modname) + self.modules[modname] = (self.docname, synopsis, platform, deprecated) + self.filemodules.setdefault(self.docname, []).append(modname) def note_reftarget(self, type, name, labelid): - self.reftargets[type, name] = (self.filename, labelid) + self.reftargets[type, name] = (self.docname, labelid) def note_index_entry(self, type, string, targetid, aliasname): - self.indexentries.setdefault(self.filename, []).append( + self.indexentries.setdefault(self.docname, []).append( (type, string, targetid, aliasname)) def note_versionchange(self, type, version, node, lineno): self.versionchanges.setdefault(version, []).append( - (type, self.filename, lineno, self.currmodule, self.currdesc, node.astext())) + (type, self.docname, lineno, self.currmodule, self.currdesc, node.astext())) # ------- # --------- RESOLVING REFERENCES AND TOCTREES ------------------------------ - def get_doctree(self, filename): + def get_doctree(self, docname): """Read the doctree for a file from the pickle and return it.""" - doctree_filename = path.join(self.doctreedir, os_path(filename)[:-3] + 'doctree') + doctree_filename = self.doc2path(docname, self.doctreedir, '.doctree') f = open(doctree_filename, 'rb') try: doctree = pickle.load(f) finally: f.close() - doctree.reporter = Reporter(filename, 2, 4, stream=RedirStream(self._warnfunc)) + doctree.reporter = Reporter(self.doc2path(docname), 2, 4, + stream=RedirStream(self._warnfunc)) return doctree - def get_and_resolve_doctree(self, filename, builder, doctree=None): + def get_and_resolve_doctree(self, docname, builder, doctree=None): """Read the doctree from the pickle, resolve cross-references and toctrees and return it.""" if doctree is None: - doctree = self.get_doctree(filename) + doctree = self.get_doctree(docname) # resolve all pending cross-references - self.resolve_references(doctree, filename, builder) + self.resolve_references(doctree, docname, builder) # now, resolve all toctree nodes def _entries_from_toctree(toctreenode): @@ -582,8 +604,8 @@ toc = self.tocs[includefile].deepcopy() except KeyError: # this is raised if the included file does not exist - self._warnfunc('%s: toctree contains ref to nonexisting ' - 'file %r' % (filename, includefile)) + self.warn(docname, 'toctree contains ref to nonexisting ' + 'file %r' % includefile) else: for toctreenode in toc.traverse(addnodes.toctree): toctreenode.parent.replace_self( @@ -607,7 +629,7 @@ if node.hasattr('anchorname'): # a TOC reference node['refuri'] = builder.get_relative_uri( - filename, node['refuri']) + node['anchorname'] + docname, node['refuri']) + node['anchorname'] return doctree @@ -615,7 +637,7 @@ descroles = frozenset(('data', 'exc', 'func', 'class', 'const', 'attr', 'meth', 'cfunc', 'cdata', 'ctype', 'cmacro')) - def resolve_references(self, doctree, docfilename, builder): + def resolve_references(self, doctree, fromdocname, builder): for node in doctree.traverse(addnodes.pending_xref): contnode = node[0].deepcopy() newnode = None @@ -627,70 +649,69 @@ if typ == 'ref': # reference to the named label; the final node will contain the # section name after the label - filename, labelid, sectname = self.labels.get(target, ('','','')) - if not filename: + docname, labelid, sectname = self.labels.get(target, ('','','')) + if not docname: newnode = doctree.reporter.system_message( 2, 'undefined label: %s' % target) - self._warnfunc('%s: undefined label: %s' % (docfilename, target)) + #self.warn(fromdocname, 'undefined label: %s' % target) else: newnode = nodes.reference('', '') innernode = nodes.emphasis(sectname, sectname) - if filename == docfilename: + if docname == fromdocname: newnode['refid'] = labelid else: # set more info in contnode in case the following call # raises NoUri, the builder will have to resolve these contnode = addnodes.pending_xref('') - contnode['reffilename'] = filename + contnode['refdocname'] = docname contnode['refsectname'] = sectname newnode['refuri'] = builder.get_relative_uri( - docfilename, filename) + '#' + labelid + fromdocname, docname) + '#' + labelid newnode.append(innernode) elif typ == 'keyword': # keywords are referenced by named labels - filename, labelid, _ = self.labels.get(target, ('','','')) - if not filename: - self._warnfunc('%s: unknown keyword: %s' % (docfilename, target)) + docname, labelid, _ = self.labels.get(target, ('','','')) + if not docname: + self.warn(fromdocname, 'unknown keyword: %s' % target) newnode = contnode else: newnode = nodes.reference('', '') - if filename == docfilename: + if docname == fromdocname: newnode['refid'] = labelid else: newnode['refuri'] = builder.get_relative_uri( - docfilename, filename) + '#' + labelid + fromdocname, docname) + '#' + labelid newnode.append(contnode) elif typ in ('token', 'term', 'envvar', 'option'): - filename, labelid = self.reftargets.get((typ, target), ('', '')) - if not filename: + docname, labelid = self.reftargets.get((typ, target), ('', '')) + if not docname: if typ == 'term': - self._warnfunc('%s: term not in glossary: %s' % - (docfilename, target)) + self.warn(fromdocname, 'term not in glossary: %s' % target) newnode = contnode else: newnode = nodes.reference('', '') - if filename == docfilename: + if docname == fromdocname: newnode['refid'] = labelid else: newnode['refuri'] = builder.get_relative_uri( - docfilename, filename, typ) + '#' + labelid + fromdocname, docname, typ) + '#' + labelid newnode.append(contnode) elif typ == 'mod': - filename, synopsis, platform, deprecated = \ + docname, synopsis, platform, deprecated = \ self.modules.get(target, ('','','', '')) # just link to an anchor if there are multiple modules in one file # because the anchor is generally below the heading which is ugly # but can't be helped easily anchor = '' - if not filename or filename == docfilename: + if not docname or docname == fromdocname: # don't link to self newnode = contnode else: - if len(self.filemodules[filename]) > 1: + if len(self.filemodules[docname]) > 1: anchor = '#' + 'module-' + target newnode = nodes.reference('', '') newnode['refuri'] = ( - builder.get_relative_uri(docfilename, filename) + anchor) + builder.get_relative_uri(fromdocname, docname) + anchor) newnode['reftitle'] = '%s%s%s' % ( (platform and '(%s) ' % platform), synopsis, (deprecated and ' (deprecated)' or '')) @@ -706,11 +727,11 @@ newnode = contnode else: newnode = nodes.reference('', '') - if desc[0] == docfilename: + if desc[0] == fromdocname: newnode['refid'] = name else: newnode['refuri'] = ( - builder.get_relative_uri(docfilename, desc[0]) + builder.get_relative_uri(fromdocname, desc[0]) + '#' + name) newnode.append(contnode) else: @@ -721,7 +742,7 @@ node.replace_self(newnode) # allow custom references to be resolved - builder.app.emit('doctree-resolved', doctree, docfilename) + builder.app.emit('doctree-resolved', doctree, fromdocname) def create_index(self, builder, _fixre=re.compile(r'(.*) ([(][^()]*[)])')): """Create the real index from the collected index entries.""" @@ -735,7 +756,7 @@ add_entry(subword, '', dic=entry[1]) else: try: - entry[0].append(builder.get_relative_uri('genindex.rst', fn) + entry[0].append(builder.get_relative_uri('genindex', fn) + '#' + tid) except NoUri: pass @@ -766,7 +787,7 @@ add_entry(string, 'built-in function') add_entry('built-in function', string) else: - self._warnfunc("unknown index entry type %r in %s" % (type, fn)) + self.warn(fn, "unknown index entry type %r" % type) newlist = new.items() newlist.sort(key=lambda t: t[0].lower()) @@ -815,12 +836,12 @@ def check_consistency(self): """Do consistency checks.""" - for filename in self.all_files: - if filename not in self.toctree_relations: - if filename == 'contents.rst': + for docname in self.all_docs: + if docname not in self.toctree_relations: + if docname == self.config.master_doc: # the master file is not included anywhere ;) continue - self._warnfunc('%s isn\'t included in any toctree' % filename) + self.warn(docname, 'document isn\'t included in any toctree') # --------- QUERYING ------------------------------------------------------- @@ -879,26 +900,26 @@ Keywords searched are: first modules, then descrefs. Returns: None if nothing found - (type, filename, anchorname) if exact match found - list of (quality, type, filename, anchorname, description) if fuzzy + (type, docname, anchorname) if exact match found + list of (quality, type, docname, anchorname, description) if fuzzy """ if keyword in self.modules: - filename, title, system, deprecated = self.modules[keyword] - return 'module', filename, 'module-' + keyword + docname, title, system, deprecated = self.modules[keyword] + return 'module', docname, 'module-' + keyword if keyword in self.descrefs: - filename, ref_type = self.descrefs[keyword] - return ref_type, filename, keyword + docname, ref_type = self.descrefs[keyword] + return ref_type, docname, keyword # special cases if '.' not in keyword: # exceptions are documented in the exceptions module if 'exceptions.'+keyword in self.descrefs: - filename, ref_type = self.descrefs['exceptions.'+keyword] - return ref_type, filename, 'exceptions.'+keyword + docname, ref_type = self.descrefs['exceptions.'+keyword] + return ref_type, docname, 'exceptions.'+keyword # special methods are documented as object methods if 'object.'+keyword in self.descrefs: - filename, ref_type = self.descrefs['object.'+keyword] - return ref_type, filename, 'object.'+keyword + docname, ref_type = self.descrefs['object.'+keyword] + return ref_type, docname, 'object.'+keyword if avoid_fuzzy: return @@ -919,7 +940,7 @@ yield '.'.join(parts[idx:]) result = [] - for type, filename, title, desc in possibilities(): + for type, docname, title, desc in possibilities(): best_res = 0 for part in dotsearch(title): s.set_seq1(part) @@ -929,16 +950,6 @@ s.ratio() > best_res: best_res = s.ratio() if best_res: - result.append((best_res, type, filename, title, desc)) + result.append((best_res, type, docname, title, desc)) return heapq.nlargest(n, result) - - def get_real_filename(self, filename): - """ - Pass this function a filename without .rst extension to get the real - filename. This also resolves the special `index.rst` files. If the file - does not exist the return value will be `None`. - """ - for rstname in filename + '.rst', filename + SEP + 'index.rst': - if rstname in self.all_files: - return rstname Modified: doctools/trunk/sphinx/htmlhelp.py ============================================================================== --- doctools/trunk/sphinx/htmlhelp.py (original) +++ doctools/trunk/sphinx/htmlhelp.py Fri Feb 1 21:44:17 2008 @@ -149,7 +149,7 @@ f.write('
  • ' + object_sitemap % ('Main page', 'index.html')) f.write('
  • ' + object_sitemap % ('Global Module Index', 'modindex.html')) # the TOC - toc = builder.env.get_and_resolve_doctree('contents.rst', builder) + toc = builder.env.get_and_resolve_doctree(builder.config.master_doc, builder) def write_toc(node, ullevel=0): if isinstance(node, nodes.list_item): f.write('
  • ') Modified: doctools/trunk/sphinx/latexwriter.py ============================================================================== --- doctools/trunk/sphinx/latexwriter.py (original) +++ doctools/trunk/sphinx/latexwriter.py Fri Feb 1 21:44:17 2008 @@ -100,7 +100,7 @@ 'pointsize': builder.config.latex_font_size, 'preamble': builder.config.latex_preamble, 'author': document.settings.author, - 'filename': document.settings.filename, + 'docname': document.settings.docname, 'title': None, # is determined later 'release': builder.config.release, 'date': date, @@ -200,7 +200,7 @@ # the environment already handles this raise nodes.SkipNode elif self.this_is_the_title: - if len(node.children) != 1 and not isinstance(node.children[0], Text): + if len(node.children) != 1 and not isinstance(node.children[0], nodes.Text): self.builder.warn('document title is not a single Text node') self.options['title'] = node.astext() self.this_is_the_title = 0 @@ -731,5 +731,10 @@ def depart_Text(self, node): pass + def visit_system_message(self, node): + pass + def depart_system_message(self, node): + self.body.append('\n') + def unknown_visit(self, node): raise NotImplementedError("Unknown node: " + node.__class__.__name__) Modified: doctools/trunk/sphinx/templates/changes/versionchanges.html ============================================================================== --- doctools/trunk/sphinx/templates/changes/versionchanges.html (original) +++ doctools/trunk/sphinx/templates/changes/versionchanges.html Fri Feb 1 21:44:17 2008 @@ -1,6 +1,6 @@ {% macro entries changes %} - {% endif %} Modified: doctools/trunk/sphinx/util/__init__.py ============================================================================== --- doctools/trunk/sphinx/util/__init__.py (original) +++ doctools/trunk/sphinx/util/__init__.py Fri Feb 1 21:44:17 2008 @@ -22,11 +22,8 @@ # hangover from more *nix-oriented origins. SEP = "/" -def canonical_path(ospath): - return ospath.replace(os.path.sep, SEP) - -def os_path(canpath): - return canpath.replace(SEP, os.path.sep) +def os_path(canonicalpath): + return canonicalpath.replace(SEP, os.path.sep) def relative_uri(base, to): @@ -51,8 +48,12 @@ raise -def get_matching_files(dirname, pattern, exclude=()): - """Get all files matching a pattern in a directory, recursively.""" +def get_matching_docs(dirname, suffix, exclude=()): + """ + Get all file names (without suffix) matching a suffix in a + directory, recursively. + """ + pattern = '*' + suffix # dirname is a normalized absolute path. dirname = path.normpath(path.abspath(dirname)) dirlen = len(dirname) + 1 # exclude slash @@ -65,7 +66,7 @@ qualified_name = path.join(root[dirlen:], sfile) if qualified_name in exclude: continue - yield canonical_path(qualified_name) + yield qualified_name[:-len(suffix)].replace(os.path.sep, SEP) def shorten_result(text='', keywords=[], maxlen=240, fuzz=60): Modified: doctools/trunk/sphinx/web/application.py ============================================================================== --- doctools/trunk/sphinx/web/application.py (original) +++ doctools/trunk/sphinx/web/application.py Fri Feb 1 21:44:17 2008 @@ -225,7 +225,7 @@ builder = MockBuilder() builder.config = env2.config writer = HTMLWriter(builder) - doctree = env2.read_file(page_id+'.rst', pathname, save_parsed=False) + doctree = env2.read_doc(page_id, pathname, save_parsed=False) doctree = env2.get_and_resolve_doctree(page_id+'.rst', builder, doctree) doctree.settings = OptionParser(defaults=env2.settings, components=(writer,)).get_default_values() From python-checkins at python.org Fri Feb 1 21:45:33 2008 From: python-checkins at python.org (georg.brandl) Date: Fri, 1 Feb 2008 21:45:33 +0100 (CET) Subject: [Python-checkins] r60510 - python/trunk/Doc/conf.py Message-ID: <20080201204533.E2D591E400A@bag.python.org> Author: georg.brandl Date: Fri Feb 1 21:45:33 2008 New Revision: 60510 Modified: python/trunk/Doc/conf.py Log: Update for latest sphinx latex writer. Modified: python/trunk/Doc/conf.py ============================================================================== --- python/trunk/Doc/conf.py (original) +++ python/trunk/Doc/conf.py Fri Feb 1 21:45:33 2008 @@ -102,29 +102,29 @@ # (source start file, target name, title, author, document class [howto/manual]). _stdauthor = r'Guido van Rossum\\Fred L. Drake, Jr., editor' latex_documents = [ - ('c-api/index.rst', 'c-api.tex', + ('c-api/index', 'c-api.tex', 'The Python/C API', _stdauthor, 'manual'), - ('distutils/index.rst', 'distutils.tex', + ('distutils/index', 'distutils.tex', 'Distributing Python Modules', _stdauthor, 'manual'), - ('documenting/index.rst', 'documenting.tex', + ('documenting/index', 'documenting.tex', 'Documenting Python', 'Georg Brandl', 'manual'), - ('extending/index.rst', 'extending.tex', + ('extending/index', 'extending.tex', 'Extending and Embedding Python', _stdauthor, 'manual'), - ('install/index.rst', 'install.tex', + ('install/index', 'install.tex', 'Installing Python Modules', _stdauthor, 'manual'), - ('library/index.rst', 'library.tex', + ('library/index', 'library.tex', 'The Python Library Reference', _stdauthor, 'manual'), - ('reference/index.rst', 'reference.tex', + ('reference/index', 'reference.tex', 'The Python Language Reference', _stdauthor, 'manual'), - ('tutorial/index.rst', 'tutorial.tex', + ('tutorial/index', 'tutorial.tex', 'Python Tutorial', _stdauthor, 'manual'), - ('using/index.rst', 'using.tex', + ('using/index', 'using.tex', 'Using Python', _stdauthor, 'manual'), - ('whatsnew/' + version + '.rst', 'whatsnew.tex', + ('whatsnew/' + version, 'whatsnew.tex', 'What\'s New in Python', 'A. M. Kuchling', 'howto'), ] # Collect all HOWTOs individually -latex_documents.extend(('howto/' + fn, 'howto-' + fn[:-4] + '.tex', +latex_documents.extend(('howto/' + fn[:-4], 'howto-' + fn[:-4] + '.tex', 'HOWTO', _stdauthor, 'howto') for fn in os.listdir('howto') if fn.endswith('.rst') and fn != 'index.rst') @@ -138,4 +138,4 @@ ''' # Documents to append as an appendix to all manuals. -latex_appendices = ['glossary.rst', 'about.rst', 'license.rst', 'copyright.rst'] +latex_appendices = ['glossary', 'about', 'license', 'copyright'] From buildbot at python.org Fri Feb 1 21:48:05 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 20:48:05 +0000 Subject: [Python-checkins] buildbot failure in hppa Ubuntu 3.0 Message-ID: <20080201204805.D84661E400A@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%20Ubuntu%203.0/builds/485 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-hppa Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Segmentation fault sincerely, -The Buildbot From theller at ctypes.org Fri Feb 1 22:12:01 2008 From: theller at ctypes.org (Thomas Heller) Date: Fri, 01 Feb 2008 22:12:01 +0100 Subject: [Python-checkins] r60504 - python/trunk/Modules/posixmodule.c In-Reply-To: <47A3713E.3090009@cheimes.de> References: <20080201184927.46EB21E400A@bag.python.org> <47A3713E.3090009@cheimes.de> Message-ID: Christian Heimes schrieb: > Thomas Heller wrote: >> Hm, what happens if sizeof(pid_t) != sizeof(int) ? > > The problem is discussed in issue #1983. Python may need to get a format > string for pid_t and PyInt_FromPid_t() / PyInt_AsPid_t(). There probably are more int-like types than characters available for format strings, so the approach I would take is the use the 'O&' format and write the conversion function myself. Thomas From g.brandl at gmx.net Fri Feb 1 22:26:03 2008 From: g.brandl at gmx.net (Georg Brandl) Date: Fri, 01 Feb 2008 22:26:03 +0100 Subject: [Python-checkins] r60504 - python/trunk/Modules/posixmodule.c In-Reply-To: <47A3713E.3090009@cheimes.de> References: <20080201184927.46EB21E400A@bag.python.org> <47A3713E.3090009@cheimes.de> Message-ID: Christian Heimes schrieb: > Thomas Heller wrote: >> Hm, what happens if sizeof(pid_t) != sizeof(int) ? > > The problem is discussed in issue #1983. Python may need to get a format > string for pid_t and PyInt_FromPid_t() / PyInt_AsPid_t(). I remember that we had similar problems for uid_t and gid_t in the past... Georg -- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out. From python-checkins at python.org Fri Feb 1 22:30:24 2008 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 1 Feb 2008 22:30:24 +0100 (CET) Subject: [Python-checkins] r60511 - in python/trunk: Lib/test/test_builtin.py Objects/floatobject.c Message-ID: <20080201213024.67BA01E400A@bag.python.org> Author: raymond.hettinger Date: Fri Feb 1 22:30:23 2008 New Revision: 60511 Modified: python/trunk/Lib/test/test_builtin.py python/trunk/Objects/floatobject.c Log: Issue #1996: float.as_integer_ratio() should return fraction in lowest terms. Modified: python/trunk/Lib/test/test_builtin.py ============================================================================== --- python/trunk/Lib/test/test_builtin.py (original) +++ python/trunk/Lib/test/test_builtin.py Fri Feb 1 22:30:23 2008 @@ -689,6 +689,14 @@ self.assertRaises(TypeError, float, Foo4(42)) def test_floatasratio(self): + for f, ratio in [ + (0.875, (7, 8)), + (-0.875, (-7, 8)), + (0.0, (0, 1)), + (11.5, (23, 2)), + ]: + self.assertEqual(f.as_integer_ratio(), ratio) + R = rational.Rational self.assertEqual(R(0, 1), R(*float(0.0).as_integer_ratio())) Modified: python/trunk/Objects/floatobject.c ============================================================================== --- python/trunk/Objects/floatobject.c (original) +++ python/trunk/Objects/floatobject.c Fri Feb 1 22:30:23 2008 @@ -1154,20 +1154,18 @@ } static PyObject * -float_as_integer_ratio(PyObject *v) +float_as_integer_ratio(PyObject *v, PyObject *unused) { double self; double float_part; int exponent; - int is_negative; - const int chunk_size = 28; + PyObject *prev; - PyObject *py_chunk = NULL; PyObject *py_exponent = NULL; PyObject *numerator = NULL; PyObject *denominator = NULL; PyObject *result_pair = NULL; - PyNumberMethods *long_methods; + PyNumberMethods *long_methods = PyLong_Type.tp_as_number; #define INPLACE_UPDATE(obj, call) \ prev = obj; \ @@ -1189,85 +1187,22 @@ } #endif - if (self == 0) { - numerator = PyInt_FromLong(0); - if (numerator == NULL) goto error; - denominator = PyInt_FromLong(1); - if (denominator == NULL) goto error; - result_pair = PyTuple_Pack(2, numerator, denominator); - /* Hand ownership over to the tuple. If the tuple - wasn't created successfully, we want to delete the - ints anyway. */ - Py_DECREF(numerator); - Py_DECREF(denominator); - return result_pair; - } - - /* XXX: Could perhaps handle FLT_RADIX!=2 by using ilogb and - scalbn, but those may not be in C89. */ PyFPE_START_PROTECT("as_integer_ratio", goto error); - float_part = frexp(self, &exponent); - is_negative = 0; - if (float_part < 0) { - float_part = -float_part; - is_negative = 1; - /* 0.5 <= float_part < 1.0 */ - } + float_part = frexp(self, &exponent); /* self == float_part * 2**exponent exactly */ PyFPE_END_PROTECT(float_part); - /* abs(self) == float_part * 2**exponent exactly */ - - /* Suck up chunk_size bits at a time; 28 is enough so that we - suck up all bits in 2 iterations for all known binary - double-precision formats, and small enough to fit in a - long. */ - numerator = PyLong_FromLong(0); - if (numerator == NULL) goto error; - - long_methods = PyLong_Type.tp_as_number; - - py_chunk = PyLong_FromLong(chunk_size); - if (py_chunk == NULL) goto error; - - while (float_part != 0) { - /* invariant: abs(self) == - (numerator + float_part) * 2**exponent exactly */ - long digit; - PyObject *py_digit; - - PyFPE_START_PROTECT("as_integer_ratio", goto error); - /* Pull chunk_size bits out of float_part, into digits. */ - float_part = ldexp(float_part, chunk_size); - digit = (long)float_part; - float_part -= digit; - /* 0 <= float_part < 1 */ - exponent -= chunk_size; - PyFPE_END_PROTECT(float_part); - - /* Shift digits into numerator. */ - // numerator <<= chunk_size - INPLACE_UPDATE(numerator, - long_methods->nb_lshift(numerator, py_chunk)); - if (numerator == NULL) goto error; - - // numerator |= digit - py_digit = PyLong_FromLong(digit); - if (py_digit == NULL) goto error; - INPLACE_UPDATE(numerator, - long_methods->nb_or(numerator, py_digit)); - Py_DECREF(py_digit); - if (numerator == NULL) goto error; + + while (float_part != floor(float_part)) { + float_part *= 2.0; + exponent--; } + /* Now, self == float_part * 2**exponent exactly and float_part is integral */ - /* Add in the sign bit. */ - if (is_negative) { - INPLACE_UPDATE(numerator, - long_methods->nb_negative(numerator)); - if (numerator == NULL) goto error; - } + numerator = PyLong_FromDouble(float_part); + if (numerator == NULL) goto error; /* now self = numerator * 2**exponent exactly; fold in 2**exponent */ - denominator = PyLong_FromLong(1); - py_exponent = PyLong_FromLong(labs(exponent)); + denominator = PyInt_FromLong(1); + py_exponent = PyInt_FromLong(labs(exponent)); if (py_exponent == NULL) goto error; INPLACE_UPDATE(py_exponent, long_methods->nb_lshift(denominator, py_exponent)); @@ -1289,7 +1224,6 @@ #undef INPLACE_UPDATE error: Py_XDECREF(py_exponent); - Py_XDECREF(py_chunk); Py_XDECREF(denominator); Py_XDECREF(numerator); return result_pair; @@ -1298,17 +1232,16 @@ PyDoc_STRVAR(float_as_integer_ratio_doc, "float.as_integer_ratio() -> (int, int)\n" "\n" -"Returns a pair of integers, not necessarily in lowest terms, whose\n" -"ratio is exactly equal to the original float. This method raises an\n" -"OverflowError on infinities and a ValueError on nans. The resulting\n" -"denominator will be positive.\n" +"Returns a pair of integers, whose ratio is exactly equal to the original\n" +"float and with a positive denominator.\n" +"Raises OverflowError on infinities and a ValueError on nans.\n" "\n" ">>> (10.0).as_integer_ratio()\n" -"(167772160L, 16777216L)\n" +"(10, 1)\n" ">>> (0.0).as_integer_ratio()\n" "(0, 1)\n" ">>> (-.25).as_integer_ratio()\n" -"(-134217728L, 536870912L)"); +"(-1, 4)"); static PyObject * From nnorwitz at gmail.com Fri Feb 1 23:41:33 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 1 Feb 2008 17:41:33 -0500 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20080201224133.GA6116@python.psfb.org> test_asynchat leaked [91, -3, -2] references, sum=86 test_threadsignals leaked [0, 0, -8] references, sum=-8 test_urllib2_localnet leaked [-128, 3, 126] references, sum=1 From python-checkins at python.org Fri Feb 1 23:15:52 2008 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 1 Feb 2008 23:15:52 +0100 (CET) Subject: [Python-checkins] r60512 - python/trunk/Objects/floatobject.c Message-ID: <20080201221552.7DEAE1E401D@bag.python.org> Author: raymond.hettinger Date: Fri Feb 1 23:15:52 2008 New Revision: 60512 Modified: python/trunk/Objects/floatobject.c Log: Integer ratio should return ints instead of longs whereever possible. Modified: python/trunk/Objects/floatobject.c ============================================================================== --- python/trunk/Objects/floatobject.c (original) +++ python/trunk/Objects/floatobject.c Fri Feb 1 23:15:52 2008 @@ -1201,8 +1201,8 @@ if (numerator == NULL) goto error; /* now self = numerator * 2**exponent exactly; fold in 2**exponent */ - denominator = PyInt_FromLong(1); - py_exponent = PyInt_FromLong(labs(exponent)); + denominator = PyLong_FromLong(1); + py_exponent = PyLong_FromLong(labs(exponent)); if (py_exponent == NULL) goto error; INPLACE_UPDATE(py_exponent, long_methods->nb_lshift(denominator, py_exponent)); @@ -1219,6 +1219,12 @@ py_exponent = NULL; } + /* Returns ints instead of longs where possible */ + INPLACE_UPDATE(numerator, PyNumber_Int(numerator)); + if (numerator == NULL) goto error; + INPLACE_UPDATE(denominator, PyNumber_Int(denominator)); + if (denominator == NULL) goto error; + result_pair = PyTuple_Pack(2, numerator, denominator); #undef INPLACE_UPDATE From python-checkins at python.org Fri Feb 1 23:22:51 2008 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 1 Feb 2008 23:22:51 +0100 (CET) Subject: [Python-checkins] r60513 - python/trunk/Objects/floatobject.c Message-ID: <20080201222251.2F4F01E400A@bag.python.org> Author: raymond.hettinger Date: Fri Feb 1 23:22:50 2008 New Revision: 60513 Modified: python/trunk/Objects/floatobject.c Log: labs() takes a long for an input. Modified: python/trunk/Objects/floatobject.c ============================================================================== --- python/trunk/Objects/floatobject.c (original) +++ python/trunk/Objects/floatobject.c Fri Feb 1 23:22:50 2008 @@ -1158,7 +1158,7 @@ { double self; double float_part; - int exponent; + long exponent; PyObject *prev; PyObject *py_exponent = NULL; From python-checkins at python.org Fri Feb 1 23:42:59 2008 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 1 Feb 2008 23:42:59 +0100 (CET) Subject: [Python-checkins] r60514 - python/trunk/Lib/test/test_builtin.py Message-ID: <20080201224259.89B0D1E400A@bag.python.org> Author: raymond.hettinger Date: Fri Feb 1 23:42:59 2008 New Revision: 60514 Modified: python/trunk/Lib/test/test_builtin.py Log: Test round-trip on float.as_integer_ratio() and float.__truediv__(). Modified: python/trunk/Lib/test/test_builtin.py ============================================================================== --- python/trunk/Lib/test/test_builtin.py (original) +++ python/trunk/Lib/test/test_builtin.py Fri Feb 1 23:42:59 2008 @@ -697,6 +697,12 @@ ]: self.assertEqual(f.as_integer_ratio(), ratio) + for i in range(10000): + f = random.random() + f *= 10 ** random.randint(-100, 100) + n, d = f.as_integer_ratio() + self.assertEqual(float(n).__truediv__(d), f) + R = rational.Rational self.assertEqual(R(0, 1), R(*float(0.0).as_integer_ratio())) From python-checkins at python.org Fri Feb 1 23:58:18 2008 From: python-checkins at python.org (marc-andre.lemburg) Date: Fri, 1 Feb 2008 23:58:18 +0100 (CET) Subject: [Python-checkins] r60515 - python/trunk/Lib/distutils/__init__.py Message-ID: <20080201225818.540781E400A@bag.python.org> Author: marc-andre.lemburg Date: Fri Feb 1 23:58:17 2008 New Revision: 60515 Modified: python/trunk/Lib/distutils/__init__.py Log: Bump distutils version number to match Python version. Modified: python/trunk/Lib/distutils/__init__.py ============================================================================== --- python/trunk/Lib/distutils/__init__.py (original) +++ python/trunk/Lib/distutils/__init__.py Fri Feb 1 23:58:17 2008 @@ -20,4 +20,4 @@ # In general, major and minor version should loosely follow the Python # version number the distutils code was shipped with. # -__version__ = "2.5.1" +__version__ = "2.6.0" From buildbot at python.org Sat Feb 2 00:09:39 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 23:09:39 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20080201230939.AC8481E400A@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%20trunk/builds/81 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_builtin test_rational ====================================================================== ERROR: test_floatasratio (test.test_builtin.BuiltinTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_builtin.py", line 698, in test_floatasratio self.assertEqual(f.as_integer_ratio(), ratio) ValueError: outrageous left shift count ====================================================================== FAIL: test_intern (test.test_builtin.BuiltinTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_builtin.py", line 965, in test_intern self.assert_(intern(s) is s) AssertionError ====================================================================== ERROR: testApproximateFrom (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_rational.py", line 204, in testApproximateFrom self.assertEqual(R.from_float(math.pi).approximate(10000), R(355, 113)) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count ====================================================================== ERROR: testAsContinuedFraction (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_rational.py", line 197, in testAsContinuedFraction self.assertEqual(R.from_float(math.pi).as_continued_fraction()[:15], File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count ====================================================================== ERROR: testBigComplexComparisons (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_rational.py", line 343, in testBigComplexComparisons self.assertFalse(R(10**23) == complex(10**23)) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 447, in __eq__ return a == a.from_float(b) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count ====================================================================== ERROR: testBigFloatComparisons (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_rational.py", line 334, in testBigFloatComparisons self.assertFalse(R(10**23) == float(10**23)) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 447, in __eq__ return a == a.from_float(b) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count ====================================================================== ERROR: testFromFloat (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_rational.py", line 138, in testFromFloat self.assertEquals((0, 1), _components(R.from_float(-0.0))) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count ====================================================================== ERROR: testHash (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_rational.py", line 363, in testHash self.assertEquals(hash(2.5), hash(R(5, 2))) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 432, in __hash__ if self == float(self): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 447, in __eq__ return a == a.from_float(b) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count ====================================================================== ERROR: testMixedEqual (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_rational.py", line 348, in testMixedEqual self.assertTrue(0.5 == R(1, 2)) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 447, in __eq__ return a == a.from_float(b) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count ====================================================================== ERROR: testMixedLess (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_rational.py", line 317, in testMixedLess self.assertTrue(R(1, 2) < 0.6) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 482, in __lt__ return a._subtractAndCompareToZero(b, operator.lt) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 466, in _subtractAndCompareToZero b = a.from_float(b) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count ====================================================================== ERROR: testMixedLessEqual (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_rational.py", line 323, in testMixedLessEqual self.assertTrue(0.5 <= R(1, 2)) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 494, in __ge__ return a._subtractAndCompareToZero(b, operator.ge) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 466, in _subtractAndCompareToZero b = a.from_float(b) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Feb 2 00:12:19 2008 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 2 Feb 2008 00:12:19 +0100 (CET) Subject: [Python-checkins] r60516 - python/trunk/Objects/floatobject.c Message-ID: <20080201231219.C484F1E400A@bag.python.org> Author: raymond.hettinger Date: Sat Feb 2 00:12:19 2008 New Revision: 60516 Modified: python/trunk/Objects/floatobject.c Log: Fix int/long typecase. Add check for non-binary floating point. Modified: python/trunk/Objects/floatobject.c ============================================================================== --- python/trunk/Objects/floatobject.c (original) +++ python/trunk/Objects/floatobject.c Sat Feb 2 00:12:19 2008 @@ -1158,7 +1158,7 @@ { double self; double float_part; - long exponent; + int exponent; PyObject *prev; PyObject *py_exponent = NULL; @@ -1172,6 +1172,13 @@ obj = call; \ Py_DECREF(prev); \ +#ifdef FLT_RADIX + if (FLT_RADIX != 2) { + /* This routine depends on base-2 floating_point. */ + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } +#endif CONVERT_TO_DOUBLE(v, self); if (Py_IS_INFINITY(self)) { @@ -1202,7 +1209,7 @@ /* now self = numerator * 2**exponent exactly; fold in 2**exponent */ denominator = PyLong_FromLong(1); - py_exponent = PyLong_FromLong(labs(exponent)); + py_exponent = PyLong_FromLong(labs((long)exponent)); if (py_exponent == NULL) goto error; INPLACE_UPDATE(py_exponent, long_methods->nb_lshift(denominator, py_exponent)); From buildbot at python.org Sat Feb 2 00:21:44 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 23:21:44 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian 3.0 Message-ID: <20080201232144.BF6191E401A@bag.python.org> The Buildbot has detected a new failure of sparc Debian 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%203.0/builds/3 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_ctypes make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 2 00:26:57 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 23:26:57 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu trunk Message-ID: <20080201232657.6B48C1E400A@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%20trunk/builds/1351 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_builtin test_rational ====================================================================== ERROR: test_floatasratio (test.test_builtin.BuiltinTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_builtin.py", line 698, in test_floatasratio self.assertEqual(f.as_integer_ratio(), ratio) ValueError: outrageous left shift count ====================================================================== FAIL: test_intern (test.test_builtin.BuiltinTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_builtin.py", line 965, in test_intern self.assert_(intern(s) is s) AssertionError ====================================================================== ERROR: testApproximateFrom (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_rational.py", line 204, in testApproximateFrom self.assertEqual(R.from_float(math.pi).approximate(10000), R(355, 113)) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count ====================================================================== ERROR: testAsContinuedFraction (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_rational.py", line 197, in testAsContinuedFraction self.assertEqual(R.from_float(math.pi).as_continued_fraction()[:15], File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count ====================================================================== ERROR: testBigComplexComparisons (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_rational.py", line 343, in testBigComplexComparisons self.assertFalse(R(10**23) == complex(10**23)) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 447, in __eq__ return a == a.from_float(b) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count ====================================================================== ERROR: testBigFloatComparisons (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_rational.py", line 334, in testBigFloatComparisons self.assertFalse(R(10**23) == float(10**23)) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 447, in __eq__ return a == a.from_float(b) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count ====================================================================== ERROR: testFromFloat (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_rational.py", line 138, in testFromFloat self.assertEquals((0, 1), _components(R.from_float(-0.0))) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count ====================================================================== ERROR: testHash (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_rational.py", line 363, in testHash self.assertEquals(hash(2.5), hash(R(5, 2))) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 432, in __hash__ if self == float(self): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 447, in __eq__ return a == a.from_float(b) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count ====================================================================== ERROR: testMixedEqual (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_rational.py", line 348, in testMixedEqual self.assertTrue(0.5 == R(1, 2)) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 447, in __eq__ return a == a.from_float(b) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count ====================================================================== ERROR: testMixedLess (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_rational.py", line 317, in testMixedLess self.assertTrue(R(1, 2) < 0.6) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 482, in __lt__ return a._subtractAndCompareToZero(b, operator.lt) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 466, in _subtractAndCompareToZero b = a.from_float(b) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count ====================================================================== ERROR: testMixedLessEqual (test.test_rational.RationalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/test/test_rational.py", line 323, in testMixedLessEqual self.assertTrue(0.5 <= R(1, 2)) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 494, in __ge__ return a._subtractAndCompareToZero(b, operator.ge) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 466, in _subtractAndCompareToZero b = a.from_float(b) File "/home/pybot/buildarea/trunk.klose-debian-ia64/build/Lib/rational.py", line 112, in from_float return cls(*f.as_integer_ratio()) ValueError: outrageous left shift count make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Feb 2 00:45:45 2008 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 2 Feb 2008 00:45:45 +0100 (CET) Subject: [Python-checkins] r60517 - python/trunk/Objects/floatobject.c Message-ID: <20080201234545.3B1FA1E4016@bag.python.org> Author: raymond.hettinger Date: Sat Feb 2 00:45:44 2008 New Revision: 60517 Modified: python/trunk/Objects/floatobject.c Log: Add protection from weirdness while scaling the mantissa to an integer. Modified: python/trunk/Objects/floatobject.c ============================================================================== --- python/trunk/Objects/floatobject.c (original) +++ python/trunk/Objects/floatobject.c Sat Feb 2 00:45:44 2008 @@ -1159,6 +1159,7 @@ double self; double float_part; int exponent; + int i; PyObject *prev; PyObject *py_exponent = NULL; @@ -1198,16 +1199,21 @@ float_part = frexp(self, &exponent); /* self == float_part * 2**exponent exactly */ PyFPE_END_PROTECT(float_part); - while (float_part != floor(float_part)) { + for (i=0; i<300 && float_part != floor(float_part) ; i++) { float_part *= 2.0; exponent--; } - /* Now, self == float_part * 2**exponent exactly and float_part is integral */ + if (i == 300) { + /* Could not convert mantissa to an integer */ + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + /* self == float_part * 2**exponent exactly and float_part is integral */ numerator = PyLong_FromDouble(float_part); if (numerator == NULL) goto error; - /* now self = numerator * 2**exponent exactly; fold in 2**exponent */ + /* fold in 2**exponent */ denominator = PyLong_FromLong(1); py_exponent = PyLong_FromLong(labs((long)exponent)); if (py_exponent == NULL) goto error; @@ -1216,8 +1222,7 @@ if (py_exponent == NULL) goto error; if (exponent > 0) { INPLACE_UPDATE(numerator, - long_methods->nb_multiply(numerator, - py_exponent)); + long_methods->nb_multiply(numerator, py_exponent)); if (numerator == NULL) goto error; } else { From buildbot at python.org Sat Feb 2 00:55:38 2008 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 Feb 2008 23:55:38 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian trunk Message-ID: <20080201235539.2136E1E41ED@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%20trunk/builds/232 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sat Feb 2 01:53:47 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 Feb 2008 00:53:47 +0000 Subject: [Python-checkins] buildbot failure in ARM Linux EABI trunk Message-ID: <20080202005347.89FCC1E400A@bag.python.org> The Buildbot has detected a new failure of ARM Linux EABI trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ARM%20Linux%20EABI%20trunk/builds/32 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-linux-armeabi Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sat Feb 2 02:08:31 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 Feb 2008 01:08:31 +0000 Subject: [Python-checkins] buildbot failure in x86 FreeBSD trunk Message-ID: <20080202010831.55D681E400B@bag.python.org> The Buildbot has detected a new failure of x86 FreeBSD trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20FreeBSD%20trunk/builds/514 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-freebsd Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 268, in process_request self.finish_request(request, client_address) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 281, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 560, in __init__ self.handle() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/BaseHTTPServer.py", line 316, in handle self.handle_one_request() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/BaseHTTPServer.py", line 299, in handle_one_request self.raw_requestline = self.rfile.readline() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/socket.py", line 369, in readline data = self._sock.recv(self._rbufsize) error: [Errno 35] Resource temporarily unavailable Traceback (most recent call last): File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 268, in process_request self.finish_request(request, client_address) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 281, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 560, in __init__ self.handle() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/BaseHTTPServer.py", line 316, in handle self.handle_one_request() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/BaseHTTPServer.py", line 299, in handle_one_request self.raw_requestline = self.rfile.readline() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/socket.py", line 369, in readline data = self._sock.recv(self._rbufsize) error: [Errno 35] Resource temporarily unavailable 1 test failed: test_xmlrpc Traceback (most recent call last): File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 268, in process_request self.finish_request(request, client_address) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 281, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/SocketServer.py", line 560, in __init__ self.handle() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/BaseHTTPServer.py", line 316, in handle self.handle_one_request() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/BaseHTTPServer.py", line 299, in handle_one_request self.raw_requestline = self.rfile.readline() File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/socket.py", line 369, in readline data = self._sock.recv(self._rbufsize) error: [Errno 35] Resource temporarily unavailable sincerely, -The Buildbot From martin at v.loewis.de Sat Feb 2 02:05:01 2008 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sat, 02 Feb 2008 02:05:01 +0100 Subject: [Python-checkins] r60504 - python/trunk/Modules/posixmodule.c In-Reply-To: References: <20080201184927.46EB21E400A@bag.python.org> <47A3713E.3090009@cheimes.de> Message-ID: <47A3C1BD.7030403@v.loewis.de> > There probably are more int-like types than characters available for format > strings, so the approach I would take is the use the 'O&' format and > write the conversion function myself. I still don't see why any of this is necessary. Can't you just parse it in a Py_LONG_LONG where available, and into an int elsewhere? Then check whether the value is out of range for pid_t, by assigning to pid_t and then comparing. From buildbot at python.org Sat Feb 2 04:38:32 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 Feb 2008 03:38:32 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian trunk Message-ID: <20080202033832.D3D551E400A@bag.python.org> The Buildbot has detected a new failure of sparc Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%20trunk/builds/3 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat Feb 2 06:11:40 2008 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 2 Feb 2008 06:11:40 +0100 (CET) Subject: [Python-checkins] r60518 - python/trunk/Objects/floatobject.c Message-ID: <20080202051140.8D6C81E400A@bag.python.org> Author: raymond.hettinger Date: Sat Feb 2 06:11:40 2008 New Revision: 60518 Modified: python/trunk/Objects/floatobject.c Log: Simpler solution to handling non-IEEE 754 environments. Modified: python/trunk/Objects/floatobject.c ============================================================================== --- python/trunk/Objects/floatobject.c (original) +++ python/trunk/Objects/floatobject.c Sat Feb 2 06:11:40 2008 @@ -1173,13 +1173,6 @@ obj = call; \ Py_DECREF(prev); \ -#ifdef FLT_RADIX - if (FLT_RADIX != 2) { - /* This routine depends on base-2 floating_point. */ - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; - } -#endif CONVERT_TO_DOUBLE(v, self); if (Py_IS_INFINITY(self)) { @@ -1202,13 +1195,10 @@ for (i=0; i<300 && float_part != floor(float_part) ; i++) { float_part *= 2.0; exponent--; - } - if (i == 300) { - /* Could not convert mantissa to an integer */ - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; } - /* self == float_part * 2**exponent exactly and float_part is integral */ + /* self == float_part * 2**exponent exactly and float_part is integral. + If FLT_RADIX != 2, the 300 steps may leave a tiny fractional part + to be truncated by PyLong_FromDouble(). */ numerator = PyLong_FromDouble(float_part); if (numerator == NULL) goto error; From python-checkins at python.org Sat Feb 2 06:24:44 2008 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 2 Feb 2008 06:24:44 +0100 (CET) Subject: [Python-checkins] r60519 - python/trunk/Modules/mathmodule.c Message-ID: <20080202052444.5186F1E400A@bag.python.org> Author: raymond.hettinger Date: Sat Feb 2 06:24:44 2008 New Revision: 60519 Modified: python/trunk/Modules/mathmodule.c Log: Neaten-up a bit. Modified: python/trunk/Modules/mathmodule.c ============================================================================== --- python/trunk/Modules/mathmodule.c (original) +++ python/trunk/Modules/mathmodule.c Sat Feb 2 06:24:44 2008 @@ -157,17 +157,13 @@ static PyObject * math_trunc(PyObject *self, PyObject *number) { - /* XXX: The py3k branch gets better errors for this by using - _PyType_Lookup(), but since float's mro isn't set in py2.6, - we just use PyObject_CallMethod here. */ return PyObject_CallMethod(number, "__trunc__", NULL); } PyDoc_STRVAR(math_trunc_doc, "trunc(x:Real) -> Integral\n" "\n" -"Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic" -"method."); +"Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method."); static PyObject * math_frexp(PyObject *self, PyObject *arg) From buildbot at python.org Sat Feb 2 06:39:01 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 Feb 2008 05:39:01 +0000 Subject: [Python-checkins] buildbot failure in x86 mvlgcc trunk Message-ID: <20080202053901.E56D61E400A@bag.python.org> The Buildbot has detected a new failure of x86 mvlgcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20mvlgcc%20trunk/builds/1382 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-linux Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_socket_ssl make: *** [buildbottest] Fehler 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 2 06:41:10 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 Feb 2008 05:41:10 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20080202054111.0E0DA1E400A@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%20trunk/builds/85 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/threading.py", line 486, in __bootstrap_inner self.run() File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/threading.py", line 446, in run self.__target(*self.__args, **self.__kwargs) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/bsddb/test/test_thread.py", line 284, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/bsddb/dbutils.py", line 62, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30995, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') 1 test failed: test_socket_ssl make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 2 07:25:44 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 Feb 2008 06:25:44 +0000 Subject: [Python-checkins] buildbot failure in alpha Tru64 5.1 trunk Message-ID: <20080202062545.0D46B1E400A@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%20Tru64%205.1%20trunk/builds/2456 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-tru64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_asynchat test_smtplib sincerely, -The Buildbot From python-checkins at python.org Sat Feb 2 10:56:20 2008 From: python-checkins at python.org (georg.brandl) Date: Sat, 2 Feb 2008 10:56:20 +0100 (CET) Subject: [Python-checkins] r60520 - python/trunk/Doc/library/urllib2.rst Message-ID: <20080202095620.9211F1E401C@bag.python.org> Author: georg.brandl Date: Sat Feb 2 10:56:20 2008 New Revision: 60520 Modified: python/trunk/Doc/library/urllib2.rst Log: Amendments to the urllib2 docs, written for GHOP by Thomas Lamb. Modified: python/trunk/Doc/library/urllib2.rst ============================================================================== --- python/trunk/Doc/library/urllib2.rst (original) +++ python/trunk/Doc/library/urllib2.rst Sat Feb 2 10:56:20 2008 @@ -33,10 +33,12 @@ This function returns a file-like object with two additional methods: - * :meth:`geturl` --- return the URL of the resource retrieved + * :meth:`geturl` --- return the URL of the resource retrieved, commonly used to + determine if a redirect was followed - * :meth:`info` --- return the meta-information of the page, as a dictionary-like - object + * :meth:`info` --- return the meta-information of the page, such as headers, in + the form of an ``httplib.HTTPMessage`` instance + (see `Quick Reference to HTTP Headers `_) Raises :exc:`URLError` on errors. @@ -84,18 +86,32 @@ The handlers raise this exception (or derived exceptions) when they run into a problem. It is a subclass of :exc:`IOError`. + .. attribute:: reason + + The reason for this error. It can be a message string or another exception + instance (:exc:`socket.error` for remote URLs, :exc:`OSError` for local + URLs). + .. exception:: HTTPError - A subclass of :exc:`URLError`, it can also function as a non-exceptional - file-like return value (the same thing that :func:`urlopen` returns). This - is useful when handling exotic HTTP errors, such as requests for - authentication. + Though being an exception (a subclass of :exc:`URLError`), an :exc:`HTTPError` + can also function as a non-exceptional file-like return value (the same thing + that :func:`urlopen` returns). This is useful when handling exotic HTTP + errors, such as requests for authentication. + + .. attribute:: code + + An HTTP status code as defined in `RFC 2616 `_. + This numeric value corresponds to a value found in the dictionary of + codes as found in :attr:`BaseHTTPServer.BaseHTTPRequestHandler.responses`. + + The following classes are provided: -.. class:: Request(url[, data][, headers] [, origin_req_host][, unverifiable]) +.. class:: Request(url[, data][, headers][, origin_req_host][, unverifiable]) This class is an abstraction of a URL request. @@ -110,7 +126,12 @@ returns a string in this format. *headers* should be a dictionary, and will be treated as if :meth:`add_header` - was called with each key and value as arguments. + was called with each key and value as arguments. This is often used to "spoof" + the ``User-Agent`` header, which is used by a browser to identify itself -- + some HTTP servers only allow requests coming from common browsers as opposed + to scripts. For example, Mozilla Firefox may identify itself as ``"Mozilla/5.0 + (X11; U; Linux i686) Gecko/20071127 Firefox/2.0.0.11"``, while :mod:`urllib2`'s + default user agent string is ``"Python-urllib/2.6"`` (on Python 2.6). The final two arguments are only of interest for correct handling of third-party HTTP cookies: From nnorwitz at gmail.com Sat Feb 2 11:25:48 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 2 Feb 2008 05:25:48 -0500 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20080202102548.GA17248@python.psfb.org> test_asynchat leaked [-91, 0, 0] references, sum=-91 test_cmd_line leaked [0, 23, 0] references, sum=23 test_threadedtempfile leaked [0, 70, -70] references, sum=0 test_threadsignals leaked [0, -8, 0] references, sum=-8 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 From python-checkins at python.org Sat Feb 2 11:12:39 2008 From: python-checkins at python.org (georg.brandl) Date: Sat, 2 Feb 2008 11:12:39 +0100 (CET) Subject: [Python-checkins] r60521 - python/trunk/Lib/test/test_descr.py Message-ID: <20080202101239.3C6F61E400B@bag.python.org> Author: georg.brandl Date: Sat Feb 2 11:12:36 2008 New Revision: 60521 Modified: python/trunk/Lib/test/test_descr.py Log: Rewrite test_descr as unittest, written for GHOP by Jeff Wheeler. Modified: python/trunk/Lib/test/test_descr.py ============================================================================== --- python/trunk/Lib/test/test_descr.py (original) +++ python/trunk/Lib/test/test_descr.py Sat Feb 2 11:12:36 2008 @@ -1,4637 +1,4332 @@ -# Test enhancements related to descriptors and new-style classes +import types +import unittest +import warnings + +from copy import deepcopy +from test import test_support + + +class OperatorsTest(unittest.TestCase): + + def __init__(self, *args, **kwargs): + unittest.TestCase.__init__(self, *args, **kwargs) + self.binops = { + 'add': '+', + 'sub': '-', + 'mul': '*', + 'div': '/', + 'divmod': 'divmod', + 'pow': '**', + 'lshift': '<<', + 'rshift': '>>', + 'and': '&', + 'xor': '^', + 'or': '|', + 'cmp': 'cmp', + 'lt': '<', + 'le': '<=', + 'eq': '==', + 'ne': '!=', + 'gt': '>', + 'ge': '>=', + } + + for name, expr in self.binops.items(): + if expr.islower(): + expr = expr + "(a, b)" + else: + expr = 'a %s b' % expr + self.binops[name] = expr + + self.unops = { + 'pos': '+', + 'neg': '-', + 'abs': 'abs', + 'invert': '~', + 'int': 'int', + 'long': 'long', + 'float': 'float', + 'oct': 'oct', + 'hex': 'hex', + } + + for name, expr in self.unops.items(): + if expr.islower(): + expr = expr + "(a)" + else: + expr = '%s a' % expr + self.unops[name] = expr + + def setUp(self): + self.original_filters = warnings.filters[:] + warnings.filterwarnings("ignore", + r'complex divmod\(\), // and % are deprecated$', + DeprecationWarning, r'(|%s)$' % __name__) + + def tearDown(self): + warnings.filters = self.original_filters + + def unop_test(self, a, res, expr="len(a)", meth="__len__"): + d = {'a': a} + self.assertEqual(eval(expr, d), res) + t = type(a) + m = getattr(t, meth) + + # Find method in parent class + while meth not in t.__dict__: + t = t.__bases__[0] + + self.assertEqual(m, t.__dict__[meth]) + self.assertEqual(m(a), res) + bm = getattr(a, meth) + self.assertEqual(bm(), res) + + def binop_test(self, a, b, res, expr="a+b", meth="__add__"): + d = {'a': a, 'b': b} + + # XXX Hack so this passes before 2.3 when -Qnew is specified. + if meth == "__div__" and 1/2 == 0.5: + meth = "__truediv__" + + if meth == '__divmod__': pass + + self.assertEqual(eval(expr, d), res) + t = type(a) + m = getattr(t, meth) + while meth not in t.__dict__: + t = t.__bases__[0] + self.assertEqual(m, t.__dict__[meth]) + self.assertEqual(m(a, b), res) + bm = getattr(a, meth) + self.assertEqual(bm(b), res) + + def ternop_test(self, a, b, c, res, expr="a[b:c]", meth="__getslice__"): + d = {'a': a, 'b': b, 'c': c} + self.assertEqual(eval(expr, d), res) + t = type(a) + m = getattr(t, meth) + while meth not in t.__dict__: + t = t.__bases__[0] + self.assertEqual(m, t.__dict__[meth]) + self.assertEqual(m(a, b, c), res) + bm = getattr(a, meth) + self.assertEqual(bm(b, c), res) + + def setop_test(self, a, b, res, stmt="a+=b", meth="__iadd__"): + d = {'a': deepcopy(a), 'b': b} + exec stmt in d + self.assertEqual(d['a'], res) + t = type(a) + m = getattr(t, meth) + while meth not in t.__dict__: + t = t.__bases__[0] + self.assertEqual(m, t.__dict__[meth]) + d['a'] = deepcopy(a) + m(d['a'], b) + self.assertEqual(d['a'], res) + d['a'] = deepcopy(a) + bm = getattr(d['a'], meth) + bm(b) + self.assertEqual(d['a'], res) + + def set2op_test(self, a, b, c, res, stmt="a[b]=c", meth="__setitem__"): + d = {'a': deepcopy(a), 'b': b, 'c': c} + exec stmt in d + self.assertEqual(d['a'], res) + t = type(a) + m = getattr(t, meth) + while meth not in t.__dict__: + t = t.__bases__[0] + self.assertEqual(m, t.__dict__[meth]) + d['a'] = deepcopy(a) + m(d['a'], b, c) + self.assertEqual(d['a'], res) + d['a'] = deepcopy(a) + bm = getattr(d['a'], meth) + bm(b, c) + self.assertEqual(d['a'], res) + + def set3op_test(self, a, b, c, d, res, stmt="a[b:c]=d", meth="__setslice__"): + dictionary = {'a': deepcopy(a), 'b': b, 'c': c, 'd': d} + exec stmt in dictionary + self.assertEqual(dictionary['a'], res) + t = type(a) + while meth not in t.__dict__: + t = t.__bases__[0] + m = getattr(t, meth) + self.assertEqual(m, t.__dict__[meth]) + dictionary['a'] = deepcopy(a) + m(dictionary['a'], b, c, d) + self.assertEqual(dictionary['a'], res) + dictionary['a'] = deepcopy(a) + bm = getattr(dictionary['a'], meth) + bm(b, c, d) + self.assertEqual(dictionary['a'], res) + + def test_lists(self): + # Testing list operations... + # Asserts are within individual test methods + self.binop_test([1], [2], [1,2], "a+b", "__add__") + self.binop_test([1,2,3], 2, 1, "b in a", "__contains__") + self.binop_test([1,2,3], 4, 0, "b in a", "__contains__") + self.binop_test([1,2,3], 1, 2, "a[b]", "__getitem__") + self.ternop_test([1,2,3], 0, 2, [1,2], "a[b:c]", "__getslice__") + self.setop_test([1], [2], [1,2], "a+=b", "__iadd__") + self.setop_test([1,2], 3, [1,2,1,2,1,2], "a*=b", "__imul__") + self.unop_test([1,2,3], 3, "len(a)", "__len__") + self.binop_test([1,2], 3, [1,2,1,2,1,2], "a*b", "__mul__") + self.binop_test([1,2], 3, [1,2,1,2,1,2], "b*a", "__rmul__") + self.set2op_test([1,2], 1, 3, [1,3], "a[b]=c", "__setitem__") + self.set3op_test([1,2,3,4], 1, 3, [5,6], [1,5,6,4], "a[b:c]=d", + "__setslice__") + + def test_dicts(self): + # Testing dict operations... + self.binop_test({1:2}, {2:1}, -1, "cmp(a,b)", "__cmp__") + self.binop_test({1:2,3:4}, 1, 1, "b in a", "__contains__") + self.binop_test({1:2,3:4}, 2, 0, "b in a", "__contains__") + self.binop_test({1:2,3:4}, 1, 2, "a[b]", "__getitem__") + + d = {1:2, 3:4} + l1 = [] + for i in d.keys(): + l1.append(i) + l = [] + for i in iter(d): + l.append(i) + self.assertEqual(l, l1) + l = [] + for i in d.__iter__(): + l.append(i) + self.assertEqual(l, l1) + l = [] + for i in dict.__iter__(d): + l.append(i) + self.assertEqual(l, l1) + d = {1:2, 3:4} + self.unop_test(d, 2, "len(a)", "__len__") + self.assertEqual(eval(repr(d), {}), d) + self.assertEqual(eval(d.__repr__(), {}), d) + self.set2op_test({1:2,3:4}, 2, 3, {1:2,2:3,3:4}, "a[b]=c", + "__setitem__") + + # Tests for unary and binary operators + def number_operators(self, a, b, skip=[]): + dict = {'a': a, 'b': b} + + for name, expr in self.binops.items(): + if name not in skip: + name = "__%s__" % name + if hasattr(a, name): + res = eval(expr, dict) + self.binop_test(a, b, res, expr, name) + + for name, expr in self.unops.items(): + if name not in skip: + name = "__%s__" % name + if hasattr(a, name): + res = eval(expr, dict) + self.unop_test(a, res, expr, name) + + def test_ints(self): + # Testing int operations... + self.number_operators(100, 3) + # The following crashes in Python 2.2 + self.assertEqual((1).__nonzero__(), 1) + self.assertEqual((0).__nonzero__(), 0) + # This returns 'NotImplemented' in Python 2.2 + class C(int): + def __add__(self, other): + return NotImplemented + self.assertEqual(C(5L), 5) + try: + C() + "" + except TypeError: + pass + else: + self.fail("NotImplemented should have caused TypeError") + import sys + try: + C(sys.maxint+1) + except OverflowError: + pass + else: + self.fail("should have raised OverflowError") + + def test_longs(self): + # Testing long operations... + self.number_operators(100L, 3L) + + def test_floats(self): + # Testing float operations... + self.number_operators(100.0, 3.0) + + def test_complexes(self): + # Testing complex operations... + self.number_operators(100.0j, 3.0j, skip=['lt', 'le', 'gt', 'ge', + 'int', 'long', 'float']) + + class Number(complex): + __slots__ = ['prec'] + def __new__(cls, *args, **kwds): + result = complex.__new__(cls, *args) + result.prec = kwds.get('prec', 12) + return result + def __repr__(self): + prec = self.prec + if self.imag == 0.0: + return "%.*g" % (prec, self.real) + if self.real == 0.0: + return "%.*gj" % (prec, self.imag) + return "(%.*g+%.*gj)" % (prec, self.real, prec, self.imag) + __str__ = __repr__ + + a = Number(3.14, prec=6) + self.assertEqual(repr(a), "3.14") + self.assertEqual(a.prec, 6) + + a = Number(a, prec=2) + self.assertEqual(repr(a), "3.1") + self.assertEqual(a.prec, 2) + + a = Number(234.5) + self.assertEqual(repr(a), "234.5") + self.assertEqual(a.prec, 12) + + def test_spam_lists(self): + # Testing spamlist operations... + import copy, xxsubtype as spam + + def spamlist(l, memo=None): + import xxsubtype as spam + return spam.spamlist(l) + + # This is an ugly hack: + copy._deepcopy_dispatch[spam.spamlist] = spamlist + + self.binop_test(spamlist([1]), spamlist([2]), spamlist([1,2]), "a+b", + "__add__") + self.binop_test(spamlist([1,2,3]), 2, 1, "b in a", "__contains__") + self.binop_test(spamlist([1,2,3]), 4, 0, "b in a", "__contains__") + self.binop_test(spamlist([1,2,3]), 1, 2, "a[b]", "__getitem__") + self.ternop_test(spamlist([1,2,3]), 0, 2, spamlist([1,2]), "a[b:c]", + "__getslice__") + self.setop_test(spamlist([1]), spamlist([2]), spamlist([1,2]), "a+=b", + "__iadd__") + self.setop_test(spamlist([1,2]), 3, spamlist([1,2,1,2,1,2]), "a*=b", + "__imul__") + self.unop_test(spamlist([1,2,3]), 3, "len(a)", "__len__") + self.binop_test(spamlist([1,2]), 3, spamlist([1,2,1,2,1,2]), "a*b", + "__mul__") + self.binop_test(spamlist([1,2]), 3, spamlist([1,2,1,2,1,2]), "b*a", + "__rmul__") + self.set2op_test(spamlist([1,2]), 1, 3, spamlist([1,3]), "a[b]=c", + "__setitem__") + self.set3op_test(spamlist([1,2,3,4]), 1, 3, spamlist([5,6]), + spamlist([1,5,6,4]), "a[b:c]=d", "__setslice__") + # Test subclassing + class C(spam.spamlist): + def foo(self): return 1 + a = C() + self.assertEqual(a, []) + self.assertEqual(a.foo(), 1) + a.append(100) + self.assertEqual(a, [100]) + self.assertEqual(a.getstate(), 0) + a.setstate(42) + self.assertEqual(a.getstate(), 42) + + def test_spam_dicts(self): + # Testing spamdict operations... + import copy, xxsubtype as spam + def spamdict(d, memo=None): + import xxsubtype as spam + sd = spam.spamdict() + for k, v in d.items(): + sd[k] = v + return sd + # This is an ugly hack: + copy._deepcopy_dispatch[spam.spamdict] = spamdict + + self.binop_test(spamdict({1:2}), spamdict({2:1}), -1, "cmp(a,b)", + "__cmp__") + self.binop_test(spamdict({1:2,3:4}), 1, 1, "b in a", "__contains__") + self.binop_test(spamdict({1:2,3:4}), 2, 0, "b in a", "__contains__") + self.binop_test(spamdict({1:2,3:4}), 1, 2, "a[b]", "__getitem__") + d = spamdict({1:2,3:4}) + l1 = [] + for i in d.keys(): + l1.append(i) + l = [] + for i in iter(d): + l.append(i) + self.assertEqual(l, l1) + l = [] + for i in d.__iter__(): + l.append(i) + self.assertEqual(l, l1) + l = [] + for i in type(spamdict({})).__iter__(d): + l.append(i) + self.assertEqual(l, l1) + straightd = {1:2, 3:4} + spamd = spamdict(straightd) + self.unop_test(spamd, 2, "len(a)", "__len__") + self.unop_test(spamd, repr(straightd), "repr(a)", "__repr__") + self.set2op_test(spamdict({1:2,3:4}), 2, 3, spamdict({1:2,2:3,3:4}), + "a[b]=c", "__setitem__") + # Test subclassing + class C(spam.spamdict): + def foo(self): return 1 + a = C() + self.assertEqual(a.items(), []) + self.assertEqual(a.foo(), 1) + a['foo'] = 'bar' + self.assertEqual(a.items(), [('foo', 'bar')]) + self.assertEqual(a.getstate(), 0) + a.setstate(100) + self.assertEqual(a.getstate(), 100) + +class ClassPropertiesAndMethods(unittest.TestCase): + + def test_python_dicts(self): + # Testing Python subclass of dict... + self.assert_(issubclass(dict, dict)) + self.assert_(isinstance({}, dict)) + d = dict() + self.assertEqual(d, {}) + self.assert_(d.__class__ is dict) + self.assert_(isinstance(d, dict)) + class C(dict): + state = -1 + def __init__(self_local, *a, **kw): + if a: + self.assertEqual(len(a), 1) + self_local.state = a[0] + if kw: + for k, v in kw.items(): + self_local[v] = k + def __getitem__(self, key): + return self.get(key, 0) + def __setitem__(self_local, key, value): + self.assert_(isinstance(key, type(0))) + dict.__setitem__(self_local, key, value) + def setstate(self, state): + self.state = state + def getstate(self): + return self.state + self.assert_(issubclass(C, dict)) + a1 = C(12) + self.assertEqual(a1.state, 12) + a2 = C(foo=1, bar=2) + self.assertEqual(a2[1] == 'foo' and a2[2], 'bar') + a = C() + self.assertEqual(a.state, -1) + self.assertEqual(a.getstate(), -1) + a.setstate(0) + self.assertEqual(a.state, 0) + self.assertEqual(a.getstate(), 0) + a.setstate(10) + self.assertEqual(a.state, 10) + self.assertEqual(a.getstate(), 10) + self.assertEqual(a[42], 0) + a[42] = 24 + self.assertEqual(a[42], 24) + N = 50 + for i in range(N): + a[i] = C() + for j in range(N): + a[i][j] = i*j + for i in range(N): + for j in range(N): + self.assertEqual(a[i][j], i*j) + + def test_python_lists(self): + # Testing Python subclass of list... + class C(list): + def __getitem__(self, i): + return list.__getitem__(self, i) + 100 + def __getslice__(self, i, j): + return (i, j) + a = C() + a.extend([0,1,2]) + self.assertEqual(a[0], 100) + self.assertEqual(a[1], 101) + self.assertEqual(a[2], 102) + self.assertEqual(a[100:200], (100,200)) + + def test_metaclass(self): + # Testing __metaclass__... + class C: + __metaclass__ = type + def __init__(self): + self.__state = 0 + def getstate(self): + return self.__state + def setstate(self, state): + self.__state = state + a = C() + self.assertEqual(a.getstate(), 0) + a.setstate(10) + self.assertEqual(a.getstate(), 10) + class D: + class __metaclass__(type): + def myself(cls): return cls + self.assertEqual(D.myself(), D) + d = D() + self.assertEqual(d.__class__, D) + class M1(type): + def __new__(cls, name, bases, dict): + dict['__spam__'] = 1 + return type.__new__(cls, name, bases, dict) + class C: + __metaclass__ = M1 + self.assertEqual(C.__spam__, 1) + c = C() + self.assertEqual(c.__spam__, 1) + + class _instance(object): + pass + class M2(object): + @staticmethod + def __new__(cls, name, bases, dict): + self = object.__new__(cls) + self.name = name + self.bases = bases + self.dict = dict + return self + def __call__(self): + it = _instance() + # Early binding of methods + for key in self.dict: + if key.startswith("__"): + continue + setattr(it, key, self.dict[key].__get__(it, self)) + return it + class C: + __metaclass__ = M2 + def spam(self): + return 42 + self.assertEqual(C.name, 'C') + self.assertEqual(C.bases, ()) + self.assert_('spam' in C.dict) + c = C() + self.assertEqual(c.spam(), 42) + + # More metaclass examples + + class autosuper(type): + # Automatically add __super to the class + # This trick only works for dynamic classes + def __new__(metaclass, name, bases, dict): + cls = super(autosuper, metaclass).__new__(metaclass, + name, bases, dict) + # Name mangling for __super removes leading underscores + while name[:1] == "_": + name = name[1:] + if name: + name = "_%s__super" % name + else: + name = "__super" + setattr(cls, name, super(cls)) + return cls + class A: + __metaclass__ = autosuper + def meth(self): + return "A" + class B(A): + def meth(self): + return "B" + self.__super.meth() + class C(A): + def meth(self): + return "C" + self.__super.meth() + class D(C, B): + def meth(self): + return "D" + self.__super.meth() + self.assertEqual(D().meth(), "DCBA") + class E(B, C): + def meth(self): + return "E" + self.__super.meth() + self.assertEqual(E().meth(), "EBCA") + + class autoproperty(type): + # Automatically create property attributes when methods + # named _get_x and/or _set_x are found + def __new__(metaclass, name, bases, dict): + hits = {} + for key, val in dict.iteritems(): + if key.startswith("_get_"): + key = key[5:] + get, set = hits.get(key, (None, None)) + get = val + hits[key] = get, set + elif key.startswith("_set_"): + key = key[5:] + get, set = hits.get(key, (None, None)) + set = val + hits[key] = get, set + for key, (get, set) in hits.iteritems(): + dict[key] = property(get, set) + return super(autoproperty, metaclass).__new__(metaclass, + name, bases, dict) + class A: + __metaclass__ = autoproperty + def _get_x(self): + return -self.__x + def _set_x(self, x): + self.__x = -x + a = A() + self.assert_(not hasattr(a, "x")) + a.x = 12 + self.assertEqual(a.x, 12) + self.assertEqual(a._A__x, -12) + + class multimetaclass(autoproperty, autosuper): + # Merge of multiple cooperating metaclasses + pass + class A: + __metaclass__ = multimetaclass + def _get_x(self): + return "A" + class B(A): + def _get_x(self): + return "B" + self.__super._get_x() + class C(A): + def _get_x(self): + return "C" + self.__super._get_x() + class D(C, B): + def _get_x(self): + return "D" + self.__super._get_x() + self.assertEqual(D().x, "DCBA") + + # Make sure type(x) doesn't call x.__class__.__init__ + class T(type): + counter = 0 + def __init__(self, *args): + T.counter += 1 + class C: + __metaclass__ = T + self.assertEqual(T.counter, 1) + a = C() + self.assertEqual(type(a), C) + self.assertEqual(T.counter, 1) + + class C(object): pass + c = C() + try: c() + except TypeError: pass + else: self.fail("calling object w/o call method should raise " + "TypeError") + + # Testing code to find most derived baseclass + class A(type): + def __new__(*args, **kwargs): + return type.__new__(*args, **kwargs) + + class B(object): + pass + + class C(object): + __metaclass__ = A + + # The most derived metaclass of D is A rather than type. + class D(B, C): + pass + + def test_module_subclasses(self): + # Testing Python subclass of module... + log = [] + import types, sys + MT = type(sys) + class MM(MT): + def __init__(self, name): + MT.__init__(self, name) + def __getattribute__(self, name): + log.append(("getattr", name)) + return MT.__getattribute__(self, name) + def __setattr__(self, name, value): + log.append(("setattr", name, value)) + MT.__setattr__(self, name, value) + def __delattr__(self, name): + log.append(("delattr", name)) + MT.__delattr__(self, name) + a = MM("a") + a.foo = 12 + x = a.foo + del a.foo + self.assertEqual(log, [("setattr", "foo", 12), + ("getattr", "foo"), + ("delattr", "foo")]) + + # http://python.org/sf/1174712 + try: + class Module(types.ModuleType, str): + pass + except TypeError: + pass + else: + self.fail("inheriting from ModuleType and str at the same time " + "should fail") + + def test_multiple_inheritence(self): + # Testing multiple inheritance... + class C(object): + def __init__(self): + self.__state = 0 + def getstate(self): + return self.__state + def setstate(self, state): + self.__state = state + a = C() + self.assertEqual(a.getstate(), 0) + a.setstate(10) + self.assertEqual(a.getstate(), 10) + class D(dict, C): + def __init__(self): + type({}).__init__(self) + C.__init__(self) + d = D() + self.assertEqual(d.keys(), []) + d["hello"] = "world" + self.assertEqual(d.items(), [("hello", "world")]) + self.assertEqual(d["hello"], "world") + self.assertEqual(d.getstate(), 0) + d.setstate(10) + self.assertEqual(d.getstate(), 10) + self.assertEqual(D.__mro__, (D, dict, C, object)) + + # SF bug #442833 + class Node(object): + def __int__(self): + return int(self.foo()) + def foo(self): + return "23" + class Frag(Node, list): + def foo(self): + return "42" + self.assertEqual(Node().__int__(), 23) + self.assertEqual(int(Node()), 23) + self.assertEqual(Frag().__int__(), 42) + self.assertEqual(int(Frag()), 42) + + # MI mixing classic and new-style classes. + + class A: + x = 1 + + class B(A): + pass + + class C(A): + x = 2 + + class D(B, C): + pass + self.assertEqual(D.x, 1) + + # Classic MRO is preserved for a classic base class. + class E(D, object): + pass + self.assertEqual(E.__mro__, (E, D, B, A, C, object)) + self.assertEqual(E.x, 1) + + # But with a mix of classic bases, their MROs are combined using + # new-style MRO. + class F(B, C, object): + pass + self.assertEqual(F.__mro__, (F, B, C, A, object)) + self.assertEqual(F.x, 2) + + # Try something else. + class C: + def cmethod(self): + return "C a" + def all_method(self): + return "C b" + + class M1(C, object): + def m1method(self): + return "M1 a" + def all_method(self): + return "M1 b" + + self.assertEqual(M1.__mro__, (M1, C, object)) + m = M1() + self.assertEqual(m.cmethod(), "C a") + self.assertEqual(m.m1method(), "M1 a") + self.assertEqual(m.all_method(), "M1 b") + + class D(C): + def dmethod(self): + return "D a" + def all_method(self): + return "D b" + + class M2(D, object): + def m2method(self): + return "M2 a" + def all_method(self): + return "M2 b" + + self.assertEqual(M2.__mro__, (M2, D, C, object)) + m = M2() + self.assertEqual(m.cmethod(), "C a") + self.assertEqual(m.dmethod(), "D a") + self.assertEqual(m.m2method(), "M2 a") + self.assertEqual(m.all_method(), "M2 b") + + class M3(M1, M2, object): + def m3method(self): + return "M3 a" + def all_method(self): + return "M3 b" + self.assertEqual(M3.__mro__, (M3, M1, M2, D, C, object)) + m = M3() + self.assertEqual(m.cmethod(), "C a") + self.assertEqual(m.dmethod(), "D a") + self.assertEqual(m.m1method(), "M1 a") + self.assertEqual(m.m2method(), "M2 a") + self.assertEqual(m.m3method(), "M3 a") + self.assertEqual(m.all_method(), "M3 b") + + class Classic: + pass + try: + class New(Classic): + __metaclass__ = type + except TypeError: + pass + else: + self.fail("new class with only classic bases - shouldn't be") + + def test_diamond_inheritence(self): + # Testing multiple inheritance special cases... + class A(object): + def spam(self): return "A" + self.assertEqual(A().spam(), "A") + class B(A): + def boo(self): return "B" + def spam(self): return "B" + self.assertEqual(B().spam(), "B") + self.assertEqual(B().boo(), "B") + class C(A): + def boo(self): return "C" + self.assertEqual(C().spam(), "A") + self.assertEqual(C().boo(), "C") + class D(B, C): pass + self.assertEqual(D().spam(), "B") + self.assertEqual(D().boo(), "B") + self.assertEqual(D.__mro__, (D, B, C, A, object)) + class E(C, B): pass + self.assertEqual(E().spam(), "B") + self.assertEqual(E().boo(), "C") + self.assertEqual(E.__mro__, (E, C, B, A, object)) + # MRO order disagreement + try: + class F(D, E): pass + except TypeError: + pass + else: + self.fail("expected MRO order disagreement (F)") + try: + class G(E, D): pass + except TypeError: + pass + else: + self.fail("expected MRO order disagreement (G)") + + # see thread python-dev/2002-October/029035.html + def test_ex5_from_c3_switch(self): + # Testing ex5 from C3 switch discussion... + class A(object): pass + class B(object): pass + class C(object): pass + class X(A): pass + class Y(A): pass + class Z(X,B,Y,C): pass + self.assertEqual(Z.__mro__, (Z, X, B, Y, A, C, object)) + + # see "A Monotonic Superclass Linearization for Dylan", + # by Kim Barrett et al. (OOPSLA 1996) + def test_monotonicity(self): + # Testing MRO monotonicity... + class Boat(object): pass + class DayBoat(Boat): pass + class WheelBoat(Boat): pass + class EngineLess(DayBoat): pass + class SmallMultihull(DayBoat): pass + class PedalWheelBoat(EngineLess,WheelBoat): pass + class SmallCatamaran(SmallMultihull): pass + class Pedalo(PedalWheelBoat,SmallCatamaran): pass + + self.assertEqual(PedalWheelBoat.__mro__, + (PedalWheelBoat, EngineLess, DayBoat, WheelBoat, Boat, object)) + self.assertEqual(SmallCatamaran.__mro__, + (SmallCatamaran, SmallMultihull, DayBoat, Boat, object)) + self.assertEqual(Pedalo.__mro__, + (Pedalo, PedalWheelBoat, EngineLess, SmallCatamaran, + SmallMultihull, DayBoat, WheelBoat, Boat, object)) + + # see "A Monotonic Superclass Linearization for Dylan", + # by Kim Barrett et al. (OOPSLA 1996) + def test_consistency_with_epg(self): + # Testing consistentcy with EPG... + class Pane(object): pass + class ScrollingMixin(object): pass + class EditingMixin(object): pass + class ScrollablePane(Pane,ScrollingMixin): pass + class EditablePane(Pane,EditingMixin): pass + class EditableScrollablePane(ScrollablePane,EditablePane): pass + + self.assertEqual(EditableScrollablePane.__mro__, + (EditableScrollablePane, ScrollablePane, EditablePane, Pane, + ScrollingMixin, EditingMixin, object)) + + def test_mro_disagreement(self): + # Testing error messages for MRO disagreement... + mro_err_msg = """Cannot create a consistent method resolution +order (MRO) for bases """ + + def raises(exc, expected, callable, *args): + try: + callable(*args) + except exc, msg: + if not str(msg).startswith(expected): + self.fail("Message %r, expected %r" % (str(msg), expected)) + else: + self.fail("Expected %s" % exc) + + class A(object): pass + class B(A): pass + class C(object): pass + + # Test some very simple errors + raises(TypeError, "duplicate base class A", + type, "X", (A, A), {}) + raises(TypeError, mro_err_msg, + type, "X", (A, B), {}) + raises(TypeError, mro_err_msg, + type, "X", (A, C, B), {}) + # Test a slightly more complex error + class GridLayout(object): pass + class HorizontalGrid(GridLayout): pass + class VerticalGrid(GridLayout): pass + class HVGrid(HorizontalGrid, VerticalGrid): pass + class VHGrid(VerticalGrid, HorizontalGrid): pass + raises(TypeError, mro_err_msg, + type, "ConfusedGrid", (HVGrid, VHGrid), {}) + + def test_object_class(self): + # Testing object class... + a = object() + self.assertEqual(a.__class__, object) + self.assertEqual(type(a), object) + b = object() + self.assertNotEqual(a, b) + self.assertFalse(hasattr(a, "foo")) + try: + a.foo = 12 + except (AttributeError, TypeError): + pass + else: + self.fail("object() should not allow setting a foo attribute") + self.assertFalse(hasattr(object(), "__dict__")) + + class Cdict(object): + pass + x = Cdict() + self.assertEqual(x.__dict__, {}) + x.foo = 1 + self.assertEqual(x.foo, 1) + self.assertEqual(x.__dict__, {'foo': 1}) + + def test_slots(self): + # Testing __slots__... + class C0(object): + __slots__ = [] + x = C0() + self.assertFalse(hasattr(x, "__dict__")) + self.assertFalse(hasattr(x, "foo")) + + class C1(object): + __slots__ = ['a'] + x = C1() + self.assertFalse(hasattr(x, "__dict__")) + self.assertFalse(hasattr(x, "a")) + x.a = 1 + self.assertEqual(x.a, 1) + x.a = None + self.assertEqual(x.a, None) + del x.a + self.assertFalse(hasattr(x, "a")) + + class C3(object): + __slots__ = ['a', 'b', 'c'] + x = C3() + self.assertFalse(hasattr(x, "__dict__")) + self.assertFalse(hasattr(x, 'a')) + self.assertFalse(hasattr(x, 'b')) + self.assertFalse(hasattr(x, 'c')) + x.a = 1 + x.b = 2 + x.c = 3 + self.assertEqual(x.a, 1) + self.assertEqual(x.b, 2) + self.assertEqual(x.c, 3) + + class C4(object): + """Validate name mangling""" + __slots__ = ['__a'] + def __init__(self, value): + self.__a = value + def get(self): + return self.__a + x = C4(5) + self.assertFalse(hasattr(x, '__dict__')) + self.assertFalse(hasattr(x, '__a')) + self.assertEqual(x.get(), 5) + try: + x.__a = 6 + except AttributeError: + pass + else: + self.fail("Double underscored names not mangled") + + # Make sure slot names are proper identifiers + try: + class C(object): + __slots__ = [None] + except TypeError: + pass + else: + self.fail("[None] slots not caught") + try: + class C(object): + __slots__ = ["foo bar"] + except TypeError: + pass + else: + self.fail("['foo bar'] slots not caught") + try: + class C(object): + __slots__ = ["foo\0bar"] + except TypeError: + pass + else: + self.fail("['foo\\0bar'] slots not caught") + try: + class C(object): + __slots__ = ["1"] + except TypeError: + pass + else: + self.fail("['1'] slots not caught") + try: + class C(object): + __slots__ = [""] + except TypeError: + pass + else: + self.fail("[''] slots not caught") + class C(object): + __slots__ = ["a", "a_b", "_a", "A0123456789Z"] + # XXX(nnorwitz): was there supposed to be something tested + # from the class above? + + # Test a single string is not expanded as a sequence. + class C(object): + __slots__ = "abc" + c = C() + c.abc = 5 + self.assertEqual(c.abc, 5) + + # Test unicode slot names + try: + unicode + except NameError: + pass + else: + # Test a single unicode string is not expanded as a sequence. + class C(object): + __slots__ = unicode("abc") + c = C() + c.abc = 5 + self.assertEqual(c.abc, 5) + + # _unicode_to_string used to modify slots in certain circumstances + slots = (unicode("foo"), unicode("bar")) + class C(object): + __slots__ = slots + x = C() + x.foo = 5 + self.assertEqual(x.foo, 5) + self.assertEqual(type(slots[0]), unicode) + # this used to leak references + try: + class C(object): + __slots__ = [unichr(128)] + except (TypeError, UnicodeEncodeError): + pass + else: + self.fail("[unichr(128)] slots not caught") + + # Test leaks + class Counted(object): + counter = 0 # counts the number of instances alive + def __init__(self): + Counted.counter += 1 + def __del__(self): + Counted.counter -= 1 + class C(object): + __slots__ = ['a', 'b', 'c'] + x = C() + x.a = Counted() + x.b = Counted() + x.c = Counted() + self.assertEqual(Counted.counter, 3) + del x + self.assertEqual(Counted.counter, 0) + class D(C): + pass + x = D() + x.a = Counted() + x.z = Counted() + self.assertEqual(Counted.counter, 2) + del x + self.assertEqual(Counted.counter, 0) + class E(D): + __slots__ = ['e'] + x = E() + x.a = Counted() + x.z = Counted() + x.e = Counted() + self.assertEqual(Counted.counter, 3) + del x + self.assertEqual(Counted.counter, 0) + + # Test cyclical leaks [SF bug 519621] + class F(object): + __slots__ = ['a', 'b'] + log = [] + s = F() + s.a = [Counted(), s] + self.assertEqual(Counted.counter, 1) + s = None + import gc + gc.collect() + self.assertEqual(Counted.counter, 0) + + # Test lookup leaks [SF bug 572567] + import sys,gc + class G(object): + def __cmp__(self, other): + return 0 + g = G() + orig_objects = len(gc.get_objects()) + for i in xrange(10): + g==g + new_objects = len(gc.get_objects()) + self.assertEqual(orig_objects, new_objects) + class H(object): + __slots__ = ['a', 'b'] + def __init__(self): + self.a = 1 + self.b = 2 + def __del__(self_): + self.assertEqual(self_.a, 1) + self.assertEqual(self_.b, 2) + + save_stderr = sys.stderr + sys.stderr = sys.stdout + h = H() + try: + del h + finally: + sys.stderr = save_stderr + + def test_slots_special(self): + # Testing __dict__ and __weakref__ in __slots__... + class D(object): + __slots__ = ["__dict__"] + a = D() + self.assert_(hasattr(a, "__dict__")) + self.assertFalse(hasattr(a, "__weakref__")) + a.foo = 42 + self.assertEqual(a.__dict__, {"foo": 42}) + + class W(object): + __slots__ = ["__weakref__"] + a = W() + self.assert_(hasattr(a, "__weakref__")) + self.assertFalse(hasattr(a, "__dict__")) + try: + a.foo = 42 + except AttributeError: + pass + else: + self.fail("shouldn't be allowed to set a.foo") + + class C1(W, D): + __slots__ = [] + a = C1() + self.assert_(hasattr(a, "__dict__")) + self.assert_(hasattr(a, "__weakref__")) + a.foo = 42 + self.assertEqual(a.__dict__, {"foo": 42}) + + class C2(D, W): + __slots__ = [] + a = C2() + self.assert_(hasattr(a, "__dict__")) + self.assert_(hasattr(a, "__weakref__")) + a.foo = 42 + self.assertEqual(a.__dict__, {"foo": 42}) + + def test_dynamics(self): + # Testing class attribute propagation... + class D(object): + pass + class E(D): + pass + class F(D): + pass + D.foo = 1 + self.assertEqual(D.foo, 1) + # Test that dynamic attributes are inherited + self.assertEqual(E.foo, 1) + self.assertEqual(F.foo, 1) + # Test dynamic instances + class C(object): + pass + a = C() + self.assertFalse(hasattr(a, "foobar")) + C.foobar = 2 + self.assertEqual(a.foobar, 2) + C.method = lambda self: 42 + self.assertEqual(a.method(), 42) + C.__repr__ = lambda self: "C()" + self.assertEqual(repr(a), "C()") + C.__int__ = lambda self: 100 + self.assertEqual(int(a), 100) + self.assertEqual(a.foobar, 2) + self.assertFalse(hasattr(a, "spam")) + def mygetattr(self, name): + if name == "spam": + return "spam" + raise AttributeError + C.__getattr__ = mygetattr + self.assertEqual(a.spam, "spam") + a.new = 12 + self.assertEqual(a.new, 12) + def mysetattr(self, name, value): + if name == "spam": + raise AttributeError + return object.__setattr__(self, name, value) + C.__setattr__ = mysetattr + try: + a.spam = "not spam" + except AttributeError: + pass + else: + self.fail("expected AttributeError") + self.assertEqual(a.spam, "spam") + class D(C): + pass + d = D() + d.foo = 1 + self.assertEqual(d.foo, 1) + + # Test handling of int*seq and seq*int + class I(int): + pass + self.assertEqual("a"*I(2), "aa") + self.assertEqual(I(2)*"a", "aa") + self.assertEqual(2*I(3), 6) + self.assertEqual(I(3)*2, 6) + self.assertEqual(I(3)*I(2), 6) + + # Test handling of long*seq and seq*long + class L(long): + pass + self.assertEqual("a"*L(2L), "aa") + self.assertEqual(L(2L)*"a", "aa") + self.assertEqual(2*L(3), 6) + self.assertEqual(L(3)*2, 6) + self.assertEqual(L(3)*L(2), 6) + + # Test comparison of classes with dynamic metaclasses + class dynamicmetaclass(type): + pass + class someclass: + __metaclass__ = dynamicmetaclass + self.assertNotEqual(someclass, object) + + def test_errors(self): + # Testing errors... + try: + class C(list, dict): + pass + except TypeError: + pass + else: + self.fail("inheritance from both list and dict should be illegal") + + try: + class C(object, None): + pass + except TypeError: + pass + else: + self.fail("inheritance from non-type should be illegal") + class Classic: + pass + + try: + class C(type(len)): + pass + except TypeError: + pass + else: + self.fail("inheritance from CFunction should be illegal") + + try: + class C(object): + __slots__ = 1 + except TypeError: + pass + else: + self.fail("__slots__ = 1 should be illegal") + + try: + class C(object): + __slots__ = [1] + except TypeError: + pass + else: + self.fail("__slots__ = [1] should be illegal") + + class M1(type): + pass + class M2(type): + pass + class A1(object): + __metaclass__ = M1 + class A2(object): + __metaclass__ = M2 + try: + class B(A1, A2): + pass + except TypeError: + pass + else: + self.fail("finding the most derived metaclass should have failed") + + def test_classmethods(self): + # Testing class methods... + class C(object): + def foo(*a): return a + goo = classmethod(foo) + c = C() + self.assertEqual(C.goo(1), (C, 1)) + self.assertEqual(c.goo(1), (C, 1)) + self.assertEqual(c.foo(1), (c, 1)) + class D(C): + pass + d = D() + self.assertEqual(D.goo(1), (D, 1)) + self.assertEqual(d.goo(1), (D, 1)) + self.assertEqual(d.foo(1), (d, 1)) + self.assertEqual(D.foo(d, 1), (d, 1)) + # Test for a specific crash (SF bug 528132) + def f(cls, arg): return (cls, arg) + ff = classmethod(f) + self.assertEqual(ff.__get__(0, int)(42), (int, 42)) + self.assertEqual(ff.__get__(0)(42), (int, 42)) + + # Test super() with classmethods (SF bug 535444) + self.assertEqual(C.goo.im_self, C) + self.assertEqual(D.goo.im_self, D) + self.assertEqual(super(D,D).goo.im_self, D) + self.assertEqual(super(D,d).goo.im_self, D) + self.assertEqual(super(D,D).goo(), (D,)) + self.assertEqual(super(D,d).goo(), (D,)) + + # Verify that argument is checked for callability (SF bug 753451) + try: + classmethod(1).__get__(1) + except TypeError: + pass + else: + self.fail("classmethod should check for callability") + + # Verify that classmethod() doesn't allow keyword args + try: + classmethod(f, kw=1) + except TypeError: + pass + else: + self.fail("classmethod shouldn't accept keyword args") + + def test_classmethods_in_c(self): + # Testing C-based class methods... + import xxsubtype as spam + a = (1, 2, 3) + d = {'abc': 123} + x, a1, d1 = spam.spamlist.classmeth(*a, **d) + self.assertEqual(x, spam.spamlist) + self.assertEqual(a, a1) + self.assertEqual(d, d1) + x, a1, d1 = spam.spamlist().classmeth(*a, **d) + self.assertEqual(x, spam.spamlist) + self.assertEqual(a, a1) + self.assertEqual(d, d1) + + def test_staticmethods(self): + # Testing static methods... + class C(object): + def foo(*a): return a + goo = staticmethod(foo) + c = C() + self.assertEqual(C.goo(1), (1,)) + self.assertEqual(c.goo(1), (1,)) + self.assertEqual(c.foo(1), (c, 1,)) + class D(C): + pass + d = D() + self.assertEqual(D.goo(1), (1,)) + self.assertEqual(d.goo(1), (1,)) + self.assertEqual(d.foo(1), (d, 1)) + self.assertEqual(D.foo(d, 1), (d, 1)) + + def test_staticmethods_in_c(self): + # Testing C-based static methods... + import xxsubtype as spam + a = (1, 2, 3) + d = {"abc": 123} + x, a1, d1 = spam.spamlist.staticmeth(*a, **d) + self.assertEqual(x, None) + self.assertEqual(a, a1) + self.assertEqual(d, d1) + x, a1, d2 = spam.spamlist().staticmeth(*a, **d) + self.assertEqual(x, None) + self.assertEqual(a, a1) + self.assertEqual(d, d1) + + def test_classic(self): + # Testing classic classes... + class C: + def foo(*a): return a + goo = classmethod(foo) + c = C() + self.assertEqual(C.goo(1), (C, 1)) + self.assertEqual(c.goo(1), (C, 1)) + self.assertEqual(c.foo(1), (c, 1)) + class D(C): + pass + d = D() + self.assertEqual(D.goo(1), (D, 1)) + self.assertEqual(d.goo(1), (D, 1)) + self.assertEqual(d.foo(1), (d, 1)) + self.assertEqual(D.foo(d, 1), (d, 1)) + class E: # *not* subclassing from C + foo = C.foo + self.assertEqual(E().foo, C.foo) # i.e., unbound + self.assert_(repr(C.foo.__get__(C())).startswith("= 0) + self.assertEqual(str(c1), repr(c1)) + self.assert_(-1 not in c1) + for i in range(10): + self.assert_(i in c1) + self.assertFalse(10 in c1) + # Test the default behavior for dynamic classes + class D(object): + def __getitem__(self, i): + if 0 <= i < 10: return i + raise IndexError + d1 = D() + d2 = D() + self.assert_(not not d1) + self.assertNotEqual(id(d1), id(d2)) + hash(d1) + hash(d2) + self.assertEqual(cmp(d1, d2), cmp(id(d1), id(d2))) + self.assertEqual(d1, d1) + self.assertNotEqual(d1, d2) + self.assert_(not d1 != d1) + self.assert_(not d1 == d2) + # Note that the module name appears in str/repr, and that varies + # depending on whether this test is run standalone or from a framework. + self.assert_(str(d1).find('D object at ') >= 0) + self.assertEqual(str(d1), repr(d1)) + self.assert_(-1 not in d1) + for i in range(10): + self.assert_(i in d1) + self.assertFalse(10 in d1) + # Test overridden behavior for static classes + class Proxy(object): + def __init__(self, x): + self.x = x + def __nonzero__(self): + return not not self.x + def __hash__(self): + return hash(self.x) + def __eq__(self, other): + return self.x == other + def __ne__(self, other): + return self.x != other + def __cmp__(self, other): + return cmp(self.x, other.x) + def __str__(self): + return "Proxy:%s" % self.x + def __repr__(self): + return "Proxy(%r)" % self.x + def __contains__(self, value): + return value in self.x + p0 = Proxy(0) + p1 = Proxy(1) + p_1 = Proxy(-1) + self.assertFalse(p0) + self.assert_(not not p1) + self.assertEqual(hash(p0), hash(0)) + self.assertEqual(p0, p0) + self.assertNotEqual(p0, p1) + self.assert_(not p0 != p0) + self.assertEqual(not p0, p1) + self.assertEqual(cmp(p0, p1), -1) + self.assertEqual(cmp(p0, p0), 0) + self.assertEqual(cmp(p0, p_1), 1) + self.assertEqual(str(p0), "Proxy:0") + self.assertEqual(repr(p0), "Proxy(0)") + p10 = Proxy(range(10)) + self.assertFalse(-1 in p10) + for i in range(10): + self.assert_(i in p10) + self.assertFalse(10 in p10) + # Test overridden behavior for dynamic classes + class DProxy(object): + def __init__(self, x): + self.x = x + def __nonzero__(self): + return not not self.x + def __hash__(self): + return hash(self.x) + def __eq__(self, other): + return self.x == other + def __ne__(self, other): + return self.x != other + def __cmp__(self, other): + return cmp(self.x, other.x) + def __str__(self): + return "DProxy:%s" % self.x + def __repr__(self): + return "DProxy(%r)" % self.x + def __contains__(self, value): + return value in self.x + p0 = DProxy(0) + p1 = DProxy(1) + p_1 = DProxy(-1) + self.assertFalse(p0) + self.assert_(not not p1) + self.assertEqual(hash(p0), hash(0)) + self.assertEqual(p0, p0) + self.assertNotEqual(p0, p1) + self.assertNotEqual(not p0, p0) + self.assertEqual(not p0, p1) + self.assertEqual(cmp(p0, p1), -1) + self.assertEqual(cmp(p0, p0), 0) + self.assertEqual(cmp(p0, p_1), 1) + self.assertEqual(str(p0), "DProxy:0") + self.assertEqual(repr(p0), "DProxy(0)") + p10 = DProxy(range(10)) + self.assertFalse(-1 in p10) + for i in range(10): + self.assert_(i in p10) + self.assertFalse(10 in p10) -# XXX Please, please, please, someone convert this to unittest style! + # Safety test for __cmp__ + def unsafecmp(a, b): + try: + a.__class__.__cmp__(a, b) + except TypeError: + pass + else: + self.fail("shouldn't allow %s.__cmp__(%r, %r)" % ( + a.__class__, a, b)) -from test.test_support import verify, vereq, verbose, TestFailed, TESTFN, get_original_stdout -from copy import deepcopy -import warnings -import types + unsafecmp(u"123", "123") + unsafecmp("123", u"123") + unsafecmp(1, 1.0) + unsafecmp(1.0, 1) + unsafecmp(1, 1L) + unsafecmp(1L, 1) + + def test_recursions(self): + # Testing recursion checks ... + class Letter(str): + def __new__(cls, letter): + if letter == 'EPS': + return str.__new__(cls) + return str.__new__(cls, letter) + def __str__(self): + if not self: + return 'EPS' + return self + # sys.stdout needs to be the original to trigger the recursion bug + import sys + test_stdout = sys.stdout + sys.stdout = test_support.get_original_stdout() + try: + # nothing should actually be printed, this should raise an exception + print Letter('w') + except RuntimeError: + pass + else: + self.fail("expected a RuntimeError for print recursion") + finally: + sys.stdout = test_stdout + + # Bug #1202533. + class A(object): + pass + A.__mul__ = types.MethodType(lambda self, x: self * x, None, A) + try: + A()*2 + except RuntimeError: + pass + else: + self.fail("expected a RuntimeError") + + def test_weakrefs(self): + # Testing weak references... + import weakref + class C(object): + pass + c = C() + r = weakref.ref(c) + self.assertEqual(r(), c) + del c + self.assertEqual(r(), None) + del r + class NoWeak(object): + __slots__ = ['foo'] + no = NoWeak() + try: + weakref.ref(no) + except TypeError, msg: + self.assert_(str(msg).find("weak reference") >= 0) + else: + self.fail("weakref.ref(no) should be illegal") + class Weak(object): + __slots__ = ['foo', '__weakref__'] + yes = Weak() + r = weakref.ref(yes) + self.assertEqual(r(), yes) + del yes + self.assertEqual(r(), None) + del r + + def test_properties(self): + # Testing property... + class C(object): + def getx(self): + return self.__x + def setx(self, value): + self.__x = value + def delx(self): + del self.__x + x = property(getx, setx, delx, doc="I'm the x property.") + a = C() + self.assertFalse(hasattr(a, "x")) + a.x = 42 + self.assertEqual(a._C__x, 42) + self.assertEqual(a.x, 42) + del a.x + self.assertFalse(hasattr(a, "x")) + self.assertFalse(hasattr(a, "_C__x")) + C.x.__set__(a, 100) + self.assertEqual(C.x.__get__(a), 100) + C.x.__delete__(a) + self.assertFalse(hasattr(a, "x")) + + raw = C.__dict__['x'] + self.assert_(isinstance(raw, property)) + + attrs = dir(raw) + self.assert_("__doc__" in attrs) + self.assert_("fget" in attrs) + self.assert_("fset" in attrs) + self.assert_("fdel" in attrs) + + self.assertEqual(raw.__doc__, "I'm the x property.") + self.assert_(raw.fget is C.__dict__['getx']) + self.assert_(raw.fset is C.__dict__['setx']) + self.assert_(raw.fdel is C.__dict__['delx']) + + for attr in "__doc__", "fget", "fset", "fdel": + try: + setattr(raw, attr, 42) + except TypeError, msg: + if str(msg).find('readonly') < 0: + self.fail("when setting readonly attr %r on a property, " + "got unexpected TypeError msg %r" % (attr, str(msg))) + else: + self.fail("expected TypeError from trying to set readonly %r " + "attr on a property" % attr) + + class D(object): + __getitem__ = property(lambda s: 1/0) + + d = D() + try: + for i in d: + str(i) + except ZeroDivisionError: + pass + else: + self.fail("expected ZeroDivisionError from bad property") + + class E(object): + def getter(self): + "getter method" + return 0 + def setter(self_, value): + "setter method" + pass + prop = property(getter) + self.assertEqual(prop.__doc__, "getter method") + prop2 = property(fset=setter) + self.assertEqual(prop2.__doc__, None) + + # this segfaulted in 2.5b2 + try: + import _testcapi + except ImportError: + pass + else: + class X(object): + p = property(_testcapi.test_with_docstring) + + def test_properties_plus(self): + class C(object): + foo = property(doc="hello") + @foo.getter + def foo(self): + return self._foo + @foo.setter + def foo(self, value): + self._foo = abs(value) + @foo.deleter + def foo(self): + del self._foo + c = C() + self.assertEqual(C.foo.__doc__, "hello") + self.assertFalse(hasattr(c, "foo")) + c.foo = -42 + self.assert_(hasattr(c, '_foo')) + self.assertEqual(c._foo, 42) + self.assertEqual(c.foo, 42) + del c.foo + self.assertFalse(hasattr(c, '_foo')) + self.assertFalse(hasattr(c, "foo")) + + class D(C): + @C.foo.deleter + def foo(self): + try: + del self._foo + except AttributeError: + pass + d = D() + d.foo = 24 + self.assertEqual(d.foo, 24) + del d.foo + del d.foo + + class E(object): + @property + def foo(self): + return self._foo + @foo.setter + def foo(self, value): + raise RuntimeError + @foo.setter + def foo(self, value): + self._foo = abs(value) + @foo.deleter + def foo(self, value=None): + del self._foo + + e = E() + e.foo = -42 + self.assertEqual(e.foo, 42) + del e.foo + + class F(E): + @E.foo.deleter + def foo(self): + del self._foo + @foo.setter + def foo(self, value): + self._foo = max(0, value) + f = F() + f.foo = -10 + self.assertEqual(f.foo, 0) + del f.foo + + def test_dict_constructors(self): + # Testing dict constructor ... + d = dict() + self.assertEqual(d, {}) + d = dict({}) + self.assertEqual(d, {}) + d = dict({1: 2, 'a': 'b'}) + self.assertEqual(d, {1: 2, 'a': 'b'}) + self.assertEqual(d, dict(d.items())) + self.assertEqual(d, dict(d.iteritems())) + d = dict({'one':1, 'two':2}) + self.assertEqual(d, dict(one=1, two=2)) + self.assertEqual(d, dict(**d)) + self.assertEqual(d, dict({"one": 1}, two=2)) + self.assertEqual(d, dict([("two", 2)], one=1)) + self.assertEqual(d, dict([("one", 100), ("two", 200)], **d)) + self.assertEqual(d, dict(**d)) -warnings.filterwarnings("ignore", - r'complex divmod\(\), // and % are deprecated$', - DeprecationWarning, r'(|%s)$' % __name__) - -def veris(a, b): - if a is not b: - raise TestFailed, "%r is %r" % (a, b) - -def testunop(a, res, expr="len(a)", meth="__len__"): - if verbose: print "checking", expr - dict = {'a': a} - vereq(eval(expr, dict), res) - t = type(a) - m = getattr(t, meth) - while meth not in t.__dict__: - t = t.__bases__[0] - vereq(m, t.__dict__[meth]) - vereq(m(a), res) - bm = getattr(a, meth) - vereq(bm(), res) - -def testbinop(a, b, res, expr="a+b", meth="__add__"): - if verbose: print "checking", expr - dict = {'a': a, 'b': b} - - # XXX Hack so this passes before 2.3 when -Qnew is specified. - if meth == "__div__" and 1/2 == 0.5: - meth = "__truediv__" - - vereq(eval(expr, dict), res) - t = type(a) - m = getattr(t, meth) - while meth not in t.__dict__: - t = t.__bases__[0] - vereq(m, t.__dict__[meth]) - vereq(m(a, b), res) - bm = getattr(a, meth) - vereq(bm(b), res) - -def testternop(a, b, c, res, expr="a[b:c]", meth="__getslice__"): - if verbose: print "checking", expr - dict = {'a': a, 'b': b, 'c': c} - vereq(eval(expr, dict), res) - t = type(a) - m = getattr(t, meth) - while meth not in t.__dict__: - t = t.__bases__[0] - vereq(m, t.__dict__[meth]) - vereq(m(a, b, c), res) - bm = getattr(a, meth) - vereq(bm(b, c), res) - -def testsetop(a, b, res, stmt="a+=b", meth="__iadd__"): - if verbose: print "checking", stmt - dict = {'a': deepcopy(a), 'b': b} - exec stmt in dict - vereq(dict['a'], res) - t = type(a) - m = getattr(t, meth) - while meth not in t.__dict__: - t = t.__bases__[0] - vereq(m, t.__dict__[meth]) - dict['a'] = deepcopy(a) - m(dict['a'], b) - vereq(dict['a'], res) - dict['a'] = deepcopy(a) - bm = getattr(dict['a'], meth) - bm(b) - vereq(dict['a'], res) - -def testset2op(a, b, c, res, stmt="a[b]=c", meth="__setitem__"): - if verbose: print "checking", stmt - dict = {'a': deepcopy(a), 'b': b, 'c': c} - exec stmt in dict - vereq(dict['a'], res) - t = type(a) - m = getattr(t, meth) - while meth not in t.__dict__: - t = t.__bases__[0] - vereq(m, t.__dict__[meth]) - dict['a'] = deepcopy(a) - m(dict['a'], b, c) - vereq(dict['a'], res) - dict['a'] = deepcopy(a) - bm = getattr(dict['a'], meth) - bm(b, c) - vereq(dict['a'], res) - -def testset3op(a, b, c, d, res, stmt="a[b:c]=d", meth="__setslice__"): - if verbose: print "checking", stmt - dict = {'a': deepcopy(a), 'b': b, 'c': c, 'd': d} - exec stmt in dict - vereq(dict['a'], res) - t = type(a) - while meth not in t.__dict__: - t = t.__bases__[0] - m = getattr(t, meth) - vereq(m, t.__dict__[meth]) - dict['a'] = deepcopy(a) - m(dict['a'], b, c, d) - vereq(dict['a'], res) - dict['a'] = deepcopy(a) - bm = getattr(dict['a'], meth) - bm(b, c, d) - vereq(dict['a'], res) - -def class_docstrings(): - class Classic: - "A classic docstring." - vereq(Classic.__doc__, "A classic docstring.") - vereq(Classic.__dict__['__doc__'], "A classic docstring.") - - class Classic2: - pass - verify(Classic2.__doc__ is None) - - class NewStatic(object): - "Another docstring." - vereq(NewStatic.__doc__, "Another docstring.") - vereq(NewStatic.__dict__['__doc__'], "Another docstring.") - - class NewStatic2(object): - pass - verify(NewStatic2.__doc__ is None) - - class NewDynamic(object): - "Another docstring." - vereq(NewDynamic.__doc__, "Another docstring.") - vereq(NewDynamic.__dict__['__doc__'], "Another docstring.") - - class NewDynamic2(object): - pass - verify(NewDynamic2.__doc__ is None) - -def lists(): - if verbose: print "Testing list operations..." - testbinop([1], [2], [1,2], "a+b", "__add__") - testbinop([1,2,3], 2, 1, "b in a", "__contains__") - testbinop([1,2,3], 4, 0, "b in a", "__contains__") - testbinop([1,2,3], 1, 2, "a[b]", "__getitem__") - testternop([1,2,3], 0, 2, [1,2], "a[b:c]", "__getslice__") - testsetop([1], [2], [1,2], "a+=b", "__iadd__") - testsetop([1,2], 3, [1,2,1,2,1,2], "a*=b", "__imul__") - testunop([1,2,3], 3, "len(a)", "__len__") - testbinop([1,2], 3, [1,2,1,2,1,2], "a*b", "__mul__") - testbinop([1,2], 3, [1,2,1,2,1,2], "b*a", "__rmul__") - testset2op([1,2], 1, 3, [1,3], "a[b]=c", "__setitem__") - testset3op([1,2,3,4], 1, 3, [5,6], [1,5,6,4], "a[b:c]=d", "__setslice__") - -def dicts(): - if verbose: print "Testing dict operations..." - testbinop({1:2}, {2:1}, -1, "cmp(a,b)", "__cmp__") - testbinop({1:2,3:4}, 1, 1, "b in a", "__contains__") - testbinop({1:2,3:4}, 2, 0, "b in a", "__contains__") - testbinop({1:2,3:4}, 1, 2, "a[b]", "__getitem__") - d = {1:2,3:4} - l1 = [] - for i in d.keys(): l1.append(i) - l = [] - for i in iter(d): l.append(i) - vereq(l, l1) - l = [] - for i in d.__iter__(): l.append(i) - vereq(l, l1) - l = [] - for i in dict.__iter__(d): l.append(i) - vereq(l, l1) - d = {1:2, 3:4} - testunop(d, 2, "len(a)", "__len__") - vereq(eval(repr(d), {}), d) - vereq(eval(d.__repr__(), {}), d) - testset2op({1:2,3:4}, 2, 3, {1:2,2:3,3:4}, "a[b]=c", "__setitem__") - -def dict_constructor(): - if verbose: - print "Testing dict constructor ..." - d = dict() - vereq(d, {}) - d = dict({}) - vereq(d, {}) - d = dict({1: 2, 'a': 'b'}) - vereq(d, {1: 2, 'a': 'b'}) - vereq(d, dict(d.items())) - vereq(d, dict(d.iteritems())) - d = dict({'one':1, 'two':2}) - vereq(d, dict(one=1, two=2)) - vereq(d, dict(**d)) - vereq(d, dict({"one": 1}, two=2)) - vereq(d, dict([("two", 2)], one=1)) - vereq(d, dict([("one", 100), ("two", 200)], **d)) - verify(d is not dict(**d)) - for badarg in 0, 0L, 0j, "0", [0], (0,): - try: - dict(badarg) - except TypeError: - pass - except ValueError: - if badarg == "0": - # It's a sequence, and its elements are also sequences (gotta - # love strings ), but they aren't of length 2, so this - # one seemed better as a ValueError than a TypeError. + for badarg in 0, 0L, 0j, "0", [0], (0,): + try: + dict(badarg) + except TypeError: pass + except ValueError: + if badarg == "0": + # It's a sequence, and its elements are also sequences (gotta + # love strings ), but they aren't of length 2, so this + # one seemed better as a ValueError than a TypeError. + pass + else: + self.fail("no TypeError from dict(%r)" % badarg) else: - raise TestFailed("no TypeError from dict(%r)" % badarg) + self.fail("no TypeError from dict(%r)" % badarg) + + try: + dict({}, {}) + except TypeError: + pass else: - raise TestFailed("no TypeError from dict(%r)" % badarg) + self.fail("no TypeError from dict({}, {})") - try: - dict({}, {}) - except TypeError: - pass - else: - raise TestFailed("no TypeError from dict({}, {})") - - class Mapping: - # Lacks a .keys() method; will be added later. - dict = {1:2, 3:4, 'a':1j} - - try: - dict(Mapping()) - except TypeError: - pass - else: - raise TestFailed("no TypeError from dict(incomplete mapping)") - - Mapping.keys = lambda self: self.dict.keys() - Mapping.__getitem__ = lambda self, i: self.dict[i] - d = dict(Mapping()) - vereq(d, Mapping.dict) - - # Init from sequence of iterable objects, each producing a 2-sequence. - class AddressBookEntry: - def __init__(self, first, last): - self.first = first - self.last = last - def __iter__(self): - return iter([self.first, self.last]) - - d = dict([AddressBookEntry('Tim', 'Warsaw'), - AddressBookEntry('Barry', 'Peters'), - AddressBookEntry('Tim', 'Peters'), - AddressBookEntry('Barry', 'Warsaw')]) - vereq(d, {'Barry': 'Warsaw', 'Tim': 'Peters'}) - - d = dict(zip(range(4), range(1, 5))) - vereq(d, dict([(i, i+1) for i in range(4)])) - - # Bad sequence lengths. - for bad in [('tooshort',)], [('too', 'long', 'by 1')]: - try: - dict(bad) - except ValueError: - pass - else: - raise TestFailed("no ValueError from dict(%r)" % bad) - -def test_dir(): - if verbose: - print "Testing dir() ..." - junk = 12 - vereq(dir(), ['junk']) - del junk - - # Just make sure these don't blow up! - for arg in 2, 2L, 2j, 2e0, [2], "2", u"2", (2,), {2:2}, type, test_dir: - dir(arg) - - # Try classic classes. - class C: - Cdata = 1 - def Cmethod(self): pass - - cstuff = ['Cdata', 'Cmethod', '__doc__', '__module__'] - vereq(dir(C), cstuff) - verify('im_self' in dir(C.Cmethod)) - - c = C() # c.__doc__ is an odd thing to see here; ditto c.__module__. - vereq(dir(c), cstuff) - - c.cdata = 2 - c.cmethod = lambda self: 0 - vereq(dir(c), cstuff + ['cdata', 'cmethod']) - verify('im_self' in dir(c.Cmethod)) - - class A(C): - Adata = 1 - def Amethod(self): pass - - astuff = ['Adata', 'Amethod'] + cstuff - vereq(dir(A), astuff) - verify('im_self' in dir(A.Amethod)) - a = A() - vereq(dir(a), astuff) - verify('im_self' in dir(a.Amethod)) - a.adata = 42 - a.amethod = lambda self: 3 - vereq(dir(a), astuff + ['adata', 'amethod']) - - # The same, but with new-style classes. Since these have object as a - # base class, a lot more gets sucked in. - def interesting(strings): - return [s for s in strings if not s.startswith('_')] - - class C(object): - Cdata = 1 - def Cmethod(self): pass - - cstuff = ['Cdata', 'Cmethod'] - vereq(interesting(dir(C)), cstuff) - - c = C() - vereq(interesting(dir(c)), cstuff) - verify('im_self' in dir(C.Cmethod)) - - c.cdata = 2 - c.cmethod = lambda self: 0 - vereq(interesting(dir(c)), cstuff + ['cdata', 'cmethod']) - verify('im_self' in dir(c.Cmethod)) - - class A(C): - Adata = 1 - def Amethod(self): pass - - astuff = ['Adata', 'Amethod'] + cstuff - vereq(interesting(dir(A)), astuff) - verify('im_self' in dir(A.Amethod)) - a = A() - vereq(interesting(dir(a)), astuff) - a.adata = 42 - a.amethod = lambda self: 3 - vereq(interesting(dir(a)), astuff + ['adata', 'amethod']) - verify('im_self' in dir(a.Amethod)) - - # Try a module subclass. - import sys - class M(type(sys)): - pass - minstance = M("m") - minstance.b = 2 - minstance.a = 1 - names = [x for x in dir(minstance) if x not in ["__name__", "__doc__"]] - vereq(names, ['a', 'b']) - - class M2(M): - def getdict(self): - return "Not a dict!" - __dict__ = property(getdict) - - m2instance = M2("m2") - m2instance.b = 2 - m2instance.a = 1 - vereq(m2instance.__dict__, "Not a dict!") - try: - dir(m2instance) - except TypeError: - pass - - # Two essentially featureless objects, just inheriting stuff from - # object. - vereq(dir(None), dir(Ellipsis)) - - # Nasty test case for proxied objects - class Wrapper(object): - def __init__(self, obj): - self.__obj = obj - def __repr__(self): - return "Wrapper(%s)" % repr(self.__obj) - def __getitem__(self, key): - return Wrapper(self.__obj[key]) - def __len__(self): - return len(self.__obj) - def __getattr__(self, name): - return Wrapper(getattr(self.__obj, name)) + class Mapping: + # Lacks a .keys() method; will be added later. + dict = {1:2, 3:4, 'a':1j} - class C(object): - def __getclass(self): - return Wrapper(type(self)) - __class__ = property(__getclass) - - dir(C()) # This used to segfault - -binops = { - 'add': '+', - 'sub': '-', - 'mul': '*', - 'div': '/', - 'mod': '%', - 'divmod': 'divmod', - 'pow': '**', - 'lshift': '<<', - 'rshift': '>>', - 'and': '&', - 'xor': '^', - 'or': '|', - 'cmp': 'cmp', - 'lt': '<', - 'le': '<=', - 'eq': '==', - 'ne': '!=', - 'gt': '>', - 'ge': '>=', - } - -for name, expr in binops.items(): - if expr.islower(): - expr = expr + "(a, b)" - else: - expr = 'a %s b' % expr - binops[name] = expr - -unops = { - 'pos': '+', - 'neg': '-', - 'abs': 'abs', - 'invert': '~', - 'int': 'int', - 'long': 'long', - 'float': 'float', - 'oct': 'oct', - 'hex': 'hex', - } - -for name, expr in unops.items(): - if expr.islower(): - expr = expr + "(a)" - else: - expr = '%s a' % expr - unops[name] = expr - -def numops(a, b, skip=[]): - dict = {'a': a, 'b': b} - for name, expr in binops.items(): - if name not in skip: - name = "__%s__" % name - if hasattr(a, name): - res = eval(expr, dict) - testbinop(a, b, res, expr, name) - for name, expr in unops.items(): - if name not in skip: - name = "__%s__" % name - if hasattr(a, name): - res = eval(expr, dict) - testunop(a, res, expr, name) - -def ints(): - if verbose: print "Testing int operations..." - numops(100, 3) - # The following crashes in Python 2.2 - vereq((1).__nonzero__(), 1) - vereq((0).__nonzero__(), 0) - # This returns 'NotImplemented' in Python 2.2 - class C(int): - def __add__(self, other): - return NotImplemented - vereq(C(5L), 5) - try: - C() + "" - except TypeError: - pass - else: - raise TestFailed, "NotImplemented should have caused TypeError" - import sys - try: - C(sys.maxint+1) - except OverflowError: - pass - else: - raise TestFailed, "should have raised OverflowError" - -def longs(): - if verbose: print "Testing long operations..." - numops(100L, 3L) - -def floats(): - if verbose: print "Testing float operations..." - numops(100.0, 3.0) - -def complexes(): - if verbose: print "Testing complex operations..." - numops(100.0j, 3.0j, skip=['lt', 'le', 'gt', 'ge', 'int', 'long', 'float']) - class Number(complex): - __slots__ = ['prec'] - def __new__(cls, *args, **kwds): - result = complex.__new__(cls, *args) - result.prec = kwds.get('prec', 12) - return result - def __repr__(self): - prec = self.prec - if self.imag == 0.0: - return "%.*g" % (prec, self.real) - if self.real == 0.0: - return "%.*gj" % (prec, self.imag) - return "(%.*g+%.*gj)" % (prec, self.real, prec, self.imag) - __str__ = __repr__ - - a = Number(3.14, prec=6) - vereq(repr(a), "3.14") - vereq(a.prec, 6) - - a = Number(a, prec=2) - vereq(repr(a), "3.1") - vereq(a.prec, 2) - - a = Number(234.5) - vereq(repr(a), "234.5") - vereq(a.prec, 12) - -def spamlists(): - if verbose: print "Testing spamlist operations..." - import copy, xxsubtype as spam - def spamlist(l, memo=None): - import xxsubtype as spam - return spam.spamlist(l) - # This is an ugly hack: - copy._deepcopy_dispatch[spam.spamlist] = spamlist - - testbinop(spamlist([1]), spamlist([2]), spamlist([1,2]), "a+b", "__add__") - testbinop(spamlist([1,2,3]), 2, 1, "b in a", "__contains__") - testbinop(spamlist([1,2,3]), 4, 0, "b in a", "__contains__") - testbinop(spamlist([1,2,3]), 1, 2, "a[b]", "__getitem__") - testternop(spamlist([1,2,3]), 0, 2, spamlist([1,2]), - "a[b:c]", "__getslice__") - testsetop(spamlist([1]), spamlist([2]), spamlist([1,2]), - "a+=b", "__iadd__") - testsetop(spamlist([1,2]), 3, spamlist([1,2,1,2,1,2]), "a*=b", "__imul__") - testunop(spamlist([1,2,3]), 3, "len(a)", "__len__") - testbinop(spamlist([1,2]), 3, spamlist([1,2,1,2,1,2]), "a*b", "__mul__") - testbinop(spamlist([1,2]), 3, spamlist([1,2,1,2,1,2]), "b*a", "__rmul__") - testset2op(spamlist([1,2]), 1, 3, spamlist([1,3]), "a[b]=c", "__setitem__") - testset3op(spamlist([1,2,3,4]), 1, 3, spamlist([5,6]), - spamlist([1,5,6,4]), "a[b:c]=d", "__setslice__") - # Test subclassing - class C(spam.spamlist): - def foo(self): return 1 - a = C() - vereq(a, []) - vereq(a.foo(), 1) - a.append(100) - vereq(a, [100]) - vereq(a.getstate(), 0) - a.setstate(42) - vereq(a.getstate(), 42) - -def spamdicts(): - if verbose: print "Testing spamdict operations..." - import copy, xxsubtype as spam - def spamdict(d, memo=None): - import xxsubtype as spam - sd = spam.spamdict() - for k, v in d.items(): sd[k] = v - return sd - # This is an ugly hack: - copy._deepcopy_dispatch[spam.spamdict] = spamdict - - testbinop(spamdict({1:2}), spamdict({2:1}), -1, "cmp(a,b)", "__cmp__") - testbinop(spamdict({1:2,3:4}), 1, 1, "b in a", "__contains__") - testbinop(spamdict({1:2,3:4}), 2, 0, "b in a", "__contains__") - testbinop(spamdict({1:2,3:4}), 1, 2, "a[b]", "__getitem__") - d = spamdict({1:2,3:4}) - l1 = [] - for i in d.keys(): l1.append(i) - l = [] - for i in iter(d): l.append(i) - vereq(l, l1) - l = [] - for i in d.__iter__(): l.append(i) - vereq(l, l1) - l = [] - for i in type(spamdict({})).__iter__(d): l.append(i) - vereq(l, l1) - straightd = {1:2, 3:4} - spamd = spamdict(straightd) - testunop(spamd, 2, "len(a)", "__len__") - testunop(spamd, repr(straightd), "repr(a)", "__repr__") - testset2op(spamdict({1:2,3:4}), 2, 3, spamdict({1:2,2:3,3:4}), - "a[b]=c", "__setitem__") - # Test subclassing - class C(spam.spamdict): - def foo(self): return 1 - a = C() - vereq(a.items(), []) - vereq(a.foo(), 1) - a['foo'] = 'bar' - vereq(a.items(), [('foo', 'bar')]) - vereq(a.getstate(), 0) - a.setstate(100) - vereq(a.getstate(), 100) - -def pydicts(): - if verbose: print "Testing Python subclass of dict..." - verify(issubclass(dict, dict)) - verify(isinstance({}, dict)) - d = dict() - vereq(d, {}) - verify(d.__class__ is dict) - verify(isinstance(d, dict)) - class C(dict): - state = -1 - def __init__(self, *a, **kw): - if a: - vereq(len(a), 1) - self.state = a[0] - if kw: - for k, v in kw.items(): self[v] = k - def __getitem__(self, key): - return self.get(key, 0) - def __setitem__(self, key, value): - verify(isinstance(key, type(0))) - dict.__setitem__(self, key, value) - def setstate(self, state): - self.state = state - def getstate(self): - return self.state - verify(issubclass(C, dict)) - a1 = C(12) - vereq(a1.state, 12) - a2 = C(foo=1, bar=2) - vereq(a2[1] == 'foo' and a2[2], 'bar') - a = C() - vereq(a.state, -1) - vereq(a.getstate(), -1) - a.setstate(0) - vereq(a.state, 0) - vereq(a.getstate(), 0) - a.setstate(10) - vereq(a.state, 10) - vereq(a.getstate(), 10) - vereq(a[42], 0) - a[42] = 24 - vereq(a[42], 24) - if verbose: print "pydict stress test ..." - N = 50 - for i in range(N): - a[i] = C() - for j in range(N): - a[i][j] = i*j - for i in range(N): - for j in range(N): - vereq(a[i][j], i*j) - -def pylists(): - if verbose: print "Testing Python subclass of list..." - class C(list): - def __getitem__(self, i): - return list.__getitem__(self, i) + 100 - def __getslice__(self, i, j): - return (i, j) - a = C() - a.extend([0,1,2]) - vereq(a[0], 100) - vereq(a[1], 101) - vereq(a[2], 102) - vereq(a[100:200], (100,200)) - -def metaclass(): - if verbose: print "Testing __metaclass__..." - class C: - __metaclass__ = type - def __init__(self): - self.__state = 0 - def getstate(self): - return self.__state - def setstate(self, state): - self.__state = state - a = C() - vereq(a.getstate(), 0) - a.setstate(10) - vereq(a.getstate(), 10) - class D: - class __metaclass__(type): - def myself(cls): return cls - vereq(D.myself(), D) - d = D() - verify(d.__class__ is D) - class M1(type): - def __new__(cls, name, bases, dict): - dict['__spam__'] = 1 - return type.__new__(cls, name, bases, dict) - class C: - __metaclass__ = M1 - vereq(C.__spam__, 1) - c = C() - vereq(c.__spam__, 1) - - class _instance(object): - pass - class M2(object): - @staticmethod - def __new__(cls, name, bases, dict): - self = object.__new__(cls) - self.name = name - self.bases = bases - self.dict = dict - return self - def __call__(self): - it = _instance() - # Early binding of methods - for key in self.dict: - if key.startswith("__"): + try: + dict(Mapping()) + except TypeError: + pass + else: + self.fail("no TypeError from dict(incomplete mapping)") + + Mapping.keys = lambda self: self.dict.keys() + Mapping.__getitem__ = lambda self, i: self.dict[i] + d = dict(Mapping()) + self.assertEqual(d, Mapping.dict) + + # Init from sequence of iterable objects, each producing a 2-sequence. + class AddressBookEntry: + def __init__(self, first, last): + self.first = first + self.last = last + def __iter__(self): + return iter([self.first, self.last]) + + d = dict([AddressBookEntry('Tim', 'Warsaw'), + AddressBookEntry('Barry', 'Peters'), + AddressBookEntry('Tim', 'Peters'), + AddressBookEntry('Barry', 'Warsaw')]) + self.assertEqual(d, {'Barry': 'Warsaw', 'Tim': 'Peters'}) + + d = dict(zip(range(4), range(1, 5))) + self.assertEqual(d, dict([(i, i+1) for i in range(4)])) + + # Bad sequence lengths. + for bad in [('tooshort',)], [('too', 'long', 'by 1')]: + try: + dict(bad) + except ValueError: + pass + else: + self.fail("no ValueError from dict(%r)" % bad) + + def test_dir(self): + # Testing dir() ... + junk = 12 + self.assertEqual(dir(), ['junk', 'self']) + del junk + + # Just make sure these don't blow up! + for arg in 2, 2L, 2j, 2e0, [2], "2", u"2", (2,), {2:2}, type, self.test_dir: + dir(arg) + + # Try classic classes. + class C: + Cdata = 1 + def Cmethod(self): pass + + cstuff = ['Cdata', 'Cmethod', '__doc__', '__module__'] + self.assertEqual(dir(C), cstuff) + self.assert_('im_self' in dir(C.Cmethod)) + + c = C() # c.__doc__ is an odd thing to see here; ditto c.__module__. + self.assertEqual(dir(c), cstuff) + + c.cdata = 2 + c.cmethod = lambda self: 0 + self.assertEqual(dir(c), cstuff + ['cdata', 'cmethod']) + self.assert_('im_self' in dir(c.Cmethod)) + + class A(C): + Adata = 1 + def Amethod(self): pass + + astuff = ['Adata', 'Amethod'] + cstuff + self.assertEqual(dir(A), astuff) + self.assert_('im_self' in dir(A.Amethod)) + a = A() + self.assertEqual(dir(a), astuff) + self.assert_('im_self' in dir(a.Amethod)) + a.adata = 42 + a.amethod = lambda self: 3 + self.assertEqual(dir(a), astuff + ['adata', 'amethod']) + + # The same, but with new-style classes. Since these have object as a + # base class, a lot more gets sucked in. + def interesting(strings): + return [s for s in strings if not s.startswith('_')] + + class C(object): + Cdata = 1 + def Cmethod(self): pass + + cstuff = ['Cdata', 'Cmethod'] + self.assertEqual(interesting(dir(C)), cstuff) + + c = C() + self.assertEqual(interesting(dir(c)), cstuff) + self.assert_('im_self' in dir(C.Cmethod)) + + c.cdata = 2 + c.cmethod = lambda self: 0 + self.assertEqual(interesting(dir(c)), cstuff + ['cdata', 'cmethod']) + self.assert_('im_self' in dir(c.Cmethod)) + + class A(C): + Adata = 1 + def Amethod(self): pass + + astuff = ['Adata', 'Amethod'] + cstuff + self.assertEqual(interesting(dir(A)), astuff) + self.assert_('im_self' in dir(A.Amethod)) + a = A() + self.assertEqual(interesting(dir(a)), astuff) + a.adata = 42 + a.amethod = lambda self: 3 + self.assertEqual(interesting(dir(a)), astuff + ['adata', 'amethod']) + self.assert_('im_self' in dir(a.Amethod)) + + # Try a module subclass. + import sys + class M(type(sys)): + pass + minstance = M("m") + minstance.b = 2 + minstance.a = 1 + names = [x for x in dir(minstance) if x not in ["__name__", "__doc__"]] + self.assertEqual(names, ['a', 'b']) + + class M2(M): + def getdict(self): + return "Not a dict!" + __dict__ = property(getdict) + + m2instance = M2("m2") + m2instance.b = 2 + m2instance.a = 1 + self.assertEqual(m2instance.__dict__, "Not a dict!") + try: + dir(m2instance) + except TypeError: + pass + + # Two essentially featureless objects, just inheriting stuff from + # object. + self.assertEqual(dir(None), dir(Ellipsis)) + + # Nasty test case for proxied objects + class Wrapper(object): + def __init__(self, obj): + self.__obj = obj + def __repr__(self): + return "Wrapper(%s)" % repr(self.__obj) + def __getitem__(self, key): + return Wrapper(self.__obj[key]) + def __len__(self): + return len(self.__obj) + def __getattr__(self, name): + return Wrapper(getattr(self.__obj, name)) + + class C(object): + def __getclass(self): + return Wrapper(type(self)) + __class__ = property(__getclass) + + dir(C()) # This used to segfault + + def test_supers(self): + # Testing super... + + class A(object): + def meth(self, a): + return "A(%r)" % a + + self.assertEqual(A().meth(1), "A(1)") + + class B(A): + def __init__(self): + self.__super = super(B, self) + def meth(self, a): + return "B(%r)" % a + self.__super.meth(a) + + self.assertEqual(B().meth(2), "B(2)A(2)") + + class C(A): + def meth(self, a): + return "C(%r)" % a + self.__super.meth(a) + C._C__super = super(C) + + self.assertEqual(C().meth(3), "C(3)A(3)") + + class D(C, B): + def meth(self, a): + return "D(%r)" % a + super(D, self).meth(a) + + self.assertEqual(D().meth(4), "D(4)C(4)B(4)A(4)") + + # Test for subclassing super + + class mysuper(super): + def __init__(self, *args): + return super(mysuper, self).__init__(*args) + + class E(D): + def meth(self, a): + return "E(%r)" % a + mysuper(E, self).meth(a) + + self.assertEqual(E().meth(5), "E(5)D(5)C(5)B(5)A(5)") + + class F(E): + def meth(self, a): + s = self.__super # == mysuper(F, self) + return "F(%r)[%s]" % (a, s.__class__.__name__) + s.meth(a) + F._F__super = mysuper(F) + + self.assertEqual(F().meth(6), "F(6)[mysuper]E(6)D(6)C(6)B(6)A(6)") + + # Make sure certain errors are raised + + try: + super(D, 42) + except TypeError: + pass + else: + self.fail("shouldn't allow super(D, 42)") + + try: + super(D, C()) + except TypeError: + pass + else: + self.fail("shouldn't allow super(D, C())") + + try: + super(D).__get__(12) + except TypeError: + pass + else: + self.fail("shouldn't allow super(D).__get__(12)") + + try: + super(D).__get__(C()) + except TypeError: + pass + else: + self.fail("shouldn't allow super(D).__get__(C())") + + # Make sure data descriptors can be overridden and accessed via super + # (new feature in Python 2.3) + + class DDbase(object): + def getx(self): return 42 + x = property(getx) + + class DDsub(DDbase): + def getx(self): return "hello" + x = property(getx) + + dd = DDsub() + self.assertEqual(dd.x, "hello") + self.assertEqual(super(DDsub, dd).x, 42) + + # Ensure that super() lookup of descriptor from classmethod + # works (SF ID# 743627) + + class Base(object): + aProp = property(lambda self: "foo") + + class Sub(Base): + @classmethod + def test(klass): + return super(Sub,klass).aProp + + self.assertEqual(Sub.test(), Base.aProp) + + # Verify that super() doesn't allow keyword args + try: + super(Base, kw=1) + except TypeError: + pass + else: + self.assertEqual("super shouldn't accept keyword args") + + def test_basic_inheritance(self): + # Testing inheritance from basic types... + + class hexint(int): + def __repr__(self): + return hex(self) + def __add__(self, other): + return hexint(int.__add__(self, other)) + # (Note that overriding __radd__ doesn't work, + # because the int type gets first dibs.) + self.assertEqual(repr(hexint(7) + 9), "0x10") + self.assertEqual(repr(hexint(1000) + 7), "0x3ef") + a = hexint(12345) + self.assertEqual(a, 12345) + self.assertEqual(int(a), 12345) + self.assert_(int(a).__class__ is int) + self.assertEqual(hash(a), hash(12345)) + self.assert_((+a).__class__ is int) + self.assert_((a >> 0).__class__ is int) + self.assert_((a << 0).__class__ is int) + self.assert_((hexint(0) << 12).__class__ is int) + self.assert_((hexint(0) >> 12).__class__ is int) + + class octlong(long): + __slots__ = [] + def __str__(self): + s = oct(self) + if s[-1] == 'L': + s = s[:-1] + return s + def __add__(self, other): + return self.__class__(super(octlong, self).__add__(other)) + __radd__ = __add__ + self.assertEqual(str(octlong(3) + 5), "010") + # (Note that overriding __radd__ here only seems to work + # because the example uses a short int left argument.) + self.assertEqual(str(5 + octlong(3000)), "05675") + a = octlong(12345) + self.assertEqual(a, 12345L) + self.assertEqual(long(a), 12345L) + self.assertEqual(hash(a), hash(12345L)) + self.assert_(long(a).__class__ is long) + self.assert_((+a).__class__ is long) + self.assert_((-a).__class__ is long) + self.assert_((-octlong(0)).__class__ is long) + self.assert_((a >> 0).__class__ is long) + self.assert_((a << 0).__class__ is long) + self.assert_((a - 0).__class__ is long) + self.assert_((a * 1).__class__ is long) + self.assert_((a ** 1).__class__ is long) + self.assert_((a // 1).__class__ is long) + self.assert_((1 * a).__class__ is long) + self.assert_((a | 0).__class__ is long) + self.assert_((a ^ 0).__class__ is long) + self.assert_((a & -1L).__class__ is long) + self.assert_((octlong(0) << 12).__class__ is long) + self.assert_((octlong(0) >> 12).__class__ is long) + self.assert_(abs(octlong(0)).__class__ is long) + + # Because octlong overrides __add__, we can't check the absence of +0 + # optimizations using octlong. + class longclone(long): + pass + a = longclone(1) + self.assert_((a + 0).__class__ is long) + self.assert_((0 + a).__class__ is long) + + # Check that negative clones don't segfault + a = longclone(-1) + self.assertEqual(a.__dict__, {}) + self.assertEqual(long(a), -1) # self.assert_ PyNumber_Long() copies the sign bit + + class precfloat(float): + __slots__ = ['prec'] + def __init__(self, value=0.0, prec=12): + self.prec = int(prec) + def __repr__(self): + return "%.*g" % (self.prec, self) + self.assertEqual(repr(precfloat(1.1)), "1.1") + a = precfloat(12345) + self.assertEqual(a, 12345.0) + self.assertEqual(float(a), 12345.0) + self.assert_(float(a).__class__ is float) + self.assertEqual(hash(a), hash(12345.0)) + self.assert_((+a).__class__ is float) + + class madcomplex(complex): + def __repr__(self): + return "%.17gj%+.17g" % (self.imag, self.real) + a = madcomplex(-3, 4) + self.assertEqual(repr(a), "4j-3") + base = complex(-3, 4) + self.assertEqual(base.__class__, complex) + self.assertEqual(a, base) + self.assertEqual(complex(a), base) + self.assertEqual(complex(a).__class__, complex) + a = madcomplex(a) # just trying another form of the constructor + self.assertEqual(repr(a), "4j-3") + self.assertEqual(a, base) + self.assertEqual(complex(a), base) + self.assertEqual(complex(a).__class__, complex) + self.assertEqual(hash(a), hash(base)) + self.assertEqual((+a).__class__, complex) + self.assertEqual((a + 0).__class__, complex) + self.assertEqual(a + 0, base) + self.assertEqual((a - 0).__class__, complex) + self.assertEqual(a - 0, base) + self.assertEqual((a * 1).__class__, complex) + self.assertEqual(a * 1, base) + self.assertEqual((a / 1).__class__, complex) + self.assertEqual(a / 1, base) + + class madtuple(tuple): + _rev = None + def rev(self): + if self._rev is not None: + return self._rev + L = list(self) + L.reverse() + self._rev = self.__class__(L) + return self._rev + a = madtuple((1,2,3,4,5,6,7,8,9,0)) + self.assertEqual(a, (1,2,3,4,5,6,7,8,9,0)) + self.assertEqual(a.rev(), madtuple((0,9,8,7,6,5,4,3,2,1))) + self.assertEqual(a.rev().rev(), madtuple((1,2,3,4,5,6,7,8,9,0))) + for i in range(512): + t = madtuple(range(i)) + u = t.rev() + v = u.rev() + self.assertEqual(v, t) + a = madtuple((1,2,3,4,5)) + self.assertEqual(tuple(a), (1,2,3,4,5)) + self.assert_(tuple(a).__class__ is tuple) + self.assertEqual(hash(a), hash((1,2,3,4,5))) + self.assert_(a[:].__class__ is tuple) + self.assert_((a * 1).__class__ is tuple) + self.assert_((a * 0).__class__ is tuple) + self.assert_((a + ()).__class__ is tuple) + a = madtuple(()) + self.assertEqual(tuple(a), ()) + self.assert_(tuple(a).__class__ is tuple) + self.assert_((a + a).__class__ is tuple) + self.assert_((a * 0).__class__ is tuple) + self.assert_((a * 1).__class__ is tuple) + self.assert_((a * 2).__class__ is tuple) + self.assert_(a[:].__class__ is tuple) + + class madstring(str): + _rev = None + def rev(self): + if self._rev is not None: + return self._rev + L = list(self) + L.reverse() + self._rev = self.__class__("".join(L)) + return self._rev + s = madstring("abcdefghijklmnopqrstuvwxyz") + self.assertEqual(s, "abcdefghijklmnopqrstuvwxyz") + self.assertEqual(s.rev(), madstring("zyxwvutsrqponmlkjihgfedcba")) + self.assertEqual(s.rev().rev(), madstring("abcdefghijklmnopqrstuvwxyz")) + for i in range(256): + s = madstring("".join(map(chr, range(i)))) + t = s.rev() + u = t.rev() + self.assertEqual(u, s) + s = madstring("12345") + self.assertEqual(str(s), "12345") + self.assert_(str(s).__class__ is str) + + base = "\x00" * 5 + s = madstring(base) + self.assertEqual(s, base) + self.assertEqual(str(s), base) + self.assert_(str(s).__class__ is str) + self.assertEqual(hash(s), hash(base)) + self.assertEqual({s: 1}[base], 1) + self.assertEqual({base: 1}[s], 1) + self.assert_((s + "").__class__ is str) + self.assertEqual(s + "", base) + self.assert_(("" + s).__class__ is str) + self.assertEqual("" + s, base) + self.assert_((s * 0).__class__ is str) + self.assertEqual(s * 0, "") + self.assert_((s * 1).__class__ is str) + self.assertEqual(s * 1, base) + self.assert_((s * 2).__class__ is str) + self.assertEqual(s * 2, base + base) + self.assert_(s[:].__class__ is str) + self.assertEqual(s[:], base) + self.assert_(s[0:0].__class__ is str) + self.assertEqual(s[0:0], "") + self.assert_(s.strip().__class__ is str) + self.assertEqual(s.strip(), base) + self.assert_(s.lstrip().__class__ is str) + self.assertEqual(s.lstrip(), base) + self.assert_(s.rstrip().__class__ is str) + self.assertEqual(s.rstrip(), base) + identitytab = ''.join([chr(i) for i in range(256)]) + self.assert_(s.translate(identitytab).__class__ is str) + self.assertEqual(s.translate(identitytab), base) + self.assert_(s.translate(identitytab, "x").__class__ is str) + self.assertEqual(s.translate(identitytab, "x"), base) + self.assertEqual(s.translate(identitytab, "\x00"), "") + self.assert_(s.replace("x", "x").__class__ is str) + self.assertEqual(s.replace("x", "x"), base) + self.assert_(s.ljust(len(s)).__class__ is str) + self.assertEqual(s.ljust(len(s)), base) + self.assert_(s.rjust(len(s)).__class__ is str) + self.assertEqual(s.rjust(len(s)), base) + self.assert_(s.center(len(s)).__class__ is str) + self.assertEqual(s.center(len(s)), base) + self.assert_(s.lower().__class__ is str) + self.assertEqual(s.lower(), base) + + class madunicode(unicode): + _rev = None + def rev(self): + if self._rev is not None: + return self._rev + L = list(self) + L.reverse() + self._rev = self.__class__(u"".join(L)) + return self._rev + u = madunicode("ABCDEF") + self.assertEqual(u, u"ABCDEF") + self.assertEqual(u.rev(), madunicode(u"FEDCBA")) + self.assertEqual(u.rev().rev(), madunicode(u"ABCDEF")) + base = u"12345" + u = madunicode(base) + self.assertEqual(unicode(u), base) + self.assert_(unicode(u).__class__ is unicode) + self.assertEqual(hash(u), hash(base)) + self.assertEqual({u: 1}[base], 1) + self.assertEqual({base: 1}[u], 1) + self.assert_(u.strip().__class__ is unicode) + self.assertEqual(u.strip(), base) + self.assert_(u.lstrip().__class__ is unicode) + self.assertEqual(u.lstrip(), base) + self.assert_(u.rstrip().__class__ is unicode) + self.assertEqual(u.rstrip(), base) + self.assert_(u.replace(u"x", u"x").__class__ is unicode) + self.assertEqual(u.replace(u"x", u"x"), base) + self.assert_(u.replace(u"xy", u"xy").__class__ is unicode) + self.assertEqual(u.replace(u"xy", u"xy"), base) + self.assert_(u.center(len(u)).__class__ is unicode) + self.assertEqual(u.center(len(u)), base) + self.assert_(u.ljust(len(u)).__class__ is unicode) + self.assertEqual(u.ljust(len(u)), base) + self.assert_(u.rjust(len(u)).__class__ is unicode) + self.assertEqual(u.rjust(len(u)), base) + self.assert_(u.lower().__class__ is unicode) + self.assertEqual(u.lower(), base) + self.assert_(u.upper().__class__ is unicode) + self.assertEqual(u.upper(), base) + self.assert_(u.capitalize().__class__ is unicode) + self.assertEqual(u.capitalize(), base) + self.assert_(u.title().__class__ is unicode) + self.assertEqual(u.title(), base) + self.assert_((u + u"").__class__ is unicode) + self.assertEqual(u + u"", base) + self.assert_((u"" + u).__class__ is unicode) + self.assertEqual(u"" + u, base) + self.assert_((u * 0).__class__ is unicode) + self.assertEqual(u * 0, u"") + self.assert_((u * 1).__class__ is unicode) + self.assertEqual(u * 1, base) + self.assert_((u * 2).__class__ is unicode) + self.assertEqual(u * 2, base + base) + self.assert_(u[:].__class__ is unicode) + self.assertEqual(u[:], base) + self.assert_(u[0:0].__class__ is unicode) + self.assertEqual(u[0:0], u"") + + class sublist(list): + pass + a = sublist(range(5)) + self.assertEqual(a, range(5)) + a.append("hello") + self.assertEqual(a, range(5) + ["hello"]) + a[5] = 5 + self.assertEqual(a, range(6)) + a.extend(range(6, 20)) + self.assertEqual(a, range(20)) + a[-5:] = [] + self.assertEqual(a, range(15)) + del a[10:15] + self.assertEqual(len(a), 10) + self.assertEqual(a, range(10)) + self.assertEqual(list(a), range(10)) + self.assertEqual(a[0], 0) + self.assertEqual(a[9], 9) + self.assertEqual(a[-10], 0) + self.assertEqual(a[-1], 9) + self.assertEqual(a[:5], range(5)) + + class CountedInput(file): + """Counts lines read by self.readline(). + + self.lineno is the 0-based ordinal of the last line read, up to + a maximum of one greater than the number of lines in the file. + + self.ateof is true if and only if the final "" line has been read, + at which point self.lineno stops incrementing, and further calls + to readline() continue to return "". + """ + + lineno = 0 + ateof = 0 + def readline(self): + if self.ateof: + return "" + s = file.readline(self) + # Next line works too. + # s = super(CountedInput, self).readline() + self.lineno += 1 + if s == "": + self.ateof = 1 + return s + + f = file(name=test_support.TESTFN, mode='w') + lines = ['a\n', 'b\n', 'c\n'] + try: + f.writelines(lines) + f.close() + f = CountedInput(test_support.TESTFN) + for (i, expected) in zip(range(1, 5) + [4], lines + 2 * [""]): + got = f.readline() + self.assertEqual(expected, got) + self.assertEqual(f.lineno, i) + self.assertEqual(f.ateof, (i > len(lines))) + f.close() + finally: + try: + f.close() + except: + pass + test_support.unlink(test_support.TESTFN) + + def test_keywords(self): + # Testing keyword args to basic type constructors ... + self.assertEqual(int(x=1), 1) + self.assertEqual(float(x=2), 2.0) + self.assertEqual(long(x=3), 3L) + self.assertEqual(complex(imag=42, real=666), complex(666, 42)) + self.assertEqual(str(object=500), '500') + self.assertEqual(unicode(string='abc', errors='strict'), u'abc') + self.assertEqual(tuple(sequence=range(3)), (0, 1, 2)) + self.assertEqual(list(sequence=(0, 1, 2)), range(3)) + # note: as of Python 2.3, dict() no longer has an "items" keyword arg + + for constructor in (int, float, long, complex, str, unicode, + tuple, list, file): + try: + constructor(bogus_keyword_arg=1) + except TypeError: + pass + else: + self.fail("expected TypeError from bogus keyword argument to %r" + % constructor) + + def test_str_subclass_as_dict_key(self): + # Testing a str subclass used as dict key .. + + class cistr(str): + """Sublcass of str that computes __eq__ case-insensitively. + + Also computes a hash code of the string in canonical form. + """ + + def __init__(self, value): + self.canonical = value.lower() + self.hashcode = hash(self.canonical) + + def __eq__(self, other): + if not isinstance(other, cistr): + other = cistr(other) + return self.canonical == other.canonical + + def __hash__(self): + return self.hashcode + + self.assertEqual(cistr('ABC'), 'abc') + self.assertEqual('aBc', cistr('ABC')) + self.assertEqual(str(cistr('ABC')), 'ABC') + + d = {cistr('one'): 1, cistr('two'): 2, cistr('tHree'): 3} + self.assertEqual(d[cistr('one')], 1) + self.assertEqual(d[cistr('tWo')], 2) + self.assertEqual(d[cistr('THrEE')], 3) + self.assert_(cistr('ONe') in d) + self.assertEqual(d.get(cistr('thrEE')), 3) + + def test_classic_comparisons(self): + # Testing classic comparisons... + class classic: + pass + + for base in (classic, int, object): + class C(base): + def __init__(self, value): + self.value = int(value) + def __cmp__(self, other): + if isinstance(other, C): + return cmp(self.value, other.value) + if isinstance(other, int) or isinstance(other, long): + return cmp(self.value, other) + return NotImplemented + + c1 = C(1) + c2 = C(2) + c3 = C(3) + self.assertEqual(c1, 1) + c = {1: c1, 2: c2, 3: c3} + for x in 1, 2, 3: + for y in 1, 2, 3: + self.assert_(cmp(c[x], c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y)) + for op in "<", "<=", "==", "!=", ">", ">=": + self.assert_(eval("c[x] %s c[y]" % op) == eval("x %s y" % op), + "x=%d, y=%d" % (x, y)) + self.assert_(cmp(c[x], y) == cmp(x, y), "x=%d, y=%d" % (x, y)) + self.assert_(cmp(x, c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y)) + + def test_rich_comparisons(self): + # Testing rich comparisons... + class Z(complex): + pass + z = Z(1) + self.assertEqual(z, 1+0j) + self.assertEqual(1+0j, z) + class ZZ(complex): + def __eq__(self, other): + try: + return abs(self - other) <= 1e-6 + except: + return NotImplemented + zz = ZZ(1.0000003) + self.assertEqual(zz, 1+0j) + self.assertEqual(1+0j, zz) + + class classic: + pass + for base in (classic, int, object, list): + class C(base): + def __init__(self, value): + self.value = int(value) + def __cmp__(self_, other): + self.fail("shouldn't call __cmp__") + def __eq__(self, other): + if isinstance(other, C): + return self.value == other.value + if isinstance(other, int) or isinstance(other, long): + return self.value == other + return NotImplemented + def __ne__(self, other): + if isinstance(other, C): + return self.value != other.value + if isinstance(other, int) or isinstance(other, long): + return self.value != other + return NotImplemented + def __lt__(self, other): + if isinstance(other, C): + return self.value < other.value + if isinstance(other, int) or isinstance(other, long): + return self.value < other + return NotImplemented + def __le__(self, other): + if isinstance(other, C): + return self.value <= other.value + if isinstance(other, int) or isinstance(other, long): + return self.value <= other + return NotImplemented + def __gt__(self, other): + if isinstance(other, C): + return self.value > other.value + if isinstance(other, int) or isinstance(other, long): + return self.value > other + return NotImplemented + def __ge__(self, other): + if isinstance(other, C): + return self.value >= other.value + if isinstance(other, int) or isinstance(other, long): + return self.value >= other + return NotImplemented + c1 = C(1) + c2 = C(2) + c3 = C(3) + self.assertEqual(c1, 1) + c = {1: c1, 2: c2, 3: c3} + for x in 1, 2, 3: + for y in 1, 2, 3: + for op in "<", "<=", "==", "!=", ">", ">=": + self.assert_(eval("c[x] %s c[y]" % op) == eval("x %s y" % op), + "x=%d, y=%d" % (x, y)) + self.assert_(eval("c[x] %s y" % op) == eval("x %s y" % op), + "x=%d, y=%d" % (x, y)) + self.assert_(eval("x %s c[y]" % op) == eval("x %s y" % op), + "x=%d, y=%d" % (x, y)) + + def test_coercions(self): + # Testing coercions... + class I(int): pass + coerce(I(0), 0) + coerce(0, I(0)) + class L(long): pass + coerce(L(0), 0) + coerce(L(0), 0L) + coerce(0, L(0)) + coerce(0L, L(0)) + class F(float): pass + coerce(F(0), 0) + coerce(F(0), 0L) + coerce(F(0), 0.) + coerce(0, F(0)) + coerce(0L, F(0)) + coerce(0., F(0)) + class C(complex): pass + coerce(C(0), 0) + coerce(C(0), 0L) + coerce(C(0), 0.) + coerce(C(0), 0j) + coerce(0, C(0)) + coerce(0L, C(0)) + coerce(0., C(0)) + coerce(0j, C(0)) + + def test_descrdoc(self): + # Testing descriptor doc strings... + def check(descr, what): + self.assertEqual(descr.__doc__, what) + check(file.closed, "True if the file is closed") # getset descriptor + check(file.name, "file name") # member descriptor + + def test_doc_descriptor(self): + # Testing __doc__ descriptor... + # SF bug 542984 + class DocDescr(object): + def __get__(self, object, otype): + if object: + object = object.__class__.__name__ + ' instance' + if otype: + otype = otype.__name__ + return 'object=%s; type=%s' % (object, otype) + class OldClass: + __doc__ = DocDescr() + class NewClass(object): + __doc__ = DocDescr() + self.assertEqual(OldClass.__doc__, 'object=None; type=OldClass') + self.assertEqual(OldClass().__doc__, 'object=OldClass instance; type=OldClass') + self.assertEqual(NewClass.__doc__, 'object=None; type=NewClass') + self.assertEqual(NewClass().__doc__, 'object=NewClass instance; type=NewClass') + + def test_set_class(self): + # Testing __class__ assignment... + class C(object): pass + class D(object): pass + class E(object): pass + class F(D, E): pass + for cls in C, D, E, F: + for cls2 in C, D, E, F: + x = cls() + x.__class__ = cls2 + self.assert_(x.__class__ is cls2) + x.__class__ = cls + self.assert_(x.__class__ is cls) + def cant(x, C): + try: + x.__class__ = C + except TypeError: + pass + else: + self.fail("shouldn't allow %r.__class__ = %r" % (x, C)) + try: + delattr(x, "__class__") + except TypeError: + pass + else: + self.fail("shouldn't allow del %r.__class__" % x) + cant(C(), list) + cant(list(), C) + cant(C(), 1) + cant(C(), object) + cant(object(), list) + cant(list(), object) + class Int(int): __slots__ = [] + cant(2, Int) + cant(Int(), int) + cant(True, int) + cant(2, bool) + o = object() + cant(o, type(1)) + cant(o, type(None)) + del o + class G(object): + __slots__ = ["a", "b"] + class H(object): + __slots__ = ["b", "a"] + try: + unicode + except NameError: + class I(object): + __slots__ = ["a", "b"] + else: + class I(object): + __slots__ = [unicode("a"), unicode("b")] + class J(object): + __slots__ = ["c", "b"] + class K(object): + __slots__ = ["a", "b", "d"] + class L(H): + __slots__ = ["e"] + class M(I): + __slots__ = ["e"] + class N(J): + __slots__ = ["__weakref__"] + class P(J): + __slots__ = ["__dict__"] + class Q(J): + pass + class R(J): + __slots__ = ["__dict__", "__weakref__"] + + for cls, cls2 in ((G, H), (G, I), (I, H), (Q, R), (R, Q)): + x = cls() + x.a = 1 + x.__class__ = cls2 + self.assert_(x.__class__ is cls2, + "assigning %r as __class__ for %r silently failed" % (cls2, x)) + self.assertEqual(x.a, 1) + x.__class__ = cls + self.assert_(x.__class__ is cls, + "assigning %r as __class__ for %r silently failed" % (cls, x)) + self.assertEqual(x.a, 1) + for cls in G, J, K, L, M, N, P, R, list, Int: + for cls2 in G, J, K, L, M, N, P, R, list, Int: + if cls is cls2: continue - setattr(it, key, self.dict[key].__get__(it, self)) - return it - class C: - __metaclass__ = M2 - def spam(self): - return 42 - vereq(C.name, 'C') - vereq(C.bases, ()) - verify('spam' in C.dict) - c = C() - vereq(c.spam(), 42) - - # More metaclass examples - - class autosuper(type): - # Automatically add __super to the class - # This trick only works for dynamic classes - def __new__(metaclass, name, bases, dict): - cls = super(autosuper, metaclass).__new__(metaclass, - name, bases, dict) - # Name mangling for __super removes leading underscores - while name[:1] == "_": - name = name[1:] - if name: - name = "_%s__super" % name + cant(cls(), cls2) + + def test_set_dict(self): + # Testing __dict__ assignment... + class C(object): pass + a = C() + a.__dict__ = {'b': 1} + self.assertEqual(a.b, 1) + def cant(x, dict): + try: + x.__dict__ = dict + except (AttributeError, TypeError): + pass + else: + self.fail("shouldn't allow %r.__dict__ = %r" % (x, dict)) + cant(a, None) + cant(a, []) + cant(a, 1) + del a.__dict__ # Deleting __dict__ is allowed + + class Base(object): + pass + def verify_dict_readonly(x): + """ + x has to be an instance of a class inheriting from Base. + """ + cant(x, {}) + try: + del x.__dict__ + except (AttributeError, TypeError): + pass + else: + self.fail("shouldn't allow del %r.__dict__" % x) + dict_descr = Base.__dict__["__dict__"] + try: + dict_descr.__set__(x, {}) + except (AttributeError, TypeError): + pass else: - name = "__super" - setattr(cls, name, super(cls)) - return cls - class A: - __metaclass__ = autosuper - def meth(self): - return "A" - class B(A): - def meth(self): - return "B" + self.__super.meth() - class C(A): - def meth(self): - return "C" + self.__super.meth() - class D(C, B): - def meth(self): - return "D" + self.__super.meth() - vereq(D().meth(), "DCBA") - class E(B, C): - def meth(self): - return "E" + self.__super.meth() - vereq(E().meth(), "EBCA") - - class autoproperty(type): - # Automatically create property attributes when methods - # named _get_x and/or _set_x are found - def __new__(metaclass, name, bases, dict): - hits = {} - for key, val in dict.iteritems(): - if key.startswith("_get_"): - key = key[5:] - get, set = hits.get(key, (None, None)) - get = val - hits[key] = get, set - elif key.startswith("_set_"): - key = key[5:] - get, set = hits.get(key, (None, None)) - set = val - hits[key] = get, set - for key, (get, set) in hits.iteritems(): - dict[key] = property(get, set) - return super(autoproperty, metaclass).__new__(metaclass, - name, bases, dict) - class A: - __metaclass__ = autoproperty - def _get_x(self): - return -self.__x - def _set_x(self, x): - self.__x = -x - a = A() - verify(not hasattr(a, "x")) - a.x = 12 - vereq(a.x, 12) - vereq(a._A__x, -12) - - class multimetaclass(autoproperty, autosuper): - # Merge of multiple cooperating metaclasses - pass - class A: - __metaclass__ = multimetaclass - def _get_x(self): - return "A" - class B(A): - def _get_x(self): - return "B" + self.__super._get_x() - class C(A): - def _get_x(self): - return "C" + self.__super._get_x() - class D(C, B): - def _get_x(self): - return "D" + self.__super._get_x() - vereq(D().x, "DCBA") - - # Make sure type(x) doesn't call x.__class__.__init__ - class T(type): - counter = 0 - def __init__(self, *args): - T.counter += 1 - class C: - __metaclass__ = T - vereq(T.counter, 1) - a = C() - vereq(type(a), C) - vereq(T.counter, 1) - - class C(object): pass - c = C() - try: c() - except TypeError: pass - else: raise TestFailed, "calling object w/o call method should raise TypeError" - - # Testing code to find most derived baseclass - class A(type): - def __new__(*args, **kwargs): - return type.__new__(*args, **kwargs) - - class B(object): - pass - - class C(object): - __metaclass__ = A - - # The most derived metaclass of D is A rather than type. - class D(B, C): - pass - - -def pymods(): - if verbose: print "Testing Python subclass of module..." - log = [] - import sys - MT = type(sys) - class MM(MT): - def __init__(self, name): - MT.__init__(self, name) + self.fail("dict_descr allowed access to %r's dict" % x) + + # Classes don't allow __dict__ assignment and have readonly dicts + class Meta1(type, Base): + pass + class Meta2(Base, type): + pass + class D(object): + __metaclass__ = Meta1 + class E(object): + __metaclass__ = Meta2 + for cls in C, D, E: + verify_dict_readonly(cls) + class_dict = cls.__dict__ + try: + class_dict["spam"] = "eggs" + except TypeError: + pass + else: + self.fail("%r's __dict__ can be modified" % cls) + + # Modules also disallow __dict__ assignment + class Module1(types.ModuleType, Base): + pass + class Module2(Base, types.ModuleType): + pass + for ModuleType in Module1, Module2: + mod = ModuleType("spam") + verify_dict_readonly(mod) + mod.__dict__["spam"] = "eggs" + + # Exception's __dict__ can be replaced, but not deleted + class Exception1(Exception, Base): + pass + class Exception2(Base, Exception): + pass + for ExceptionType in Exception, Exception1, Exception2: + e = ExceptionType() + e.__dict__ = {"a": 1} + self.assertEqual(e.a, 1) + try: + del e.__dict__ + except (TypeError, AttributeError): + pass + else: + self.fail("%r's __dict__ can be deleted" % e) + + def test_pickles(self): + # Testing pickling and copying new-style classes and objects... + import pickle, cPickle + + def sorteditems(d): + L = d.items() + L.sort() + return L + + global C + class C(object): + def __init__(self, a, b): + super(C, self).__init__() + self.a = a + self.b = b + def __repr__(self): + return "C(%r, %r)" % (self.a, self.b) + + global C1 + class C1(list): + def __new__(cls, a, b): + return super(C1, cls).__new__(cls) + def __getnewargs__(self): + return (self.a, self.b) + def __init__(self, a, b): + self.a = a + self.b = b + def __repr__(self): + return "C1(%r, %r)<%r>" % (self.a, self.b, list(self)) + + global C2 + class C2(int): + def __new__(cls, a, b, val=0): + return super(C2, cls).__new__(cls, val) + def __getnewargs__(self): + return (self.a, self.b, int(self)) + def __init__(self, a, b, val=0): + self.a = a + self.b = b + def __repr__(self): + return "C2(%r, %r)<%r>" % (self.a, self.b, int(self)) + + global C3 + class C3(object): + def __init__(self, foo): + self.foo = foo + def __getstate__(self): + return self.foo + def __setstate__(self, foo): + self.foo = foo + + global C4classic, C4 + class C4classic: # classic + pass + class C4(C4classic, object): # mixed inheritance + pass + + for p in pickle, cPickle: + for bin in 0, 1: + for cls in C, C1, C2: + s = p.dumps(cls, bin) + cls2 = p.loads(s) + self.assert_(cls2 is cls) + + a = C1(1, 2); a.append(42); a.append(24) + b = C2("hello", "world", 42) + s = p.dumps((a, b), bin) + x, y = p.loads(s) + self.assertEqual(x.__class__, a.__class__) + self.assertEqual(sorteditems(x.__dict__), sorteditems(a.__dict__)) + self.assertEqual(y.__class__, b.__class__) + self.assertEqual(sorteditems(y.__dict__), sorteditems(b.__dict__)) + self.assertEqual(repr(x), repr(a)) + self.assertEqual(repr(y), repr(b)) + # Test for __getstate__ and __setstate__ on new style class + u = C3(42) + s = p.dumps(u, bin) + v = p.loads(s) + self.assertEqual(u.__class__, v.__class__) + self.assertEqual(u.foo, v.foo) + # Test for picklability of hybrid class + u = C4() + u.foo = 42 + s = p.dumps(u, bin) + v = p.loads(s) + self.assertEqual(u.__class__, v.__class__) + self.assertEqual(u.foo, v.foo) + + # Testing copy.deepcopy() + import copy + for cls in C, C1, C2: + cls2 = copy.deepcopy(cls) + self.assert_(cls2 is cls) + + a = C1(1, 2); a.append(42); a.append(24) + b = C2("hello", "world", 42) + x, y = copy.deepcopy((a, b)) + self.assertEqual(x.__class__, a.__class__) + self.assertEqual(sorteditems(x.__dict__), sorteditems(a.__dict__)) + self.assertEqual(y.__class__, b.__class__) + self.assertEqual(sorteditems(y.__dict__), sorteditems(b.__dict__)) + self.assertEqual(repr(x), repr(a)) + self.assertEqual(repr(y), repr(b)) + + def test_pickle_slots(self): + # Testing pickling of classes with __slots__ ... + import pickle, cPickle + # Pickling of classes with __slots__ but without __getstate__ should fail + global B, C, D, E + class B(object): + pass + for base in [object, B]: + class C(base): + __slots__ = ['a'] + class D(C): + pass + try: + pickle.dumps(C()) + except TypeError: + pass + else: + self.fail("should fail: pickle C instance - %s" % base) + try: + cPickle.dumps(C()) + except TypeError: + pass + else: + self.fail("should fail: cPickle C instance - %s" % base) + try: + pickle.dumps(C()) + except TypeError: + pass + else: + self.fail("should fail: pickle D instance - %s" % base) + try: + cPickle.dumps(D()) + except TypeError: + pass + else: + self.fail("should fail: cPickle D instance - %s" % base) + # Give C a nice generic __getstate__ and __setstate__ + class C(base): + __slots__ = ['a'] + def __getstate__(self): + try: + d = self.__dict__.copy() + except AttributeError: + d = {} + for cls in self.__class__.__mro__: + for sn in cls.__dict__.get('__slots__', ()): + try: + d[sn] = getattr(self, sn) + except AttributeError: + pass + return d + def __setstate__(self, d): + for k, v in d.items(): + setattr(self, k, v) + class D(C): + pass + # Now it should work + x = C() + y = pickle.loads(pickle.dumps(x)) + self.assertEqual(hasattr(y, 'a'), 0) + y = cPickle.loads(cPickle.dumps(x)) + self.assertEqual(hasattr(y, 'a'), 0) + x.a = 42 + y = pickle.loads(pickle.dumps(x)) + self.assertEqual(y.a, 42) + y = cPickle.loads(cPickle.dumps(x)) + self.assertEqual(y.a, 42) + x = D() + x.a = 42 + x.b = 100 + y = pickle.loads(pickle.dumps(x)) + self.assertEqual(y.a + y.b, 142) + y = cPickle.loads(cPickle.dumps(x)) + self.assertEqual(y.a + y.b, 142) + # A subclass that adds a slot should also work + class E(C): + __slots__ = ['b'] + x = E() + x.a = 42 + x.b = "foo" + y = pickle.loads(pickle.dumps(x)) + self.assertEqual(y.a, x.a) + self.assertEqual(y.b, x.b) + y = cPickle.loads(cPickle.dumps(x)) + self.assertEqual(y.a, x.a) + self.assertEqual(y.b, x.b) + + def test_binary_operator_override(self): + # Testing overrides of binary operations... + class I(int): + def __repr__(self): + return "I(%r)" % int(self) + def __add__(self, other): + return I(int(self) + int(other)) + __radd__ = __add__ + def __pow__(self, other, mod=None): + if mod is None: + return I(pow(int(self), int(other))) + else: + return I(pow(int(self), int(other), int(mod))) + def __rpow__(self, other, mod=None): + if mod is None: + return I(pow(int(other), int(self), mod)) + else: + return I(pow(int(other), int(self), int(mod))) + + self.assertEqual(repr(I(1) + I(2)), "I(3)") + self.assertEqual(repr(I(1) + 2), "I(3)") + self.assertEqual(repr(1 + I(2)), "I(3)") + self.assertEqual(repr(I(2) ** I(3)), "I(8)") + self.assertEqual(repr(2 ** I(3)), "I(8)") + self.assertEqual(repr(I(2) ** 3), "I(8)") + self.assertEqual(repr(pow(I(2), I(3), I(5))), "I(3)") + class S(str): + def __eq__(self, other): + return self.lower() == other.lower() + + def test_subclass_propagation(self): + # Testing propagation of slot functions to subclasses... + class A(object): + pass + class B(A): + pass + class C(A): + pass + class D(B, C): + pass + d = D() + orig_hash = hash(d) # related to id(d) in platform-dependent ways + A.__hash__ = lambda self: 42 + self.assertEqual(hash(d), 42) + C.__hash__ = lambda self: 314 + self.assertEqual(hash(d), 314) + B.__hash__ = lambda self: 144 + self.assertEqual(hash(d), 144) + D.__hash__ = lambda self: 100 + self.assertEqual(hash(d), 100) + del D.__hash__ + self.assertEqual(hash(d), 144) + del B.__hash__ + self.assertEqual(hash(d), 314) + del C.__hash__ + self.assertEqual(hash(d), 42) + del A.__hash__ + self.assertEqual(hash(d), orig_hash) + d.foo = 42 + d.bar = 42 + self.assertEqual(d.foo, 42) + self.assertEqual(d.bar, 42) def __getattribute__(self, name): - log.append(("getattr", name)) - return MT.__getattribute__(self, name) - def __setattr__(self, name, value): - log.append(("setattr", name, value)) - MT.__setattr__(self, name, value) - def __delattr__(self, name): - log.append(("delattr", name)) - MT.__delattr__(self, name) - a = MM("a") - a.foo = 12 - x = a.foo - del a.foo - vereq(log, [("setattr", "foo", 12), - ("getattr", "foo"), - ("delattr", "foo")]) - - # http://python.org/sf/1174712 - try: - class Module(types.ModuleType, str): - pass - except TypeError: - pass - else: - raise TestFailed("inheriting from ModuleType and str at the " - "same time should fail") - -def multi(): - if verbose: print "Testing multiple inheritance..." - class C(object): - def __init__(self): - self.__state = 0 - def getstate(self): - return self.__state - def setstate(self, state): - self.__state = state - a = C() - vereq(a.getstate(), 0) - a.setstate(10) - vereq(a.getstate(), 10) - class D(dict, C): - def __init__(self): - type({}).__init__(self) - C.__init__(self) - d = D() - vereq(d.keys(), []) - d["hello"] = "world" - vereq(d.items(), [("hello", "world")]) - vereq(d["hello"], "world") - vereq(d.getstate(), 0) - d.setstate(10) - vereq(d.getstate(), 10) - vereq(D.__mro__, (D, dict, C, object)) - - # SF bug #442833 - class Node(object): - def __int__(self): - return int(self.foo()) - def foo(self): - return "23" - class Frag(Node, list): - def foo(self): - return "42" - vereq(Node().__int__(), 23) - vereq(int(Node()), 23) - vereq(Frag().__int__(), 42) - vereq(int(Frag()), 42) - - # MI mixing classic and new-style classes. - - class A: - x = 1 - - class B(A): - pass - - class C(A): - x = 2 - - class D(B, C): - pass - vereq(D.x, 1) - - # Classic MRO is preserved for a classic base class. - class E(D, object): - pass - vereq(E.__mro__, (E, D, B, A, C, object)) - vereq(E.x, 1) - - # But with a mix of classic bases, their MROs are combined using - # new-style MRO. - class F(B, C, object): - pass - vereq(F.__mro__, (F, B, C, A, object)) - vereq(F.x, 2) - - # Try something else. - class C: - def cmethod(self): - return "C a" - def all_method(self): - return "C b" - - class M1(C, object): - def m1method(self): - return "M1 a" - def all_method(self): - return "M1 b" - - vereq(M1.__mro__, (M1, C, object)) - m = M1() - vereq(m.cmethod(), "C a") - vereq(m.m1method(), "M1 a") - vereq(m.all_method(), "M1 b") - - class D(C): - def dmethod(self): - return "D a" - def all_method(self): - return "D b" - - class M2(D, object): - def m2method(self): - return "M2 a" - def all_method(self): - return "M2 b" - - vereq(M2.__mro__, (M2, D, C, object)) - m = M2() - vereq(m.cmethod(), "C a") - vereq(m.dmethod(), "D a") - vereq(m.m2method(), "M2 a") - vereq(m.all_method(), "M2 b") - - class M3(M1, M2, object): - def m3method(self): - return "M3 a" - def all_method(self): - return "M3 b" - vereq(M3.__mro__, (M3, M1, M2, D, C, object)) - m = M3() - vereq(m.cmethod(), "C a") - vereq(m.dmethod(), "D a") - vereq(m.m1method(), "M1 a") - vereq(m.m2method(), "M2 a") - vereq(m.m3method(), "M3 a") - vereq(m.all_method(), "M3 b") - - class Classic: - pass - try: - class New(Classic): - __metaclass__ = type - except TypeError: - pass - else: - raise TestFailed, "new class with only classic bases - shouldn't be" - -def diamond(): - if verbose: print "Testing multiple inheritance special cases..." - class A(object): - def spam(self): return "A" - vereq(A().spam(), "A") - class B(A): - def boo(self): return "B" - def spam(self): return "B" - vereq(B().spam(), "B") - vereq(B().boo(), "B") - class C(A): - def boo(self): return "C" - vereq(C().spam(), "A") - vereq(C().boo(), "C") - class D(B, C): pass - vereq(D().spam(), "B") - vereq(D().boo(), "B") - vereq(D.__mro__, (D, B, C, A, object)) - class E(C, B): pass - vereq(E().spam(), "B") - vereq(E().boo(), "C") - vereq(E.__mro__, (E, C, B, A, object)) - # MRO order disagreement - try: - class F(D, E): pass - except TypeError: - pass - else: - raise TestFailed, "expected MRO order disagreement (F)" - try: - class G(E, D): pass - except TypeError: - pass - else: - raise TestFailed, "expected MRO order disagreement (G)" - - -# see thread python-dev/2002-October/029035.html -def ex5(): - if verbose: print "Testing ex5 from C3 switch discussion..." - class A(object): pass - class B(object): pass - class C(object): pass - class X(A): pass - class Y(A): pass - class Z(X,B,Y,C): pass - vereq(Z.__mro__, (Z, X, B, Y, A, C, object)) - -# see "A Monotonic Superclass Linearization for Dylan", -# by Kim Barrett et al. (OOPSLA 1996) -def monotonicity(): - if verbose: print "Testing MRO monotonicity..." - class Boat(object): pass - class DayBoat(Boat): pass - class WheelBoat(Boat): pass - class EngineLess(DayBoat): pass - class SmallMultihull(DayBoat): pass - class PedalWheelBoat(EngineLess,WheelBoat): pass - class SmallCatamaran(SmallMultihull): pass - class Pedalo(PedalWheelBoat,SmallCatamaran): pass - - vereq(PedalWheelBoat.__mro__, - (PedalWheelBoat, EngineLess, DayBoat, WheelBoat, Boat, - object)) - vereq(SmallCatamaran.__mro__, - (SmallCatamaran, SmallMultihull, DayBoat, Boat, object)) - - vereq(Pedalo.__mro__, - (Pedalo, PedalWheelBoat, EngineLess, SmallCatamaran, - SmallMultihull, DayBoat, WheelBoat, Boat, object)) - -# see "A Monotonic Superclass Linearization for Dylan", -# by Kim Barrett et al. (OOPSLA 1996) -def consistency_with_epg(): - if verbose: print "Testing consistentcy with EPG..." - class Pane(object): pass - class ScrollingMixin(object): pass - class EditingMixin(object): pass - class ScrollablePane(Pane,ScrollingMixin): pass - class EditablePane(Pane,EditingMixin): pass - class EditableScrollablePane(ScrollablePane,EditablePane): pass - - vereq(EditableScrollablePane.__mro__, - (EditableScrollablePane, ScrollablePane, EditablePane, - Pane, ScrollingMixin, EditingMixin, object)) + if name == "foo": + return 24 + return object.__getattribute__(self, name) + A.__getattribute__ = __getattribute__ + self.assertEqual(d.foo, 24) + self.assertEqual(d.bar, 42) + def __getattr__(self, name): + if name in ("spam", "foo", "bar"): + return "hello" + raise AttributeError, name + B.__getattr__ = __getattr__ + self.assertEqual(d.spam, "hello") + self.assertEqual(d.foo, 24) + self.assertEqual(d.bar, 42) + del A.__getattribute__ + self.assertEqual(d.foo, 42) + del d.foo + self.assertEqual(d.foo, "hello") + self.assertEqual(d.bar, 42) + del B.__getattr__ + try: + d.foo + except AttributeError: + pass + else: + self.fail("d.foo should be undefined now") + + # Test a nasty bug in recurse_down_subclasses() + import gc + class A(object): + pass + class B(A): + pass + del B + gc.collect() + A.__setitem__ = lambda *a: None # crash + + def test_buffer_inheritance(self): + # Testing that buffer interface is inherited ... + + import binascii + # SF bug [#470040] ParseTuple t# vs subclasses. + + class MyStr(str): + pass + base = 'abc' + m = MyStr(base) + # b2a_hex uses the buffer interface to get its argument's value, via + # PyArg_ParseTuple 't#' code. + self.assertEqual(binascii.b2a_hex(m), binascii.b2a_hex(base)) + + # It's not clear that unicode will continue to support the character + # buffer interface, and this test will fail if that's taken away. + class MyUni(unicode): + pass + base = u'abc' + m = MyUni(base) + self.assertEqual(binascii.b2a_hex(m), binascii.b2a_hex(base)) + + class MyInt(int): + pass + m = MyInt(42) + try: + binascii.b2a_hex(m) + self.fail('subclass of int should not have a buffer interface') + except TypeError: + pass -mro_err_msg = """Cannot create a consistent method resolution -order (MRO) for bases """ + def test_str_of_str_subclass(self): + # Testing __str__ defined in subclass of str ... + import binascii + import cStringIO + + class octetstring(str): + def __str__(self): + return binascii.b2a_hex(self) + def __repr__(self): + return self + " repr" + + o = octetstring('A') + self.assertEqual(type(o), octetstring) + self.assertEqual(type(str(o)), str) + self.assertEqual(type(repr(o)), str) + self.assertEqual(ord(o), 0x41) + self.assertEqual(str(o), '41') + self.assertEqual(repr(o), 'A repr') + self.assertEqual(o.__str__(), '41') + self.assertEqual(o.__repr__(), 'A repr') + + capture = cStringIO.StringIO() + # Calling str() or not exercises different internal paths. + print >> capture, o + print >> capture, str(o) + self.assertEqual(capture.getvalue(), '41\n41\n') + capture.close() + + def test_keyword_arguments(self): + # Testing keyword arguments to __init__, __call__... + def f(a): return a + self.assertEqual(f.__call__(a=42), 42) + a = [] + list.__init__(a, sequence=[0, 1, 2]) + self.assertEqual(a, [0, 1, 2]) + + def test_recursive_call(self): + # Testing recursive __call__() by setting to instance of class... + class A(object): + pass -def mro_disagreement(): - if verbose: print "Testing error messages for MRO disagreement..." - def raises(exc, expected, callable, *args): - try: - callable(*args) - except exc, msg: - if not str(msg).startswith(expected): - raise TestFailed, "Message %r, expected %r" % (str(msg), - expected) - else: - raise TestFailed, "Expected %s" % exc - class A(object): pass - class B(A): pass - class C(object): pass - # Test some very simple errors - raises(TypeError, "duplicate base class A", - type, "X", (A, A), {}) - raises(TypeError, mro_err_msg, - type, "X", (A, B), {}) - raises(TypeError, mro_err_msg, - type, "X", (A, C, B), {}) - # Test a slightly more complex error - class GridLayout(object): pass - class HorizontalGrid(GridLayout): pass - class VerticalGrid(GridLayout): pass - class HVGrid(HorizontalGrid, VerticalGrid): pass - class VHGrid(VerticalGrid, HorizontalGrid): pass - raises(TypeError, mro_err_msg, - type, "ConfusedGrid", (HVGrid, VHGrid), {}) - -def objects(): - if verbose: print "Testing object class..." - a = object() - vereq(a.__class__, object) - vereq(type(a), object) - b = object() - verify(a is not b) - verify(not hasattr(a, "foo")) - try: - a.foo = 12 - except (AttributeError, TypeError): - pass - else: - verify(0, "object() should not allow setting a foo attribute") - verify(not hasattr(object(), "__dict__")) - - class Cdict(object): - pass - x = Cdict() - vereq(x.__dict__, {}) - x.foo = 1 - vereq(x.foo, 1) - vereq(x.__dict__, {'foo': 1}) - -def slots(): - if verbose: print "Testing __slots__..." - class C0(object): - __slots__ = [] - x = C0() - verify(not hasattr(x, "__dict__")) - verify(not hasattr(x, "foo")) - - class C1(object): - __slots__ = ['a'] - x = C1() - verify(not hasattr(x, "__dict__")) - verify(not hasattr(x, "a")) - x.a = 1 - vereq(x.a, 1) - x.a = None - veris(x.a, None) - del x.a - verify(not hasattr(x, "a")) - - class C3(object): - __slots__ = ['a', 'b', 'c'] - x = C3() - verify(not hasattr(x, "__dict__")) - verify(not hasattr(x, 'a')) - verify(not hasattr(x, 'b')) - verify(not hasattr(x, 'c')) - x.a = 1 - x.b = 2 - x.c = 3 - vereq(x.a, 1) - vereq(x.b, 2) - vereq(x.c, 3) - - class C4(object): - """Validate name mangling""" - __slots__ = ['__a'] - def __init__(self, value): - self.__a = value - def get(self): - return self.__a - x = C4(5) - verify(not hasattr(x, '__dict__')) - verify(not hasattr(x, '__a')) - vereq(x.get(), 5) - try: - x.__a = 6 - except AttributeError: - pass - else: - raise TestFailed, "Double underscored names not mangled" + A.__call__ = A() + try: + A()() + except RuntimeError: + pass + else: + self.fail("Recursion limit should have been reached for __call__()") - # Make sure slot names are proper identifiers - try: - class C(object): - __slots__ = [None] - except TypeError: - pass - else: - raise TestFailed, "[None] slots not caught" - try: - class C(object): - __slots__ = ["foo bar"] - except TypeError: - pass - else: - raise TestFailed, "['foo bar'] slots not caught" - try: + def test_delete_hook(self): + # Testing __del__ hook... + log = [] class C(object): - __slots__ = ["foo\0bar"] - except TypeError: - pass - else: - raise TestFailed, "['foo\\0bar'] slots not caught" - try: - class C(object): - __slots__ = ["1"] - except TypeError: - pass - else: - raise TestFailed, "['1'] slots not caught" - try: - class C(object): - __slots__ = [""] - except TypeError: - pass - else: - raise TestFailed, "[''] slots not caught" - class C(object): - __slots__ = ["a", "a_b", "_a", "A0123456789Z"] - # XXX(nnorwitz): was there supposed to be something tested - # from the class above? - - # Test a single string is not expanded as a sequence. - class C(object): - __slots__ = "abc" - c = C() - c.abc = 5 - vereq(c.abc, 5) - - # Test unicode slot names - try: - unicode - except NameError: - pass - else: - # Test a single unicode string is not expanded as a sequence. - class C(object): - __slots__ = unicode("abc") + def __del__(self): + log.append(1) c = C() - c.abc = 5 - vereq(c.abc, 5) + self.assertEqual(log, []) + del c + self.assertEqual(log, [1]) + + class D(object): pass + d = D() + try: del d[0] + except TypeError: pass + else: self.fail("invalid del() didn't raise TypeError") - # _unicode_to_string used to modify slots in certain circumstances - slots = (unicode("foo"), unicode("bar")) - class C(object): - __slots__ = slots - x = C() - x.foo = 5 - vereq(x.foo, 5) - veris(type(slots[0]), unicode) - # this used to leak references + def test_hash_inheritance(self): + # Testing hash of mutable subclasses... + + class mydict(dict): + pass + d = mydict() try: - class C(object): - __slots__ = [unichr(128)] - except (TypeError, UnicodeEncodeError): + hash(d) + except TypeError: pass else: - raise TestFailed, "[unichr(128)] slots not caught" + self.fail("hash() of dict subclass should fail") - # Test leaks - class Counted(object): - counter = 0 # counts the number of instances alive - def __init__(self): - Counted.counter += 1 - def __del__(self): - Counted.counter -= 1 - class C(object): - __slots__ = ['a', 'b', 'c'] - x = C() - x.a = Counted() - x.b = Counted() - x.c = Counted() - vereq(Counted.counter, 3) - del x - vereq(Counted.counter, 0) - class D(C): - pass - x = D() - x.a = Counted() - x.z = Counted() - vereq(Counted.counter, 2) - del x - vereq(Counted.counter, 0) - class E(D): - __slots__ = ['e'] - x = E() - x.a = Counted() - x.z = Counted() - x.e = Counted() - vereq(Counted.counter, 3) - del x - vereq(Counted.counter, 0) - - # Test cyclical leaks [SF bug 519621] - class F(object): - __slots__ = ['a', 'b'] - log = [] - s = F() - s.a = [Counted(), s] - vereq(Counted.counter, 1) - s = None - import gc - gc.collect() - vereq(Counted.counter, 0) - - # Test lookup leaks [SF bug 572567] - import sys,gc - class G(object): - def __cmp__(self, other): - return 0 - g = G() - orig_objects = len(gc.get_objects()) - for i in xrange(10): - g==g - new_objects = len(gc.get_objects()) - vereq(orig_objects, new_objects) - class H(object): - __slots__ = ['a', 'b'] - def __init__(self): - self.a = 1 - self.b = 2 - def __del__(self): - assert self.a == 1 - assert self.b == 2 - - save_stderr = sys.stderr - sys.stderr = sys.stdout - h = H() - try: - del h - finally: - sys.stderr = save_stderr - -def slotspecials(): - if verbose: print "Testing __dict__ and __weakref__ in __slots__..." - - class D(object): - __slots__ = ["__dict__"] - a = D() - verify(hasattr(a, "__dict__")) - verify(not hasattr(a, "__weakref__")) - a.foo = 42 - vereq(a.__dict__, {"foo": 42}) - - class W(object): - __slots__ = ["__weakref__"] - a = W() - verify(hasattr(a, "__weakref__")) - verify(not hasattr(a, "__dict__")) - try: - a.foo = 42 - except AttributeError: - pass - else: - raise TestFailed, "shouldn't be allowed to set a.foo" - - class C1(W, D): - __slots__ = [] - a = C1() - verify(hasattr(a, "__dict__")) - verify(hasattr(a, "__weakref__")) - a.foo = 42 - vereq(a.__dict__, {"foo": 42}) - - class C2(D, W): - __slots__ = [] - a = C2() - verify(hasattr(a, "__dict__")) - verify(hasattr(a, "__weakref__")) - a.foo = 42 - vereq(a.__dict__, {"foo": 42}) - -# MRO order disagreement -# -# class C3(C1, C2): -# __slots__ = [] -# -# class C4(C2, C1): -# __slots__ = [] - -def dynamics(): - if verbose: print "Testing class attribute propagation..." - class D(object): - pass - class E(D): - pass - class F(D): - pass - D.foo = 1 - vereq(D.foo, 1) - # Test that dynamic attributes are inherited - vereq(E.foo, 1) - vereq(F.foo, 1) - # Test dynamic instances - class C(object): - pass - a = C() - verify(not hasattr(a, "foobar")) - C.foobar = 2 - vereq(a.foobar, 2) - C.method = lambda self: 42 - vereq(a.method(), 42) - C.__repr__ = lambda self: "C()" - vereq(repr(a), "C()") - C.__int__ = lambda self: 100 - vereq(int(a), 100) - vereq(a.foobar, 2) - verify(not hasattr(a, "spam")) - def mygetattr(self, name): - if name == "spam": - return "spam" - raise AttributeError - C.__getattr__ = mygetattr - vereq(a.spam, "spam") - a.new = 12 - vereq(a.new, 12) - def mysetattr(self, name, value): - if name == "spam": - raise AttributeError - return object.__setattr__(self, name, value) - C.__setattr__ = mysetattr - try: - a.spam = "not spam" - except AttributeError: - pass - else: - verify(0, "expected AttributeError") - vereq(a.spam, "spam") - class D(C): - pass - d = D() - d.foo = 1 - vereq(d.foo, 1) - - # Test handling of int*seq and seq*int - class I(int): - pass - vereq("a"*I(2), "aa") - vereq(I(2)*"a", "aa") - vereq(2*I(3), 6) - vereq(I(3)*2, 6) - vereq(I(3)*I(2), 6) - - # Test handling of long*seq and seq*long - class L(long): - pass - vereq("a"*L(2L), "aa") - vereq(L(2L)*"a", "aa") - vereq(2*L(3), 6) - vereq(L(3)*2, 6) - vereq(L(3)*L(2), 6) - - # Test comparison of classes with dynamic metaclasses - class dynamicmetaclass(type): - pass - class someclass: - __metaclass__ = dynamicmetaclass - verify(someclass != object) - -def errors(): - if verbose: print "Testing errors..." - - try: - class C(list, dict): - pass - except TypeError: - pass - else: - verify(0, "inheritance from both list and dict should be illegal") - - try: - class C(object, None): - pass - except TypeError: - pass - else: - verify(0, "inheritance from non-type should be illegal") - class Classic: - pass - - try: - class C(type(len)): - pass - except TypeError: - pass - else: - verify(0, "inheritance from CFunction should be illegal") + class mylist(list): + pass + d = mylist() + try: + hash(d) + except TypeError: + pass + else: + self.fail("hash() of list subclass should fail") - try: - class C(object): - __slots__ = 1 - except TypeError: - pass - else: - verify(0, "__slots__ = 1 should be illegal") + def test_str_operations(self): + try: 'a' + 5 + except TypeError: pass + else: self.fail("'' + 5 doesn't raise TypeError") + + try: ''.split('') + except ValueError: pass + else: self.fail("''.split('') doesn't raise ValueError") + + try: ''.join([0]) + except TypeError: pass + else: self.fail("''.join([0]) doesn't raise TypeError") + + try: ''.rindex('5') + except ValueError: pass + else: self.fail("''.rindex('5') doesn't raise ValueError") + + try: '%(n)s' % None + except TypeError: pass + else: self.fail("'%(n)s' % None doesn't raise TypeError") + + try: '%(n' % {} + except ValueError: pass + else: self.fail("'%(n' % {} '' doesn't raise ValueError") + + try: '%*s' % ('abc') + except TypeError: pass + else: self.fail("'%*s' % ('abc') doesn't raise TypeError") + + try: '%*.*s' % ('abc', 5) + except TypeError: pass + else: self.fail("'%*.*s' % ('abc', 5) doesn't raise TypeError") + + try: '%s' % (1, 2) + except TypeError: pass + else: self.fail("'%s' % (1, 2) doesn't raise TypeError") + + try: '%' % None + except ValueError: pass + else: self.fail("'%' % None doesn't raise ValueError") + + self.assertEqual('534253'.isdigit(), 1) + self.assertEqual('534253x'.isdigit(), 0) + self.assertEqual('%c' % 5, '\x05') + self.assertEqual('%c' % '5', '5') + + def test_deepcopy_recursive(self): + # Testing deepcopy of recursive objects... + class Node: + pass + a = Node() + b = Node() + a.b = b + b.a = a + z = deepcopy(a) # This blew up before + + def test_unintialized_modules(self): + # Testing uninitialized module objects... + from types import ModuleType as M + m = M.__new__(M) + str(m) + self.assertEqual(hasattr(m, "__name__"), 0) + self.assertEqual(hasattr(m, "__file__"), 0) + self.assertEqual(hasattr(m, "foo"), 0) + self.assertEqual(m.__dict__, None) + m.foo = 1 + self.assertEqual(m.__dict__, {"foo": 1}) - try: + def test_funny_new(self): + # Testing __new__ returning something unexpected... class C(object): - __slots__ = [1] - except TypeError: - pass - else: - verify(0, "__slots__ = [1] should be illegal") - - class M1(type): - pass - class M2(type): - pass - class A1(object): - __metaclass__ = M1 - class A2(object): - __metaclass__ = M2 - try: - class B(A1, A2): - pass - except TypeError: - pass - else: - verify(0, "finding the most derived metaclass should have failed") - -def classmethods(): - if verbose: print "Testing class methods..." - class C(object): - def foo(*a): return a - goo = classmethod(foo) - c = C() - vereq(C.goo(1), (C, 1)) - vereq(c.goo(1), (C, 1)) - vereq(c.foo(1), (c, 1)) - class D(C): - pass - d = D() - vereq(D.goo(1), (D, 1)) - vereq(d.goo(1), (D, 1)) - vereq(d.foo(1), (d, 1)) - vereq(D.foo(d, 1), (d, 1)) - # Test for a specific crash (SF bug 528132) - def f(cls, arg): return (cls, arg) - ff = classmethod(f) - vereq(ff.__get__(0, int)(42), (int, 42)) - vereq(ff.__get__(0)(42), (int, 42)) - - # Test super() with classmethods (SF bug 535444) - veris(C.goo.im_self, C) - veris(D.goo.im_self, D) - veris(super(D,D).goo.im_self, D) - veris(super(D,d).goo.im_self, D) - vereq(super(D,D).goo(), (D,)) - vereq(super(D,d).goo(), (D,)) - - # Verify that argument is checked for callability (SF bug 753451) - try: - classmethod(1).__get__(1) - except TypeError: - pass - else: - raise TestFailed, "classmethod should check for callability" - - # Verify that classmethod() doesn't allow keyword args - try: - classmethod(f, kw=1) - except TypeError: - pass - else: - raise TestFailed, "classmethod shouldn't accept keyword args" - -def classmethods_in_c(): - if verbose: print "Testing C-based class methods..." - import xxsubtype as spam - a = (1, 2, 3) - d = {'abc': 123} - x, a1, d1 = spam.spamlist.classmeth(*a, **d) - veris(x, spam.spamlist) - vereq(a, a1) - vereq(d, d1) - x, a1, d1 = spam.spamlist().classmeth(*a, **d) - veris(x, spam.spamlist) - vereq(a, a1) - vereq(d, d1) - -def staticmethods(): - if verbose: print "Testing static methods..." - class C(object): - def foo(*a): return a - goo = staticmethod(foo) - c = C() - vereq(C.goo(1), (1,)) - vereq(c.goo(1), (1,)) - vereq(c.foo(1), (c, 1,)) - class D(C): - pass - d = D() - vereq(D.goo(1), (1,)) - vereq(d.goo(1), (1,)) - vereq(d.foo(1), (d, 1)) - vereq(D.foo(d, 1), (d, 1)) - -def staticmethods_in_c(): - if verbose: print "Testing C-based static methods..." - import xxsubtype as spam - a = (1, 2, 3) - d = {"abc": 123} - x, a1, d1 = spam.spamlist.staticmeth(*a, **d) - veris(x, None) - vereq(a, a1) - vereq(d, d1) - x, a1, d2 = spam.spamlist().staticmeth(*a, **d) - veris(x, None) - vereq(a, a1) - vereq(d, d1) - -def classic(): - if verbose: print "Testing classic classes..." - class C: - def foo(*a): return a - goo = classmethod(foo) - c = C() - vereq(C.goo(1), (C, 1)) - vereq(c.goo(1), (C, 1)) - vereq(c.foo(1), (c, 1)) - class D(C): - pass - d = D() - vereq(D.goo(1), (D, 1)) - vereq(d.goo(1), (D, 1)) - vereq(d.foo(1), (d, 1)) - vereq(D.foo(d, 1), (d, 1)) - class E: # *not* subclassing from C - foo = C.foo - vereq(E().foo, C.foo) # i.e., unbound - verify(repr(C.foo.__get__(C())).startswith("= 0) - vereq(str(c1), repr(c1)) - verify(-1 not in c1) - for i in range(10): - verify(i in c1) - verify(10 not in c1) - # Test the default behavior for dynamic classes - class D(object): - def __getitem__(self, i): - if 0 <= i < 10: return i - raise IndexError - d1 = D() - d2 = D() - verify(not not d1) - verify(id(d1) != id(d2)) - hash(d1) - hash(d2) - vereq(cmp(d1, d2), cmp(id(d1), id(d2))) - vereq(d1, d1) - verify(d1 != d2) - verify(not d1 != d1) - verify(not d1 == d2) - # Note that the module name appears in str/repr, and that varies - # depending on whether this test is run standalone or from a framework. - verify(str(d1).find('D object at ') >= 0) - vereq(str(d1), repr(d1)) - verify(-1 not in d1) - for i in range(10): - verify(i in d1) - verify(10 not in d1) - # Test overridden behavior for static classes - class Proxy(object): - def __init__(self, x): - self.x = x - def __nonzero__(self): - return not not self.x - def __hash__(self): - return hash(self.x) - def __eq__(self, other): - return self.x == other - def __ne__(self, other): - return self.x != other - def __cmp__(self, other): - return cmp(self.x, other.x) - def __str__(self): - return "Proxy:%s" % self.x - def __repr__(self): - return "Proxy(%r)" % self.x - def __contains__(self, value): - return value in self.x - p0 = Proxy(0) - p1 = Proxy(1) - p_1 = Proxy(-1) - verify(not p0) - verify(not not p1) - vereq(hash(p0), hash(0)) - vereq(p0, p0) - verify(p0 != p1) - verify(not p0 != p0) - vereq(not p0, p1) - vereq(cmp(p0, p1), -1) - vereq(cmp(p0, p0), 0) - vereq(cmp(p0, p_1), 1) - vereq(str(p0), "Proxy:0") - vereq(repr(p0), "Proxy(0)") - p10 = Proxy(range(10)) - verify(-1 not in p10) - for i in range(10): - verify(i in p10) - verify(10 not in p10) - # Test overridden behavior for dynamic classes - class DProxy(object): - def __init__(self, x): - self.x = x - def __nonzero__(self): - return not not self.x - def __hash__(self): - return hash(self.x) - def __eq__(self, other): - return self.x == other - def __ne__(self, other): - return self.x != other - def __cmp__(self, other): - return cmp(self.x, other.x) - def __str__(self): - return "DProxy:%s" % self.x - def __repr__(self): - return "DProxy(%r)" % self.x - def __contains__(self, value): - return value in self.x - p0 = DProxy(0) - p1 = DProxy(1) - p_1 = DProxy(-1) - verify(not p0) - verify(not not p1) - vereq(hash(p0), hash(0)) - vereq(p0, p0) - verify(p0 != p1) - verify(not p0 != p0) - vereq(not p0, p1) - vereq(cmp(p0, p1), -1) - vereq(cmp(p0, p0), 0) - vereq(cmp(p0, p_1), 1) - vereq(str(p0), "DProxy:0") - vereq(repr(p0), "DProxy(0)") - p10 = DProxy(range(10)) - verify(-1 not in p10) - for i in range(10): - verify(i in p10) - verify(10 not in p10) - # Safety test for __cmp__ - def unsafecmp(a, b): - try: - a.__class__.__cmp__(a, b) - except TypeError: - pass - else: - raise TestFailed, "shouldn't allow %s.__cmp__(%r, %r)" % ( - a.__class__, a, b) - unsafecmp(u"123", "123") - unsafecmp("123", u"123") - unsafecmp(1, 1.0) - unsafecmp(1.0, 1) - unsafecmp(1, 1L) - unsafecmp(1L, 1) - -def recursions(): - if verbose: - print "Testing recursion checks ..." - - class Letter(str): - def __new__(cls, letter): - if letter == 'EPS': - return str.__new__(cls) - return str.__new__(cls, letter) - def __str__(self): - if not self: - return 'EPS' - return self - # sys.stdout needs to be the original to trigger the recursion bug - import sys - test_stdout = sys.stdout - sys.stdout = get_original_stdout() - try: - # nothing should actually be printed, this should raise an exception - print Letter('w') - except RuntimeError: - pass - else: - raise TestFailed, "expected a RuntimeError for print recursion" - sys.stdout = test_stdout - - # Bug #1202533. - class A(object): - pass - A.__mul__ = types.MethodType(lambda self, x: self * x, None, A) - try: - A()*2 - except RuntimeError: - pass - else: - raise TestFailed("expected a RuntimeError") - -def weakrefs(): - if verbose: print "Testing weak references..." - import weakref - class C(object): - pass - c = C() - r = weakref.ref(c) - verify(r() is c) - del c - verify(r() is None) - del r - class NoWeak(object): - __slots__ = ['foo'] - no = NoWeak() - try: - weakref.ref(no) - except TypeError, msg: - verify(str(msg).find("weak reference") >= 0) - else: - verify(0, "weakref.ref(no) should be illegal") - class Weak(object): - __slots__ = ['foo', '__weakref__'] - yes = Weak() - r = weakref.ref(yes) - verify(r() is yes) - del yes - verify(r() is None) - del r - -def properties(): - if verbose: print "Testing property..." - class C(object): - def getx(self): - return self.__x - def setx(self, value): - self.__x = value - def delx(self): - del self.__x - x = property(getx, setx, delx, doc="I'm the x property.") - a = C() - verify(not hasattr(a, "x")) - a.x = 42 - vereq(a._C__x, 42) - vereq(a.x, 42) - del a.x - verify(not hasattr(a, "x")) - verify(not hasattr(a, "_C__x")) - C.x.__set__(a, 100) - vereq(C.x.__get__(a), 100) - C.x.__delete__(a) - verify(not hasattr(a, "x")) - - raw = C.__dict__['x'] - verify(isinstance(raw, property)) - - attrs = dir(raw) - verify("__doc__" in attrs) - verify("fget" in attrs) - verify("fset" in attrs) - verify("fdel" in attrs) - - vereq(raw.__doc__, "I'm the x property.") - verify(raw.fget is C.__dict__['getx']) - verify(raw.fset is C.__dict__['setx']) - verify(raw.fdel is C.__dict__['delx']) + # stuff that shouldn't: + class L(list): + pass - for attr in "__doc__", "fget", "fset", "fdel": - try: - setattr(raw, attr, 42) - except TypeError, msg: - if str(msg).find('readonly') < 0: - raise TestFailed("when setting readonly attr %r on a " - "property, got unexpected TypeError " - "msg %r" % (attr, str(msg))) - else: - raise TestFailed("expected TypeError from trying to set " - "readonly %r attr on a property" % attr) - - class D(object): - __getitem__ = property(lambda s: 1/0) - - d = D() - try: - for i in d: - str(i) - except ZeroDivisionError: - pass - else: - raise TestFailed, "expected ZeroDivisionError from bad property" - - class E(object): - def getter(self): - "getter method" - return 0 - def setter(self, value): - "setter method" - pass - prop = property(getter) - vereq(prop.__doc__, "getter method") - prop2 = property(fset=setter) - vereq(prop2.__doc__, None) - - # this segfaulted in 2.5b2 - try: - import _testcapi - except ImportError: - pass - else: - class X(object): - p = property(_testcapi.test_with_docstring) - - -def properties_plus(): - class C(object): - foo = property(doc="hello") - @foo.getter - def foo(self): - return self._foo - @foo.setter - def foo(self, value): - self._foo = abs(value) - @foo.deleter - def foo(self): - del self._foo - c = C() - assert C.foo.__doc__ == "hello" - assert not hasattr(c, "foo") - c.foo = -42 - assert hasattr(c, '_foo') - assert c._foo == 42 - assert c.foo == 42 - del c.foo - assert not hasattr(c, '_foo') - assert not hasattr(c, "foo") - - class D(C): - @C.foo.deleter - def foo(self): - try: - del self._foo - except AttributeError: - pass - d = D() - d.foo = 24 - assert d.foo == 24 - del d.foo - del d.foo - - class E(object): - @property - def foo(self): - return self._foo - @foo.setter - def foo(self, value): - raise RuntimeError - @foo.setter - def foo(self, value): - self._foo = abs(value) - @foo.deleter - def foo(self, value=None): - del self._foo - - e = E() - e.foo = -42 - assert e.foo == 42 - del e.foo - - class F(E): - @E.foo.deleter - def foo(self): - del self._foo - @foo.setter - def foo(self, value): - self._foo = max(0, value) - f = F() - f.foo = -10 - assert f.foo == 0 - del f.foo - - -def supers(): - if verbose: print "Testing super..." - - class A(object): - def meth(self, a): - return "A(%r)" % a - - vereq(A().meth(1), "A(1)") - - class B(A): - def __init__(self): - self.__super = super(B, self) - def meth(self, a): - return "B(%r)" % a + self.__super.meth(a) - - vereq(B().meth(2), "B(2)A(2)") - - class C(A): - def meth(self, a): - return "C(%r)" % a + self.__super.meth(a) - C._C__super = super(C) - - vereq(C().meth(3), "C(3)A(3)") - - class D(C, B): - def meth(self, a): - return "D(%r)" % a + super(D, self).meth(a) - - vereq(D().meth(4), "D(4)C(4)B(4)A(4)") - - # Test for subclassing super - - class mysuper(super): - def __init__(self, *args): - return super(mysuper, self).__init__(*args) - - class E(D): - def meth(self, a): - return "E(%r)" % a + mysuper(E, self).meth(a) - - vereq(E().meth(5), "E(5)D(5)C(5)B(5)A(5)") - - class F(E): - def meth(self, a): - s = self.__super # == mysuper(F, self) - return "F(%r)[%s]" % (a, s.__class__.__name__) + s.meth(a) - F._F__super = mysuper(F) - - vereq(F().meth(6), "F(6)[mysuper]E(6)D(6)C(6)B(6)A(6)") - - # Make sure certain errors are raised - - try: - super(D, 42) - except TypeError: - pass - else: - raise TestFailed, "shouldn't allow super(D, 42)" - - try: - super(D, C()) - except TypeError: - pass - else: - raise TestFailed, "shouldn't allow super(D, C())" - - try: - super(D).__get__(12) - except TypeError: - pass - else: - raise TestFailed, "shouldn't allow super(D).__get__(12)" - - try: - super(D).__get__(C()) - except TypeError: - pass - else: - raise TestFailed, "shouldn't allow super(D).__get__(C())" - - # Make sure data descriptors can be overridden and accessed via super - # (new feature in Python 2.3) - - class DDbase(object): - def getx(self): return 42 - x = property(getx) - - class DDsub(DDbase): - def getx(self): return "hello" - x = property(getx) - - dd = DDsub() - vereq(dd.x, "hello") - vereq(super(DDsub, dd).x, 42) - - # Ensure that super() lookup of descriptor from classmethod - # works (SF ID# 743627) - - class Base(object): - aProp = property(lambda self: "foo") - - class Sub(Base): - @classmethod - def test(klass): - return super(Sub,klass).aProp - - veris(Sub.test(), Base.aProp) - - # Verify that super() doesn't allow keyword args - try: - super(Base, kw=1) - except TypeError: - pass - else: - raise TestFailed, "super shouldn't accept keyword args" - -def inherits(): - if verbose: print "Testing inheritance from basic types..." - - class hexint(int): - def __repr__(self): - return hex(self) - def __add__(self, other): - return hexint(int.__add__(self, other)) - # (Note that overriding __radd__ doesn't work, - # because the int type gets first dibs.) - vereq(repr(hexint(7) + 9), "0x10") - vereq(repr(hexint(1000) + 7), "0x3ef") - a = hexint(12345) - vereq(a, 12345) - vereq(int(a), 12345) - verify(int(a).__class__ is int) - vereq(hash(a), hash(12345)) - verify((+a).__class__ is int) - verify((a >> 0).__class__ is int) - verify((a << 0).__class__ is int) - verify((hexint(0) << 12).__class__ is int) - verify((hexint(0) >> 12).__class__ is int) - - class octlong(long): - __slots__ = [] - def __str__(self): - s = oct(self) - if s[-1] == 'L': - s = s[:-1] - return s - def __add__(self, other): - return self.__class__(super(octlong, self).__add__(other)) - __radd__ = __add__ - vereq(str(octlong(3) + 5), "010") - # (Note that overriding __radd__ here only seems to work - # because the example uses a short int left argument.) - vereq(str(5 + octlong(3000)), "05675") - a = octlong(12345) - vereq(a, 12345L) - vereq(long(a), 12345L) - vereq(hash(a), hash(12345L)) - verify(long(a).__class__ is long) - verify((+a).__class__ is long) - verify((-a).__class__ is long) - verify((-octlong(0)).__class__ is long) - verify((a >> 0).__class__ is long) - verify((a << 0).__class__ is long) - verify((a - 0).__class__ is long) - verify((a * 1).__class__ is long) - verify((a ** 1).__class__ is long) - verify((a // 1).__class__ is long) - verify((1 * a).__class__ is long) - verify((a | 0).__class__ is long) - verify((a ^ 0).__class__ is long) - verify((a & -1L).__class__ is long) - verify((octlong(0) << 12).__class__ is long) - verify((octlong(0) >> 12).__class__ is long) - verify(abs(octlong(0)).__class__ is long) - - # Because octlong overrides __add__, we can't check the absence of +0 - # optimizations using octlong. - class longclone(long): - pass - a = longclone(1) - verify((a + 0).__class__ is long) - verify((0 + a).__class__ is long) - - # Check that negative clones don't segfault - a = longclone(-1) - vereq(a.__dict__, {}) - vereq(long(a), -1) # verify PyNumber_Long() copies the sign bit - - class precfloat(float): - __slots__ = ['prec'] - def __init__(self, value=0.0, prec=12): - self.prec = int(prec) - def __repr__(self): - return "%.*g" % (self.prec, self) - vereq(repr(precfloat(1.1)), "1.1") - a = precfloat(12345) - vereq(a, 12345.0) - vereq(float(a), 12345.0) - verify(float(a).__class__ is float) - vereq(hash(a), hash(12345.0)) - verify((+a).__class__ is float) - - class madcomplex(complex): - def __repr__(self): - return "%.17gj%+.17g" % (self.imag, self.real) - a = madcomplex(-3, 4) - vereq(repr(a), "4j-3") - base = complex(-3, 4) - veris(base.__class__, complex) - vereq(a, base) - vereq(complex(a), base) - veris(complex(a).__class__, complex) - a = madcomplex(a) # just trying another form of the constructor - vereq(repr(a), "4j-3") - vereq(a, base) - vereq(complex(a), base) - veris(complex(a).__class__, complex) - vereq(hash(a), hash(base)) - veris((+a).__class__, complex) - veris((a + 0).__class__, complex) - vereq(a + 0, base) - veris((a - 0).__class__, complex) - vereq(a - 0, base) - veris((a * 1).__class__, complex) - vereq(a * 1, base) - veris((a / 1).__class__, complex) - vereq(a / 1, base) - - class madtuple(tuple): - _rev = None - def rev(self): - if self._rev is not None: - return self._rev - L = list(self) - L.reverse() - self._rev = self.__class__(L) - return self._rev - a = madtuple((1,2,3,4,5,6,7,8,9,0)) - vereq(a, (1,2,3,4,5,6,7,8,9,0)) - vereq(a.rev(), madtuple((0,9,8,7,6,5,4,3,2,1))) - vereq(a.rev().rev(), madtuple((1,2,3,4,5,6,7,8,9,0))) - for i in range(512): - t = madtuple(range(i)) - u = t.rev() - v = u.rev() - vereq(v, t) - a = madtuple((1,2,3,4,5)) - vereq(tuple(a), (1,2,3,4,5)) - verify(tuple(a).__class__ is tuple) - vereq(hash(a), hash((1,2,3,4,5))) - verify(a[:].__class__ is tuple) - verify((a * 1).__class__ is tuple) - verify((a * 0).__class__ is tuple) - verify((a + ()).__class__ is tuple) - a = madtuple(()) - vereq(tuple(a), ()) - verify(tuple(a).__class__ is tuple) - verify((a + a).__class__ is tuple) - verify((a * 0).__class__ is tuple) - verify((a * 1).__class__ is tuple) - verify((a * 2).__class__ is tuple) - verify(a[:].__class__ is tuple) - - class madstring(str): - _rev = None - def rev(self): - if self._rev is not None: - return self._rev - L = list(self) - L.reverse() - self._rev = self.__class__("".join(L)) - return self._rev - s = madstring("abcdefghijklmnopqrstuvwxyz") - vereq(s, "abcdefghijklmnopqrstuvwxyz") - vereq(s.rev(), madstring("zyxwvutsrqponmlkjihgfedcba")) - vereq(s.rev().rev(), madstring("abcdefghijklmnopqrstuvwxyz")) - for i in range(256): - s = madstring("".join(map(chr, range(i)))) - t = s.rev() - u = t.rev() - vereq(u, s) - s = madstring("12345") - vereq(str(s), "12345") - verify(str(s).__class__ is str) - - base = "\x00" * 5 - s = madstring(base) - vereq(s, base) - vereq(str(s), base) - verify(str(s).__class__ is str) - vereq(hash(s), hash(base)) - vereq({s: 1}[base], 1) - vereq({base: 1}[s], 1) - verify((s + "").__class__ is str) - vereq(s + "", base) - verify(("" + s).__class__ is str) - vereq("" + s, base) - verify((s * 0).__class__ is str) - vereq(s * 0, "") - verify((s * 1).__class__ is str) - vereq(s * 1, base) - verify((s * 2).__class__ is str) - vereq(s * 2, base + base) - verify(s[:].__class__ is str) - vereq(s[:], base) - verify(s[0:0].__class__ is str) - vereq(s[0:0], "") - verify(s.strip().__class__ is str) - vereq(s.strip(), base) - verify(s.lstrip().__class__ is str) - vereq(s.lstrip(), base) - verify(s.rstrip().__class__ is str) - vereq(s.rstrip(), base) - identitytab = ''.join([chr(i) for i in range(256)]) - verify(s.translate(identitytab).__class__ is str) - vereq(s.translate(identitytab), base) - verify(s.translate(identitytab, "x").__class__ is str) - vereq(s.translate(identitytab, "x"), base) - vereq(s.translate(identitytab, "\x00"), "") - verify(s.replace("x", "x").__class__ is str) - vereq(s.replace("x", "x"), base) - verify(s.ljust(len(s)).__class__ is str) - vereq(s.ljust(len(s)), base) - verify(s.rjust(len(s)).__class__ is str) - vereq(s.rjust(len(s)), base) - verify(s.center(len(s)).__class__ is str) - vereq(s.center(len(s)), base) - verify(s.lower().__class__ is str) - vereq(s.lower(), base) - - class madunicode(unicode): - _rev = None - def rev(self): - if self._rev is not None: - return self._rev - L = list(self) - L.reverse() - self._rev = self.__class__(u"".join(L)) - return self._rev - u = madunicode("ABCDEF") - vereq(u, u"ABCDEF") - vereq(u.rev(), madunicode(u"FEDCBA")) - vereq(u.rev().rev(), madunicode(u"ABCDEF")) - base = u"12345" - u = madunicode(base) - vereq(unicode(u), base) - verify(unicode(u).__class__ is unicode) - vereq(hash(u), hash(base)) - vereq({u: 1}[base], 1) - vereq({base: 1}[u], 1) - verify(u.strip().__class__ is unicode) - vereq(u.strip(), base) - verify(u.lstrip().__class__ is unicode) - vereq(u.lstrip(), base) - verify(u.rstrip().__class__ is unicode) - vereq(u.rstrip(), base) - verify(u.replace(u"x", u"x").__class__ is unicode) - vereq(u.replace(u"x", u"x"), base) - verify(u.replace(u"xy", u"xy").__class__ is unicode) - vereq(u.replace(u"xy", u"xy"), base) - verify(u.center(len(u)).__class__ is unicode) - vereq(u.center(len(u)), base) - verify(u.ljust(len(u)).__class__ is unicode) - vereq(u.ljust(len(u)), base) - verify(u.rjust(len(u)).__class__ is unicode) - vereq(u.rjust(len(u)), base) - verify(u.lower().__class__ is unicode) - vereq(u.lower(), base) - verify(u.upper().__class__ is unicode) - vereq(u.upper(), base) - verify(u.capitalize().__class__ is unicode) - vereq(u.capitalize(), base) - verify(u.title().__class__ is unicode) - vereq(u.title(), base) - verify((u + u"").__class__ is unicode) - vereq(u + u"", base) - verify((u"" + u).__class__ is unicode) - vereq(u"" + u, base) - verify((u * 0).__class__ is unicode) - vereq(u * 0, u"") - verify((u * 1).__class__ is unicode) - vereq(u * 1, base) - verify((u * 2).__class__ is unicode) - vereq(u * 2, base + base) - verify(u[:].__class__ is unicode) - vereq(u[:], base) - verify(u[0:0].__class__ is unicode) - vereq(u[0:0], u"") - - class sublist(list): - pass - a = sublist(range(5)) - vereq(a, range(5)) - a.append("hello") - vereq(a, range(5) + ["hello"]) - a[5] = 5 - vereq(a, range(6)) - a.extend(range(6, 20)) - vereq(a, range(20)) - a[-5:] = [] - vereq(a, range(15)) - del a[10:15] - vereq(len(a), 10) - vereq(a, range(10)) - vereq(list(a), range(10)) - vereq(a[0], 0) - vereq(a[9], 9) - vereq(a[-10], 0) - vereq(a[-1], 9) - vereq(a[:5], range(5)) - - class CountedInput(file): - """Counts lines read by self.readline(). - - self.lineno is the 0-based ordinal of the last line read, up to - a maximum of one greater than the number of lines in the file. - - self.ateof is true if and only if the final "" line has been read, - at which point self.lineno stops incrementing, and further calls - to readline() continue to return "". - """ - - lineno = 0 - ateof = 0 - def readline(self): - if self.ateof: - return "" - s = file.readline(self) - # Next line works too. - # s = super(CountedInput, self).readline() - self.lineno += 1 - if s == "": - self.ateof = 1 - return s - - f = file(name=TESTFN, mode='w') - lines = ['a\n', 'b\n', 'c\n'] - try: - f.writelines(lines) - f.close() - f = CountedInput(TESTFN) - for (i, expected) in zip(range(1, 5) + [4], lines + 2 * [""]): - got = f.readline() - vereq(expected, got) - vereq(f.lineno, i) - vereq(f.ateof, (i > len(lines))) - f.close() - finally: try: - f.close() - except: + L.__bases__ = (dict,) + except TypeError: pass + else: + self.fail("shouldn't turn list subclass into dict subclass") + try: - import os - os.unlink(TESTFN) - except: + list.__bases__ = (dict,) + except TypeError: pass + else: + self.fail("shouldn't be able to assign to list.__bases__") -def keywords(): - if verbose: - print "Testing keyword args to basic type constructors ..." - vereq(int(x=1), 1) - vereq(float(x=2), 2.0) - vereq(long(x=3), 3L) - vereq(complex(imag=42, real=666), complex(666, 42)) - vereq(str(object=500), '500') - vereq(unicode(string='abc', errors='strict'), u'abc') - vereq(tuple(sequence=range(3)), (0, 1, 2)) - vereq(list(sequence=(0, 1, 2)), range(3)) - # note: as of Python 2.3, dict() no longer has an "items" keyword arg - - for constructor in (int, float, long, complex, str, unicode, - tuple, list, file): - try: - constructor(bogus_keyword_arg=1) + try: + D.__bases__ = (C2, list) except TypeError: pass else: - raise TestFailed("expected TypeError from bogus keyword " - "argument to %r" % constructor) - -def restricted(): - # XXX This test is disabled because rexec is not deemed safe - return - import rexec - if verbose: - print "Testing interaction with restricted execution ..." - - sandbox = rexec.RExec() - - code1 = """f = open(%r, 'w')""" % TESTFN - code2 = """f = file(%r, 'w')""" % TESTFN - code3 = """\ -f = open(%r) -t = type(f) # a sneaky way to get the file() constructor -f.close() -f = t(%r, 'w') # rexec can't catch this by itself -""" % (TESTFN, TESTFN) + assert 0, "best_base calculation found wanting" - f = open(TESTFN, 'w') # Create the file so code3 can find it. - f.close() - - try: - for code in code1, code2, code3: - try: - sandbox.r_exec(code) - except IOError, msg: - if str(msg).find("restricted") >= 0: - outcome = "OK" - else: - outcome = "got an exception, but not an expected one" - else: - outcome = "expected a restricted-execution exception" + try: + del D.__bases__ + except TypeError: + pass + else: + self.fail("shouldn't be able to delete .__bases__") - if outcome != "OK": - raise TestFailed("%s, in %r" % (outcome, code)) + try: + D.__bases__ = () + except TypeError, msg: + if str(msg) == "a new-style class can't have only classic bases": + self.fail("wrong error message for .__bases__ = ()") + else: + self.fail("shouldn't be able to set .__bases__ to ()") - finally: try: - import os - os.unlink(TESTFN) - except: + D.__bases__ = (D,) + except TypeError: pass + else: + # actually, we'll have crashed by here... + self.fail("shouldn't be able to create inheritance cycles") -def str_subclass_as_dict_key(): - if verbose: - print "Testing a str subclass used as dict key .." - - class cistr(str): - """Sublcass of str that computes __eq__ case-insensitively. - - Also computes a hash code of the string in canonical form. - """ - - def __init__(self, value): - self.canonical = value.lower() - self.hashcode = hash(self.canonical) - - def __eq__(self, other): - if not isinstance(other, cistr): - other = cistr(other) - return self.canonical == other.canonical - - def __hash__(self): - return self.hashcode - - vereq(cistr('ABC'), 'abc') - vereq('aBc', cistr('ABC')) - vereq(str(cistr('ABC')), 'ABC') - - d = {cistr('one'): 1, cistr('two'): 2, cistr('tHree'): 3} - vereq(d[cistr('one')], 1) - vereq(d[cistr('tWo')], 2) - vereq(d[cistr('THrEE')], 3) - verify(cistr('ONe') in d) - vereq(d.get(cistr('thrEE')), 3) - -def classic_comparisons(): - if verbose: print "Testing classic comparisons..." - class classic: - pass - for base in (classic, int, object): - if verbose: print " (base = %s)" % base - class C(base): - def __init__(self, value): - self.value = int(value) - def __cmp__(self, other): - if isinstance(other, C): - return cmp(self.value, other.value) - if isinstance(other, int) or isinstance(other, long): - return cmp(self.value, other) - return NotImplemented - c1 = C(1) - c2 = C(2) - c3 = C(3) - vereq(c1, 1) - c = {1: c1, 2: c2, 3: c3} - for x in 1, 2, 3: - for y in 1, 2, 3: - verify(cmp(c[x], c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y)) - for op in "<", "<=", "==", "!=", ">", ">=": - verify(eval("c[x] %s c[y]" % op) == eval("x %s y" % op), - "x=%d, y=%d" % (x, y)) - verify(cmp(c[x], y) == cmp(x, y), "x=%d, y=%d" % (x, y)) - verify(cmp(x, c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y)) - -def rich_comparisons(): - if verbose: - print "Testing rich comparisons..." - class Z(complex): - pass - z = Z(1) - vereq(z, 1+0j) - vereq(1+0j, z) - class ZZ(complex): - def __eq__(self, other): - try: - return abs(self - other) <= 1e-6 - except: - return NotImplemented - zz = ZZ(1.0000003) - vereq(zz, 1+0j) - vereq(1+0j, zz) - - class classic: - pass - for base in (classic, int, object, list): - if verbose: print " (base = %s)" % base - class C(base): - def __init__(self, value): - self.value = int(value) - def __cmp__(self, other): - raise TestFailed, "shouldn't call __cmp__" - def __eq__(self, other): - if isinstance(other, C): - return self.value == other.value - if isinstance(other, int) or isinstance(other, long): - return self.value == other - return NotImplemented - def __ne__(self, other): - if isinstance(other, C): - return self.value != other.value - if isinstance(other, int) or isinstance(other, long): - return self.value != other - return NotImplemented - def __lt__(self, other): - if isinstance(other, C): - return self.value < other.value - if isinstance(other, int) or isinstance(other, long): - return self.value < other - return NotImplemented - def __le__(self, other): - if isinstance(other, C): - return self.value <= other.value - if isinstance(other, int) or isinstance(other, long): - return self.value <= other - return NotImplemented - def __gt__(self, other): - if isinstance(other, C): - return self.value > other.value - if isinstance(other, int) or isinstance(other, long): - return self.value > other - return NotImplemented - def __ge__(self, other): - if isinstance(other, C): - return self.value >= other.value - if isinstance(other, int) or isinstance(other, long): - return self.value >= other - return NotImplemented - c1 = C(1) - c2 = C(2) - c3 = C(3) - vereq(c1, 1) - c = {1: c1, 2: c2, 3: c3} - for x in 1, 2, 3: - for y in 1, 2, 3: - for op in "<", "<=", "==", "!=", ">", ">=": - verify(eval("c[x] %s c[y]" % op) == eval("x %s y" % op), - "x=%d, y=%d" % (x, y)) - verify(eval("c[x] %s y" % op) == eval("x %s y" % op), - "x=%d, y=%d" % (x, y)) - verify(eval("x %s c[y]" % op) == eval("x %s y" % op), - "x=%d, y=%d" % (x, y)) - -def coercions(): - if verbose: print "Testing coercions..." - class I(int): pass - coerce(I(0), 0) - coerce(0, I(0)) - class L(long): pass - coerce(L(0), 0) - coerce(L(0), 0L) - coerce(0, L(0)) - coerce(0L, L(0)) - class F(float): pass - coerce(F(0), 0) - coerce(F(0), 0L) - coerce(F(0), 0.) - coerce(0, F(0)) - coerce(0L, F(0)) - coerce(0., F(0)) - class C(complex): pass - coerce(C(0), 0) - coerce(C(0), 0L) - coerce(C(0), 0.) - coerce(C(0), 0j) - coerce(0, C(0)) - coerce(0L, C(0)) - coerce(0., C(0)) - coerce(0j, C(0)) - -def descrdoc(): - if verbose: print "Testing descriptor doc strings..." - def check(descr, what): - vereq(descr.__doc__, what) - check(file.closed, "True if the file is closed") # getset descriptor - check(file.name, "file name") # member descriptor - -def setclass(): - if verbose: print "Testing __class__ assignment..." - class C(object): pass - class D(object): pass - class E(object): pass - class F(D, E): pass - for cls in C, D, E, F: - for cls2 in C, D, E, F: - x = cls() - x.__class__ = cls2 - verify(x.__class__ is cls2) - x.__class__ = cls - verify(x.__class__ is cls) - def cant(x, C): try: - x.__class__ = C + D.__bases__ = (C, C) except TypeError: pass else: - raise TestFailed, "shouldn't allow %r.__class__ = %r" % (x, C) + self.fail("didn't detect repeated base classes") + try: - delattr(x, "__class__") + D.__bases__ = (E,) except TypeError: pass else: - raise TestFailed, "shouldn't allow del %r.__class__" % x - cant(C(), list) - cant(list(), C) - cant(C(), 1) - cant(C(), object) - cant(object(), list) - cant(list(), object) - class Int(int): __slots__ = [] - cant(2, Int) - cant(Int(), int) - cant(True, int) - cant(2, bool) - o = object() - cant(o, type(1)) - cant(o, type(None)) - del o - class G(object): - __slots__ = ["a", "b"] - class H(object): - __slots__ = ["b", "a"] - try: - unicode - except NameError: - class I(object): - __slots__ = ["a", "b"] - else: - class I(object): - __slots__ = [unicode("a"), unicode("b")] - class J(object): - __slots__ = ["c", "b"] - class K(object): - __slots__ = ["a", "b", "d"] - class L(H): - __slots__ = ["e"] - class M(I): - __slots__ = ["e"] - class N(J): - __slots__ = ["__weakref__"] - class P(J): - __slots__ = ["__dict__"] - class Q(J): - pass - class R(J): - __slots__ = ["__dict__", "__weakref__"] + self.fail("shouldn't be able to create inheritance cycles") - for cls, cls2 in ((G, H), (G, I), (I, H), (Q, R), (R, Q)): - x = cls() - x.a = 1 - x.__class__ = cls2 - verify(x.__class__ is cls2, - "assigning %r as __class__ for %r silently failed" % (cls2, x)) - vereq(x.a, 1) - x.__class__ = cls - verify(x.__class__ is cls, - "assigning %r as __class__ for %r silently failed" % (cls, x)) - vereq(x.a, 1) - for cls in G, J, K, L, M, N, P, R, list, Int: - for cls2 in G, J, K, L, M, N, P, R, list, Int: - if cls is cls2: - continue - cant(cls(), cls2) - -def setdict(): - if verbose: print "Testing __dict__ assignment..." - class C(object): pass - a = C() - a.__dict__ = {'b': 1} - vereq(a.b, 1) - def cant(x, dict): + # let's throw a classic class into the mix: + class Classic: + def meth2(self): + return 3 + + D.__bases__ = (C, Classic) + + self.assertEqual(d.meth2(), 3) + self.assertEqual(e.meth2(), 3) try: - x.__dict__ = dict - except (AttributeError, TypeError): + d.a + except AttributeError: pass else: - raise TestFailed, "shouldn't allow %r.__dict__ = %r" % (x, dict) - cant(a, None) - cant(a, []) - cant(a, 1) - del a.__dict__ # Deleting __dict__ is allowed - - class Base(object): - pass - def verify_dict_readonly(x): - """ - x has to be an instance of a class inheriting from Base. - """ - cant(x, {}) + self.fail("attribute should have vanished") + try: - del x.__dict__ - except (AttributeError, TypeError): + D.__bases__ = (Classic,) + except TypeError: + pass + else: + self.fail("new-style class must have a new-style base") + + def test_mutable_bases_with_failing_mro(self): + # Testing mutable bases with failing mro... + class WorkOnce(type): + def __new__(self, name, bases, ns): + self.flag = 0 + return super(WorkOnce, self).__new__(WorkOnce, name, bases, ns) + def mro(self): + if self.flag > 0: + raise RuntimeError, "bozo" + else: + self.flag += 1 + return type.mro(self) + + class WorkAlways(type): + def mro(self): + # this is here to make sure that .mro()s aren't called + # with an exception set (which was possible at one point). + # An error message will be printed in a debug build. + # What's a good way to test for this? + return type.mro(self) + + class C(object): + pass + + class C2(object): + pass + + class D(C): + pass + + class E(D): pass + + class F(D): + __metaclass__ = WorkOnce + + class G(D): + __metaclass__ = WorkAlways + + # Immediate subclasses have their mro's adjusted in alphabetical + # order, so E's will get adjusted before adjusting F's fails. We + # check here that E's gets restored. + + E_mro_before = E.__mro__ + D_mro_before = D.__mro__ + + try: + D.__bases__ = (C2,) + except RuntimeError: + self.assertEqual(E.__mro__, E_mro_before) + self.assertEqual(D.__mro__, D_mro_before) else: - raise TestFailed, "shouldn't allow del %r.__dict__" % x - dict_descr = Base.__dict__["__dict__"] + self.fail("exception not propagated") + + def test_mutable_bases_catch_mro_conflict(self): + # Testing mutable bases catch mro conflict... + class A(object): + pass + + class B(object): + pass + + class C(A, B): + pass + + class D(A, B): + pass + + class E(C, D): + pass + try: - dict_descr.__set__(x, {}) - except (AttributeError, TypeError): + C.__bases__ = (B, A) + except TypeError: pass else: - raise TestFailed, "dict_descr allowed access to %r's dict" % x + self.fail("didn't catch MRO conflict") + + def test_mutable_names(self): + # Testing mutable names... + class C(object): + pass + + # C.__module__ could be 'test_descr' or '__main__' + mod = C.__module__ + + C.__name__ = 'D' + self.assertEqual((C.__module__, C.__name__), (mod, 'D')) + + C.__name__ = 'D.E' + self.assertEqual((C.__module__, C.__name__), (mod, 'D.E')) + + def test_subclass_right_op(self): + # Testing correct dispatch of subclass overloading __r__... + + # This code tests various cases where right-dispatch of a subclass + # should be preferred over left-dispatch of a base class. + + # Case 1: subclass of int; this tests code in abstract.c::binary_op1() + + class B(int): + def __floordiv__(self, other): + return "B.__floordiv__" + def __rfloordiv__(self, other): + return "B.__rfloordiv__" + + self.assertEqual(B(1) // 1, "B.__floordiv__") + self.assertEqual(1 // B(1), "B.__rfloordiv__") + + # Case 2: subclass of object; this is just the baseline for case 3 + + class C(object): + def __floordiv__(self, other): + return "C.__floordiv__" + def __rfloordiv__(self, other): + return "C.__rfloordiv__" + + self.assertEqual(C() // 1, "C.__floordiv__") + self.assertEqual(1 // C(), "C.__rfloordiv__") + + # Case 3: subclass of new-style class; here it gets interesting - # Classes don't allow __dict__ assignment and have readonly dicts - class Meta1(type, Base): - pass - class Meta2(Base, type): - pass - class D(object): - __metaclass__ = Meta1 - class E(object): - __metaclass__ = Meta2 - for cls in C, D, E: - verify_dict_readonly(cls) - class_dict = cls.__dict__ - try: - class_dict["spam"] = "eggs" - except TypeError: - pass - else: - raise TestFailed, "%r's __dict__ can be modified" % cls - - # Modules also disallow __dict__ assignment - class Module1(types.ModuleType, Base): - pass - class Module2(Base, types.ModuleType): - pass - for ModuleType in Module1, Module2: - mod = ModuleType("spam") - verify_dict_readonly(mod) - mod.__dict__["spam"] = "eggs" - - # Exception's __dict__ can be replaced, but not deleted - class Exception1(Exception, Base): - pass - class Exception2(Base, Exception): - pass - for ExceptionType in Exception, Exception1, Exception2: - e = ExceptionType() - e.__dict__ = {"a": 1} - vereq(e.a, 1) - try: - del e.__dict__ - except (TypeError, AttributeError): - pass - else: - raise TestFaied, "%r's __dict__ can be deleted" % e - - -def pickles(): - if verbose: - print "Testing pickling and copying new-style classes and objects..." - import pickle, cPickle - - def sorteditems(d): - L = d.items() - L.sort() - return L - - global C - class C(object): - def __init__(self, a, b): - super(C, self).__init__() - self.a = a - self.b = b - def __repr__(self): - return "C(%r, %r)" % (self.a, self.b) - - global C1 - class C1(list): - def __new__(cls, a, b): - return super(C1, cls).__new__(cls) - def __getnewargs__(self): - return (self.a, self.b) - def __init__(self, a, b): - self.a = a - self.b = b - def __repr__(self): - return "C1(%r, %r)<%r>" % (self.a, self.b, list(self)) - - global C2 - class C2(int): - def __new__(cls, a, b, val=0): - return super(C2, cls).__new__(cls, val) - def __getnewargs__(self): - return (self.a, self.b, int(self)) - def __init__(self, a, b, val=0): - self.a = a - self.b = b - def __repr__(self): - return "C2(%r, %r)<%r>" % (self.a, self.b, int(self)) - - global C3 - class C3(object): - def __init__(self, foo): - self.foo = foo - def __getstate__(self): - return self.foo - def __setstate__(self, foo): - self.foo = foo - - global C4classic, C4 - class C4classic: # classic - pass - class C4(C4classic, object): # mixed inheritance - pass - - for p in pickle, cPickle: - for bin in 0, 1: - if verbose: - print p.__name__, ["text", "binary"][bin] - - for cls in C, C1, C2: - s = p.dumps(cls, bin) - cls2 = p.loads(s) - verify(cls2 is cls) - - a = C1(1, 2); a.append(42); a.append(24) - b = C2("hello", "world", 42) - s = p.dumps((a, b), bin) - x, y = p.loads(s) - vereq(x.__class__, a.__class__) - vereq(sorteditems(x.__dict__), sorteditems(a.__dict__)) - vereq(y.__class__, b.__class__) - vereq(sorteditems(y.__dict__), sorteditems(b.__dict__)) - vereq(repr(x), repr(a)) - vereq(repr(y), repr(b)) - if verbose: - print "a = x =", a - print "b = y =", b - # Test for __getstate__ and __setstate__ on new style class - u = C3(42) - s = p.dumps(u, bin) - v = p.loads(s) - veris(u.__class__, v.__class__) - vereq(u.foo, v.foo) - # Test for picklability of hybrid class - u = C4() - u.foo = 42 - s = p.dumps(u, bin) - v = p.loads(s) - veris(u.__class__, v.__class__) - vereq(u.foo, v.foo) - - # Testing copy.deepcopy() - if verbose: - print "deepcopy" - import copy - for cls in C, C1, C2: - cls2 = copy.deepcopy(cls) - verify(cls2 is cls) - - a = C1(1, 2); a.append(42); a.append(24) - b = C2("hello", "world", 42) - x, y = copy.deepcopy((a, b)) - vereq(x.__class__, a.__class__) - vereq(sorteditems(x.__dict__), sorteditems(a.__dict__)) - vereq(y.__class__, b.__class__) - vereq(sorteditems(y.__dict__), sorteditems(b.__dict__)) - vereq(repr(x), repr(a)) - vereq(repr(y), repr(b)) - if verbose: - print "a = x =", a - print "b = y =", b - -def pickleslots(): - if verbose: print "Testing pickling of classes with __slots__ ..." - import pickle, cPickle - # Pickling of classes with __slots__ but without __getstate__ should fail - global B, C, D, E - class B(object): - pass - for base in [object, B]: - class C(base): - __slots__ = ['a'] class D(C): + def __floordiv__(self, other): + return "D.__floordiv__" + def __rfloordiv__(self, other): + return "D.__rfloordiv__" + + self.assertEqual(D() // C(), "D.__floordiv__") + self.assertEqual(C() // D(), "D.__rfloordiv__") + + # Case 4: this didn't work right in 2.2.2 and 2.3a1 + + class E(C): pass + + self.assertEqual(E.__rfloordiv__, C.__rfloordiv__) + + self.assertEqual(E() // 1, "C.__floordiv__") + self.assertEqual(1 // E(), "C.__rfloordiv__") + self.assertEqual(E() // C(), "C.__floordiv__") + self.assertEqual(C() // E(), "C.__floordiv__") # This one would fail + + def test_meth_class_get(self): + # Testing __get__ method of METH_CLASS C methods... + # Full coverage of descrobject.c::classmethod_get() + + # Baseline + arg = [1, 2, 3] + res = {1: None, 2: None, 3: None} + self.assertEqual(dict.fromkeys(arg), res) + self.assertEqual({}.fromkeys(arg), res) + + # Now get the descriptor + descr = dict.__dict__["fromkeys"] + + # More baseline using the descriptor directly + self.assertEqual(descr.__get__(None, dict)(arg), res) + self.assertEqual(descr.__get__({})(arg), res) + + # Now check various error cases try: - pickle.dumps(C()) + descr.__get__(None, None) except TypeError: pass else: - raise TestFailed, "should fail: pickle C instance - %s" % base + self.fail("shouldn't have allowed descr.__get__(None, None)") try: - cPickle.dumps(C()) + descr.__get__(42) except TypeError: pass else: - raise TestFailed, "should fail: cPickle C instance - %s" % base + self.fail("shouldn't have allowed descr.__get__(42)") try: - pickle.dumps(C()) + descr.__get__(None, 42) except TypeError: pass else: - raise TestFailed, "should fail: pickle D instance - %s" % base + self.fail("shouldn't have allowed descr.__get__(None, 42)") try: - cPickle.dumps(D()) + descr.__get__(None, int) except TypeError: pass else: - raise TestFailed, "should fail: cPickle D instance - %s" % base - # Give C a nice generic __getstate__ and __setstate__ - class C(base): - __slots__ = ['a'] - def __getstate__(self): - try: - d = self.__dict__.copy() - except AttributeError: - d = {} - for cls in self.__class__.__mro__: - for sn in cls.__dict__.get('__slots__', ()): - try: - d[sn] = getattr(self, sn) - except AttributeError: - pass - return d - def __setstate__(self, d): - for k, v in d.items(): - setattr(self, k, v) + self.fail("shouldn't have allowed descr.__get__(None, int)") + + def test_isinst_isclass(self): + # Testing proxy isinstance() and isclass()... + class Proxy(object): + def __init__(self, obj): + self.__obj = obj + def __getattribute__(self, name): + if name.startswith("_Proxy__"): + return object.__getattribute__(self, name) + else: + return getattr(self.__obj, name) + # Test with a classic class + class C: + pass + a = C() + pa = Proxy(a) + self.assert_(isinstance(a, C)) # Baseline + self.assert_(isinstance(pa, C)) # Test + # Test with a classic subclass class D(C): pass - # Now it should work - x = C() - y = pickle.loads(pickle.dumps(x)) - vereq(hasattr(y, 'a'), 0) - y = cPickle.loads(cPickle.dumps(x)) - vereq(hasattr(y, 'a'), 0) - x.a = 42 - y = pickle.loads(pickle.dumps(x)) - vereq(y.a, 42) - y = cPickle.loads(cPickle.dumps(x)) - vereq(y.a, 42) - x = D() - x.a = 42 - x.b = 100 - y = pickle.loads(pickle.dumps(x)) - vereq(y.a + y.b, 142) - y = cPickle.loads(cPickle.dumps(x)) - vereq(y.a + y.b, 142) - # A subclass that adds a slot should also work - class E(C): - __slots__ = ['b'] - x = E() - x.a = 42 - x.b = "foo" - y = pickle.loads(pickle.dumps(x)) - vereq(y.a, x.a) - vereq(y.b, x.b) - y = cPickle.loads(cPickle.dumps(x)) - vereq(y.a, x.a) - vereq(y.b, x.b) - -def copies(): - if verbose: print "Testing copy.copy() and copy.deepcopy()..." - import copy - class C(object): - pass - - a = C() - a.foo = 12 - b = copy.copy(a) - vereq(b.__dict__, a.__dict__) - - a.bar = [1,2,3] - c = copy.copy(a) - vereq(c.bar, a.bar) - verify(c.bar is a.bar) - - d = copy.deepcopy(a) - vereq(d.__dict__, a.__dict__) - a.bar.append(4) - vereq(d.bar, [1,2,3]) - -def binopoverride(): - if verbose: print "Testing overrides of binary operations..." - class I(int): - def __repr__(self): - return "I(%r)" % int(self) - def __add__(self, other): - return I(int(self) + int(other)) - __radd__ = __add__ - def __pow__(self, other, mod=None): - if mod is None: - return I(pow(int(self), int(other))) - else: - return I(pow(int(self), int(other), int(mod))) - def __rpow__(self, other, mod=None): - if mod is None: - return I(pow(int(other), int(self), mod)) - else: - return I(pow(int(other), int(self), int(mod))) + a = D() + pa = Proxy(a) + self.assert_(isinstance(a, C)) # Baseline + self.assert_(isinstance(pa, C)) # Test + # Test with a new-style class + class C(object): + pass + a = C() + pa = Proxy(a) + self.assert_(isinstance(a, C)) # Baseline + self.assert_(isinstance(pa, C)) # Test + # Test with a new-style subclass + class D(C): + pass + a = D() + pa = Proxy(a) + self.assert_(isinstance(a, C)) # Baseline + self.assert_(isinstance(pa, C)) # Test + + def test_proxy_super(self): + # Testing super() for a proxy object... + class Proxy(object): + def __init__(self, obj): + self.__obj = obj + def __getattribute__(self, name): + if name.startswith("_Proxy__"): + return object.__getattribute__(self, name) + else: + return getattr(self.__obj, name) - vereq(repr(I(1) + I(2)), "I(3)") - vereq(repr(I(1) + 2), "I(3)") - vereq(repr(1 + I(2)), "I(3)") - vereq(repr(I(2) ** I(3)), "I(8)") - vereq(repr(2 ** I(3)), "I(8)") - vereq(repr(I(2) ** 3), "I(8)") - vereq(repr(pow(I(2), I(3), I(5))), "I(3)") - class S(str): - def __eq__(self, other): - return self.lower() == other.lower() - -def subclasspropagation(): - if verbose: print "Testing propagation of slot functions to subclasses..." - class A(object): - pass - class B(A): - pass - class C(A): - pass - class D(B, C): - pass - d = D() - orig_hash = hash(d) # related to id(d) in platform-dependent ways - A.__hash__ = lambda self: 42 - vereq(hash(d), 42) - C.__hash__ = lambda self: 314 - vereq(hash(d), 314) - B.__hash__ = lambda self: 144 - vereq(hash(d), 144) - D.__hash__ = lambda self: 100 - vereq(hash(d), 100) - del D.__hash__ - vereq(hash(d), 144) - del B.__hash__ - vereq(hash(d), 314) - del C.__hash__ - vereq(hash(d), 42) - del A.__hash__ - vereq(hash(d), orig_hash) - d.foo = 42 - d.bar = 42 - vereq(d.foo, 42) - vereq(d.bar, 42) - def __getattribute__(self, name): - if name == "foo": - return 24 - return object.__getattribute__(self, name) - A.__getattribute__ = __getattribute__ - vereq(d.foo, 24) - vereq(d.bar, 42) - def __getattr__(self, name): - if name in ("spam", "foo", "bar"): - return "hello" - raise AttributeError, name - B.__getattr__ = __getattr__ - vereq(d.spam, "hello") - vereq(d.foo, 24) - vereq(d.bar, 42) - del A.__getattribute__ - vereq(d.foo, 42) - del d.foo - vereq(d.foo, "hello") - vereq(d.bar, 42) - del B.__getattr__ - try: - d.foo - except AttributeError: - pass - else: - raise TestFailed, "d.foo should be undefined now" - - # Test a nasty bug in recurse_down_subclasses() - import gc - class A(object): - pass - class B(A): - pass - del B - gc.collect() - A.__setitem__ = lambda *a: None # crash - -def buffer_inherit(): - import binascii - # SF bug [#470040] ParseTuple t# vs subclasses. - if verbose: - print "Testing that buffer interface is inherited ..." - - class MyStr(str): - pass - base = 'abc' - m = MyStr(base) - # b2a_hex uses the buffer interface to get its argument's value, via - # PyArg_ParseTuple 't#' code. - vereq(binascii.b2a_hex(m), binascii.b2a_hex(base)) - - # It's not clear that unicode will continue to support the character - # buffer interface, and this test will fail if that's taken away. - class MyUni(unicode): - pass - base = u'abc' - m = MyUni(base) - vereq(binascii.b2a_hex(m), binascii.b2a_hex(base)) - - class MyInt(int): - pass - m = MyInt(42) - try: - binascii.b2a_hex(m) - raise TestFailed('subclass of int should not have a buffer interface') - except TypeError: - pass - -def str_of_str_subclass(): - import binascii - import cStringIO - - if verbose: - print "Testing __str__ defined in subclass of str ..." - - class octetstring(str): - def __str__(self): - return binascii.b2a_hex(self) - def __repr__(self): - return self + " repr" - - o = octetstring('A') - vereq(type(o), octetstring) - vereq(type(str(o)), str) - vereq(type(repr(o)), str) - vereq(ord(o), 0x41) - vereq(str(o), '41') - vereq(repr(o), 'A repr') - vereq(o.__str__(), '41') - vereq(o.__repr__(), 'A repr') - - capture = cStringIO.StringIO() - # Calling str() or not exercises different internal paths. - print >> capture, o - print >> capture, str(o) - vereq(capture.getvalue(), '41\n41\n') - capture.close() - -def kwdargs(): - if verbose: print "Testing keyword arguments to __init__, __call__..." - def f(a): return a - vereq(f.__call__(a=42), 42) - a = [] - list.__init__(a, sequence=[0, 1, 2]) - vereq(a, [0, 1, 2]) - -def recursive__call__(): - if verbose: print ("Testing recursive __call__() by setting to instance of " - "class ...") - class A(object): - pass - - A.__call__ = A() - try: - A()() - except RuntimeError: - pass - else: - raise TestFailed("Recursion limit should have been reached for " - "__call__()") - -def delhook(): - if verbose: print "Testing __del__ hook..." - log = [] - class C(object): - def __del__(self): - log.append(1) - c = C() - vereq(log, []) - del c - vereq(log, [1]) - - class D(object): pass - d = D() - try: del d[0] - except TypeError: pass - else: raise TestFailed, "invalid del() didn't raise TypeError" - -def hashinherit(): - if verbose: print "Testing hash of mutable subclasses..." - - class mydict(dict): - pass - d = mydict() - try: - hash(d) - except TypeError: - pass - else: - raise TestFailed, "hash() of dict subclass should fail" - - class mylist(list): - pass - d = mylist() - try: - hash(d) - except TypeError: - pass - else: - raise TestFailed, "hash() of list subclass should fail" - -def strops(): - try: 'a' + 5 - except TypeError: pass - else: raise TestFailed, "'' + 5 doesn't raise TypeError" - - try: ''.split('') - except ValueError: pass - else: raise TestFailed, "''.split('') doesn't raise ValueError" - - try: ''.join([0]) - except TypeError: pass - else: raise TestFailed, "''.join([0]) doesn't raise TypeError" - - try: ''.rindex('5') - except ValueError: pass - else: raise TestFailed, "''.rindex('5') doesn't raise ValueError" - - try: '%(n)s' % None - except TypeError: pass - else: raise TestFailed, "'%(n)s' % None doesn't raise TypeError" - - try: '%(n' % {} - except ValueError: pass - else: raise TestFailed, "'%(n' % {} '' doesn't raise ValueError" - - try: '%*s' % ('abc') - except TypeError: pass - else: raise TestFailed, "'%*s' % ('abc') doesn't raise TypeError" - - try: '%*.*s' % ('abc', 5) - except TypeError: pass - else: raise TestFailed, "'%*.*s' % ('abc', 5) doesn't raise TypeError" - - try: '%s' % (1, 2) - except TypeError: pass - else: raise TestFailed, "'%s' % (1, 2) doesn't raise TypeError" - - try: '%' % None - except ValueError: pass - else: raise TestFailed, "'%' % None doesn't raise ValueError" - - vereq('534253'.isdigit(), 1) - vereq('534253x'.isdigit(), 0) - vereq('%c' % 5, '\x05') - vereq('%c' % '5', '5') - -def deepcopyrecursive(): - if verbose: print "Testing deepcopy of recursive objects..." - class Node: - pass - a = Node() - b = Node() - a.b = b - b.a = a - z = deepcopy(a) # This blew up before - -def modules(): - if verbose: print "Testing uninitialized module objects..." - from types import ModuleType as M - m = M.__new__(M) - str(m) - vereq(hasattr(m, "__name__"), 0) - vereq(hasattr(m, "__file__"), 0) - vereq(hasattr(m, "foo"), 0) - vereq(m.__dict__, None) - m.foo = 1 - vereq(m.__dict__, {"foo": 1}) - -def dictproxyiterkeys(): - class C(object): - def meth(self): - pass - if verbose: print "Testing dict-proxy iterkeys..." - keys = [ key for key in C.__dict__.iterkeys() ] - keys.sort() - vereq(keys, ['__dict__', '__doc__', '__module__', '__weakref__', 'meth']) - -def dictproxyitervalues(): - class C(object): - def meth(self): - pass - if verbose: print "Testing dict-proxy itervalues..." - values = [ values for values in C.__dict__.itervalues() ] - vereq(len(values), 5) - -def dictproxyiteritems(): - class C(object): - def meth(self): - pass - if verbose: print "Testing dict-proxy iteritems..." - keys = [ key for (key, value) in C.__dict__.iteritems() ] - keys.sort() - vereq(keys, ['__dict__', '__doc__', '__module__', '__weakref__', 'meth']) - -def funnynew(): - if verbose: print "Testing __new__ returning something unexpected..." - class C(object): - def __new__(cls, arg): - if isinstance(arg, str): return [1, 2, 3] - elif isinstance(arg, int): return object.__new__(D) - else: return object.__new__(cls) - class D(C): - def __init__(self, arg): - self.foo = arg - vereq(C("1"), [1, 2, 3]) - vereq(D("1"), [1, 2, 3]) - d = D(None) - veris(d.foo, None) - d = C(1) - vereq(isinstance(d, D), True) - vereq(d.foo, 1) - d = D(1) - vereq(isinstance(d, D), True) - vereq(d.foo, 1) - -def imulbug(): - # SF bug 544647 - if verbose: print "Testing for __imul__ problems..." - class C(object): - def __imul__(self, other): - return (self, other) - x = C() - y = x - y *= 1.0 - vereq(y, (x, 1.0)) - y = x - y *= 2 - vereq(y, (x, 2)) - y = x - y *= 3L - vereq(y, (x, 3L)) - y = x - y *= 1L<<100 - vereq(y, (x, 1L<<100)) - y = x - y *= None - vereq(y, (x, None)) - y = x - y *= "foo" - vereq(y, (x, "foo")) - -def docdescriptor(): - # SF bug 542984 - if verbose: print "Testing __doc__ descriptor..." - class DocDescr(object): - def __get__(self, object, otype): - if object: - object = object.__class__.__name__ + ' instance' - if otype: - otype = otype.__name__ - return 'object=%s; type=%s' % (object, otype) - class OldClass: - __doc__ = DocDescr() - class NewClass(object): - __doc__ = DocDescr() - vereq(OldClass.__doc__, 'object=None; type=OldClass') - vereq(OldClass().__doc__, 'object=OldClass instance; type=OldClass') - vereq(NewClass.__doc__, 'object=None; type=NewClass') - vereq(NewClass().__doc__, 'object=NewClass instance; type=NewClass') - -def copy_setstate(): - if verbose: - print "Testing that copy.*copy() correctly uses __setstate__..." - import copy - class C(object): - def __init__(self, foo=None): - self.foo = foo - self.__foo = foo - def setfoo(self, foo=None): - self.foo = foo - def getfoo(self): - return self.__foo - def __getstate__(self): - return [self.foo] - def __setstate__(self, lst): - assert len(lst) == 1 - self.__foo = self.foo = lst[0] - a = C(42) - a.setfoo(24) - vereq(a.foo, 24) - vereq(a.getfoo(), 42) - b = copy.copy(a) - vereq(b.foo, 24) - vereq(b.getfoo(), 24) - b = copy.deepcopy(a) - vereq(b.foo, 24) - vereq(b.getfoo(), 24) - -def slices(): - if verbose: - print "Testing cases with slices and overridden __getitem__ ..." - # Strings - vereq("hello"[:4], "hell") - vereq("hello"[slice(4)], "hell") - vereq(str.__getitem__("hello", slice(4)), "hell") - class S(str): - def __getitem__(self, x): - return str.__getitem__(self, x) - vereq(S("hello")[:4], "hell") - vereq(S("hello")[slice(4)], "hell") - vereq(S("hello").__getitem__(slice(4)), "hell") - # Tuples - vereq((1,2,3)[:2], (1,2)) - vereq((1,2,3)[slice(2)], (1,2)) - vereq(tuple.__getitem__((1,2,3), slice(2)), (1,2)) - class T(tuple): - def __getitem__(self, x): - return tuple.__getitem__(self, x) - vereq(T((1,2,3))[:2], (1,2)) - vereq(T((1,2,3))[slice(2)], (1,2)) - vereq(T((1,2,3)).__getitem__(slice(2)), (1,2)) - # Lists - vereq([1,2,3][:2], [1,2]) - vereq([1,2,3][slice(2)], [1,2]) - vereq(list.__getitem__([1,2,3], slice(2)), [1,2]) - class L(list): - def __getitem__(self, x): - return list.__getitem__(self, x) - vereq(L([1,2,3])[:2], [1,2]) - vereq(L([1,2,3])[slice(2)], [1,2]) - vereq(L([1,2,3]).__getitem__(slice(2)), [1,2]) - # Now do lists and __setitem__ - a = L([1,2,3]) - a[slice(1, 3)] = [3,2] - vereq(a, [1,3,2]) - a[slice(0, 2, 1)] = [3,1] - vereq(a, [3,1,2]) - a.__setitem__(slice(1, 3), [2,1]) - vereq(a, [3,2,1]) - a.__setitem__(slice(0, 2, 1), [2,3]) - vereq(a, [2,3,1]) - -def subtype_resurrection(): - if verbose: - print "Testing resurrection of new-style instance..." - - class C(object): - container = [] - - def __del__(self): - # resurrect the instance - C.container.append(self) - - c = C() - c.attr = 42 - # The most interesting thing here is whether this blows up, due to flawed - # GC tracking logic in typeobject.c's call_finalizer() (a 2.2.1 bug). - del c - - # If that didn't blow up, it's also interesting to see whether clearing - # the last container slot works: that will attempt to delete c again, - # which will cause c to get appended back to the container again "during" - # the del. - del C.container[-1] - vereq(len(C.container), 1) - vereq(C.container[-1].attr, 42) - - # Make c mortal again, so that the test framework with -l doesn't report - # it as a leak. - del C.__del__ - -def slottrash(): - # Deallocating deeply nested slotted trash caused stack overflows - if verbose: - print "Testing slot trash..." - class trash(object): - __slots__ = ['x'] - def __init__(self, x): - self.x = x - o = None - for i in xrange(50000): - o = trash(o) - del o - -def slotmultipleinheritance(): - # SF bug 575229, multiple inheritance w/ slots dumps core - class A(object): - __slots__=() - class B(object): - pass - class C(A,B) : - __slots__=() - vereq(C.__basicsize__, B.__basicsize__) - verify(hasattr(C, '__dict__')) - verify(hasattr(C, '__weakref__')) - C().x = 2 - -def testrmul(): - # SF patch 592646 - if verbose: - print "Testing correct invocation of __rmul__..." - class C(object): - def __mul__(self, other): - return "mul" - def __rmul__(self, other): - return "rmul" - a = C() - vereq(a*2, "mul") - vereq(a*2.2, "mul") - vereq(2*a, "rmul") - vereq(2.2*a, "rmul") - -def testipow(): - # [SF bug 620179] - if verbose: - print "Testing correct invocation of __ipow__..." - class C(object): - def __ipow__(self, other): - pass - a = C() - a **= 2 - -def do_this_first(): - if verbose: - print "Testing SF bug 551412 ..." - # This dumps core when SF bug 551412 isn't fixed -- - # but only when test_descr.py is run separately. - # (That can't be helped -- as soon as PyType_Ready() - # is called for PyLong_Type, the bug is gone.) - class UserLong(object): - def __pow__(self, *args): - pass - try: - pow(0L, UserLong(), 0L) - except: - pass - - if verbose: - print "Testing SF bug 570483..." - # Another segfault only when run early - # (before PyType_Ready(tuple) is called) - type.mro(tuple) - -def test_mutable_bases(): - if verbose: - print "Testing mutable bases..." - # stuff that should work: - class C(object): - pass - class C2(object): - def __getattribute__(self, attr): - if attr == 'a': - return 2 - else: - return super(C2, self).__getattribute__(attr) - def meth(self): - return 1 - class D(C): - pass - class E(D): - pass - d = D() - e = E() - D.__bases__ = (C,) - D.__bases__ = (C2,) - vereq(d.meth(), 1) - vereq(e.meth(), 1) - vereq(d.a, 2) - vereq(e.a, 2) - vereq(C2.__subclasses__(), [D]) - - # stuff that shouldn't: - class L(list): - pass - - try: - L.__bases__ = (dict,) - except TypeError: - pass - else: - raise TestFailed, "shouldn't turn list subclass into dict subclass" - - try: - list.__bases__ = (dict,) - except TypeError: - pass - else: - raise TestFailed, "shouldn't be able to assign to list.__bases__" - - try: - D.__bases__ = (C2, list) - except TypeError: - pass - else: - assert 0, "best_base calculation found wanting" - - try: - del D.__bases__ - except TypeError: - pass - else: - raise TestFailed, "shouldn't be able to delete .__bases__" - - try: - D.__bases__ = () - except TypeError, msg: - if str(msg) == "a new-style class can't have only classic bases": - raise TestFailed, "wrong error message for .__bases__ = ()" - else: - raise TestFailed, "shouldn't be able to set .__bases__ to ()" - - try: - D.__bases__ = (D,) - except TypeError: - pass - else: - # actually, we'll have crashed by here... - raise TestFailed, "shouldn't be able to create inheritance cycles" - - try: - D.__bases__ = (C, C) - except TypeError: - pass - else: - raise TestFailed, "didn't detect repeated base classes" - - try: - D.__bases__ = (E,) - except TypeError: - pass - else: - raise TestFailed, "shouldn't be able to create inheritance cycles" - - # let's throw a classic class into the mix: - class Classic: - def meth2(self): - return 3 - - D.__bases__ = (C, Classic) - - vereq(d.meth2(), 3) - vereq(e.meth2(), 3) - try: - d.a - except AttributeError: - pass - else: - raise TestFailed, "attribute should have vanished" - - try: - D.__bases__ = (Classic,) - except TypeError: - pass - else: - raise TestFailed, "new-style class must have a new-style base" - -def test_mutable_bases_with_failing_mro(): - if verbose: - print "Testing mutable bases with failing mro..." - class WorkOnce(type): - def __new__(self, name, bases, ns): - self.flag = 0 - return super(WorkOnce, self).__new__(WorkOnce, name, bases, ns) - def mro(self): - if self.flag > 0: - raise RuntimeError, "bozo" - else: - self.flag += 1 - return type.mro(self) + class B(object): + def f(self): + return "B.f" + + class C(B): + def f(self): + return super(C, self).f() + "->C.f" + + obj = C() + p = Proxy(obj) + self.assertEqual(C.__dict__["f"](p), "B.f->C.f") + + def test_carloverre(self): + # Testing prohibition of Carlo Verre's hack... + try: + object.__setattr__(str, "foo", 42) + except TypeError: + pass + else: + self.fail("Carlo Verre __setattr__ suceeded!") + try: + object.__delattr__(str, "lower") + except TypeError: + pass + else: + self.fail("Carlo Verre __delattr__ succeeded!") - class WorkAlways(type): - def mro(self): - # this is here to make sure that .mro()s aren't called - # with an exception set (which was possible at one point). - # An error message will be printed in a debug build. - # What's a good way to test for this? - return type.mro(self) + def test_weakref_segfault(self): + # Testing weakref segfault... + # SF 742911 + import weakref - class C(object): - pass + class Provoker: + def __init__(self, referrent): + self.ref = weakref.ref(referrent) - class C2(object): - pass + def __del__(self): + x = self.ref() - class D(C): - pass + class Oops(object): + pass + + o = Oops() + o.whatever = Provoker(o) + del o + + def test_wrapper_segfault(self): + # SF 927248: deeply nested wrappers could cause stack overflow + f = lambda:None + for i in xrange(1000000): + f = f.__call__ + f = None + + def test_file_fault(self): + # Testing sys.stdout is changed in getattr... + import sys + class StdoutGuard: + def __getattr__(self, attr): + sys.stdout = sys.__stdout__ + raise RuntimeError("Premature access to sys.stdout.%s" % attr) + sys.stdout = StdoutGuard() + try: + print "Oops!" + except RuntimeError: + pass - class E(D): - pass + def test_vicious_descriptor_nonsense(self): + # Testing vicious_descriptor_nonsense... - class F(D): - __metaclass__ = WorkOnce + # A potential segfault spotted by Thomas Wouters in mail to + # python-dev 2003-04-17, turned into an example & fixed by Michael + # Hudson just less than four months later... + + class Evil(object): + def __hash__(self): + return hash('attr') + def __eq__(self, other): + del C.attr + return 0 - class G(D): - __metaclass__ = WorkAlways + class Descr(object): + def __get__(self, ob, type=None): + return 1 - # Immediate subclasses have their mro's adjusted in alphabetical - # order, so E's will get adjusted before adjusting F's fails. We - # check here that E's gets restored. + class C(object): + attr = Descr() - E_mro_before = E.__mro__ - D_mro_before = D.__mro__ + c = C() + c.__dict__[Evil()] = 0 - try: - D.__bases__ = (C2,) - except RuntimeError: - vereq(E.__mro__, E_mro_before) - vereq(D.__mro__, D_mro_before) - else: - raise TestFailed, "exception not propagated" - -def test_mutable_bases_catch_mro_conflict(): - if verbose: - print "Testing mutable bases catch mro conflict..." - class A(object): - pass - - class B(object): - pass - - class C(A, B): - pass - - class D(A, B): - pass - - class E(C, D): - pass - - try: - C.__bases__ = (B, A) - except TypeError: - pass - else: - raise TestFailed, "didn't catch MRO conflict" - -def mutable_names(): - if verbose: - print "Testing mutable names..." - class C(object): - pass - - # C.__module__ could be 'test_descr' or '__main__' - mod = C.__module__ - - C.__name__ = 'D' - vereq((C.__module__, C.__name__), (mod, 'D')) - - C.__name__ = 'D.E' - vereq((C.__module__, C.__name__), (mod, 'D.E')) - -def subclass_right_op(): - if verbose: - print "Testing correct dispatch of subclass overloading __r__..." - - # This code tests various cases where right-dispatch of a subclass - # should be preferred over left-dispatch of a base class. - - # Case 1: subclass of int; this tests code in abstract.c::binary_op1() - - class B(int): - def __floordiv__(self, other): - return "B.__floordiv__" - def __rfloordiv__(self, other): - return "B.__rfloordiv__" - - vereq(B(1) // 1, "B.__floordiv__") - vereq(1 // B(1), "B.__rfloordiv__") - - # Case 2: subclass of object; this is just the baseline for case 3 - - class C(object): - def __floordiv__(self, other): - return "C.__floordiv__" - def __rfloordiv__(self, other): - return "C.__rfloordiv__" - - vereq(C() // 1, "C.__floordiv__") - vereq(1 // C(), "C.__rfloordiv__") - - # Case 3: subclass of new-style class; here it gets interesting - - class D(C): - def __floordiv__(self, other): - return "D.__floordiv__" - def __rfloordiv__(self, other): - return "D.__rfloordiv__" - - vereq(D() // C(), "D.__floordiv__") - vereq(C() // D(), "D.__rfloordiv__") - - # Case 4: this didn't work right in 2.2.2 and 2.3a1 - - class E(C): - pass - - vereq(E.__rfloordiv__, C.__rfloordiv__) - - vereq(E() // 1, "C.__floordiv__") - vereq(1 // E(), "C.__rfloordiv__") - vereq(E() // C(), "C.__floordiv__") - vereq(C() // E(), "C.__floordiv__") # This one would fail - -def dict_type_with_metaclass(): - if verbose: - print "Testing type of __dict__ when __metaclass__ set..." - - class B(object): - pass - class M(type): - pass - class C: - # In 2.3a1, C.__dict__ was a real dict rather than a dict proxy - __metaclass__ = M - veris(type(C.__dict__), type(B.__dict__)) - -def meth_class_get(): - # Full coverage of descrobject.c::classmethod_get() - if verbose: - print "Testing __get__ method of METH_CLASS C methods..." - # Baseline - arg = [1, 2, 3] - res = {1: None, 2: None, 3: None} - vereq(dict.fromkeys(arg), res) - vereq({}.fromkeys(arg), res) - # Now get the descriptor - descr = dict.__dict__["fromkeys"] - # More baseline using the descriptor directly - vereq(descr.__get__(None, dict)(arg), res) - vereq(descr.__get__({})(arg), res) - # Now check various error cases - try: - descr.__get__(None, None) - except TypeError: - pass - else: - raise TestFailed, "shouldn't have allowed descr.__get__(None, None)" - try: - descr.__get__(42) - except TypeError: - pass - else: - raise TestFailed, "shouldn't have allowed descr.__get__(42)" - try: - descr.__get__(None, 42) - except TypeError: - pass - else: - raise TestFailed, "shouldn't have allowed descr.__get__(None, 42)" - try: - descr.__get__(None, int) - except TypeError: - pass - else: - raise TestFailed, "shouldn't have allowed descr.__get__(None, int)" - -def isinst_isclass(): - if verbose: - print "Testing proxy isinstance() and isclass()..." - class Proxy(object): - def __init__(self, obj): - self.__obj = obj - def __getattribute__(self, name): - if name.startswith("_Proxy__"): - return object.__getattribute__(self, name) - else: - return getattr(self.__obj, name) - # Test with a classic class - class C: - pass - a = C() - pa = Proxy(a) - verify(isinstance(a, C)) # Baseline - verify(isinstance(pa, C)) # Test - # Test with a classic subclass - class D(C): - pass - a = D() - pa = Proxy(a) - verify(isinstance(a, C)) # Baseline - verify(isinstance(pa, C)) # Test - # Test with a new-style class - class C(object): - pass - a = C() - pa = Proxy(a) - verify(isinstance(a, C)) # Baseline - verify(isinstance(pa, C)) # Test - # Test with a new-style subclass - class D(C): - pass - a = D() - pa = Proxy(a) - verify(isinstance(a, C)) # Baseline - verify(isinstance(pa, C)) # Test - -def proxysuper(): - if verbose: - print "Testing super() for a proxy object..." - class Proxy(object): - def __init__(self, obj): - self.__obj = obj - def __getattribute__(self, name): - if name.startswith("_Proxy__"): - return object.__getattribute__(self, name) - else: - return getattr(self.__obj, name) + self.assertEqual(c.attr, 1) + # this makes a crash more likely: + import gc; gc.collect() + self.assertEqual(hasattr(c, 'attr'), False) + + def test_init(self): + # SF 1155938 + class Foo(object): + def __init__(self): + return 10 + try: + Foo() + except TypeError: + pass + else: + self.fail("did not test __init__() for None return") + + def test_method_wrapper(self): + # Testing method-wrapper objects... + # did not support any reflection before 2.5 + + l = [] + self.assertEqual(l.__add__, l.__add__) + self.assertEqual(l.__add__, [].__add__) + self.assert_(l.__add__ != [5].__add__) + self.assert_(l.__add__ != l.__mul__) + self.assert_(l.__add__.__name__ == '__add__') + self.assert_(l.__add__.__self__ is l) + self.assert_(l.__add__.__objclass__ is list) + self.assertEqual(l.__add__.__doc__, list.__add__.__doc__) + try: + hash(l.__add__) + except TypeError: + pass + else: + self.fail("no TypeError from hash([].__add__)") + + t = () + t += (7,) + self.assertEqual(t.__add__, (7,).__add__) + self.assertEqual(hash(t.__add__), hash((7,).__add__)) + + def test_not_implemented(self): + # Testing NotImplemented... + # all binary methods should be able to return a NotImplemented + import sys + import types + import operator + + def specialmethod(self, other): + return NotImplemented - class B(object): - def f(self): - return "B.f" - - class C(B): - def f(self): - return super(C, self).f() + "->C.f" - - obj = C() - p = Proxy(obj) - vereq(C.__dict__["f"](p), "B.f->C.f") - -def carloverre(): - if verbose: - print "Testing prohibition of Carlo Verre's hack..." - try: - object.__setattr__(str, "foo", 42) - except TypeError: - pass - else: - raise TestFailed, "Carlo Verre __setattr__ suceeded!" - try: - object.__delattr__(str, "lower") - except TypeError: - pass - else: - raise TestFailed, "Carlo Verre __delattr__ succeeded!" - -def weakref_segfault(): - # SF 742911 - if verbose: - print "Testing weakref segfault..." - - import weakref - - class Provoker: - def __init__(self, referrent): - self.ref = weakref.ref(referrent) - - def __del__(self): - x = self.ref() - - class Oops(object): - pass - - o = Oops() - o.whatever = Provoker(o) - del o - -def wrapper_segfault(): - # SF 927248: deeply nested wrappers could cause stack overflow - f = lambda:None - for i in xrange(1000000): - f = f.__call__ - f = None - -# Fix SF #762455, segfault when sys.stdout is changed in getattr -def filefault(): - if verbose: - print "Testing sys.stdout is changed in getattr..." - import sys - class StdoutGuard: - def __getattr__(self, attr): - sys.stdout = sys.__stdout__ - raise RuntimeError("Premature access to sys.stdout.%s" % attr) - sys.stdout = StdoutGuard() - try: - print "Oops!" - except RuntimeError: - pass - -def vicious_descriptor_nonsense(): - # A potential segfault spotted by Thomas Wouters in mail to - # python-dev 2003-04-17, turned into an example & fixed by Michael - # Hudson just less than four months later... - if verbose: - print "Testing vicious_descriptor_nonsense..." - - class Evil(object): - def __hash__(self): - return hash('attr') - def __eq__(self, other): - del C.attr - return 0 - - class Descr(object): - def __get__(self, ob, type=None): - return 1 - - class C(object): - attr = Descr() - - c = C() - c.__dict__[Evil()] = 0 - - vereq(c.attr, 1) - # this makes a crash more likely: - import gc; gc.collect() - vereq(hasattr(c, 'attr'), False) - -def test_init(): - # SF 1155938 - class Foo(object): - def __init__(self): - return 10 - try: - Foo() - except TypeError: - pass - else: - raise TestFailed, "did not test __init__() for None return" - -def methodwrapper(): - # did not support any reflection before 2.5 - if verbose: - print "Testing method-wrapper objects..." - - l = [] - vereq(l.__add__, l.__add__) - vereq(l.__add__, [].__add__) - verify(l.__add__ != [5].__add__) - verify(l.__add__ != l.__mul__) - verify(l.__add__.__name__ == '__add__') - verify(l.__add__.__self__ is l) - verify(l.__add__.__objclass__ is list) - vereq(l.__add__.__doc__, list.__add__.__doc__) - try: - hash(l.__add__) - except TypeError: - pass - else: - raise TestFailed("no TypeError from hash([].__add__)") - - t = () - t += (7,) - vereq(t.__add__, (7,).__add__) - vereq(hash(t.__add__), hash((7,).__add__)) - -def notimplemented(): - # all binary methods should be able to return a NotImplemented - if verbose: - print "Testing NotImplemented..." - - import sys - import types - import operator - - def specialmethod(self, other): - return NotImplemented - - def check(expr, x, y): - try: - exec expr in {'x': x, 'y': y, 'operator': operator} - except TypeError: - pass - else: - raise TestFailed("no TypeError from %r" % (expr,)) - - N1 = sys.maxint + 1L # might trigger OverflowErrors instead of TypeErrors - N2 = sys.maxint # if sizeof(int) < sizeof(long), might trigger - # ValueErrors instead of TypeErrors - for metaclass in [type, types.ClassType]: - for name, expr, iexpr in [ - ('__add__', 'x + y', 'x += y'), - ('__sub__', 'x - y', 'x -= y'), - ('__mul__', 'x * y', 'x *= y'), - ('__truediv__', 'operator.truediv(x, y)', None), - ('__floordiv__', 'operator.floordiv(x, y)', None), - ('__div__', 'x / y', 'x /= y'), - ('__mod__', 'x % y', 'x %= y'), - ('__divmod__', 'divmod(x, y)', None), - ('__pow__', 'x ** y', 'x **= y'), - ('__lshift__', 'x << y', 'x <<= y'), - ('__rshift__', 'x >> y', 'x >>= y'), - ('__and__', 'x & y', 'x &= y'), - ('__or__', 'x | y', 'x |= y'), - ('__xor__', 'x ^ y', 'x ^= y'), - ('__coerce__', 'coerce(x, y)', None)]: - if name == '__coerce__': - rname = name + def check(expr, x, y): + try: + exec expr in {'x': x, 'y': y, 'operator': operator} + except TypeError: + pass else: - rname = '__r' + name[2:] - A = metaclass('A', (), {name: specialmethod}) - B = metaclass('B', (), {rname: specialmethod}) - a = A() - b = B() - check(expr, a, a) - check(expr, a, b) - check(expr, b, a) - check(expr, b, b) - check(expr, a, N1) - check(expr, a, N2) - check(expr, N1, b) - check(expr, N2, b) - if iexpr: - check(iexpr, a, a) - check(iexpr, a, b) - check(iexpr, b, a) - check(iexpr, b, b) - check(iexpr, a, N1) - check(iexpr, a, N2) - iname = '__i' + name[2:] - C = metaclass('C', (), {iname: specialmethod}) - c = C() - check(iexpr, c, a) - check(iexpr, c, b) - check(iexpr, c, N1) - check(iexpr, c, N2) - -def test_assign_slice(): - # ceval.c's assign_slice used to check for - # tp->tp_as_sequence->sq_slice instead of - # tp->tp_as_sequence->sq_ass_slice - if verbose: - print "Testing assign_slice..." - - class C(object): - def __setslice__(self, start, stop, value): - self.value = value - - c = C() - c[1:2] = 3 - vereq(c.value, 3) - -def test_weakref_in_del_segfault(): - # This used to segfault until r60057 - if verbose: - print "Testing weakref in del segfault..." - - import weakref - global ref - - class Target(): - def __del__(self): - global ref - ref = weakref.ref(self) - - w = Target() - del w - del ref - -def test_borrowed_ref_3_segfault(): - # This used to segfault until r60224 - if verbose: - print "Testing borrowed ref 3 segfault..." - - class KeyFunc(object): - def __call__(self, n): - del d['key'] - return 1 - - d = {'key': KeyFunc()} - try: - min(range(10), **d) - except: - pass - -def test_borrowed_ref_4_segfault(): - # This used to segfault until r60224 - if verbose: - print "Testing borrowed ref 4 segfault..." + self.fail("no TypeError from %r" % (expr,)) - import types - import __builtin__ + N1 = sys.maxint + 1L # might trigger OverflowErrors instead of + # TypeErrors + N2 = sys.maxint # if sizeof(int) < sizeof(long), might trigger + # ValueErrors instead of TypeErrors + for metaclass in [type, types.ClassType]: + for name, expr, iexpr in [ + ('__add__', 'x + y', 'x += y'), + ('__sub__', 'x - y', 'x -= y'), + ('__mul__', 'x * y', 'x *= y'), + ('__truediv__', 'operator.truediv(x, y)', None), + ('__floordiv__', 'operator.floordiv(x, y)', None), + ('__div__', 'x / y', 'x /= y'), + ('__mod__', 'x % y', 'x %= y'), + ('__divmod__', 'divmod(x, y)', None), + ('__pow__', 'x ** y', 'x **= y'), + ('__lshift__', 'x << y', 'x <<= y'), + ('__rshift__', 'x >> y', 'x >>= y'), + ('__and__', 'x & y', 'x &= y'), + ('__or__', 'x | y', 'x |= y'), + ('__xor__', 'x ^ y', 'x ^= y'), + ('__coerce__', 'coerce(x, y)', None)]: + if name == '__coerce__': + rname = name + else: + rname = '__r' + name[2:] + A = metaclass('A', (), {name: specialmethod}) + B = metaclass('B', (), {rname: specialmethod}) + a = A() + b = B() + check(expr, a, a) + check(expr, a, b) + check(expr, b, a) + check(expr, b, b) + check(expr, a, N1) + check(expr, a, N2) + check(expr, N1, b) + check(expr, N2, b) + if iexpr: + check(iexpr, a, a) + check(iexpr, a, b) + check(iexpr, b, a) + check(iexpr, b, b) + check(iexpr, a, N1) + check(iexpr, a, N2) + iname = '__i' + name[2:] + C = metaclass('C', (), {iname: specialmethod}) + c = C() + check(iexpr, c, a) + check(iexpr, c, b) + check(iexpr, c, N1) + check(iexpr, c, N2) + + def test_assign_slice(self): + # ceval.c's assign_slice used to check for + # tp->tp_as_sequence->sq_slice instead of + # tp->tp_as_sequence->sq_ass_slice - class X(object): - def __getattr__(self, name): - # this is called with name == '__bases__' by PyObject_IsInstance() - # during the unbound method call -- it frees the unbound method - # itself before it invokes its im_func. - del __builtin__.__import__ - return () - - pseudoclass = X() - - class Y(object): - def __call__(self, *args): - # 'self' was freed already - return (self, args) - - # make an unbound method - orig_import = __import__ - try: - __builtin__.__import__ = types.MethodType(Y(), None, (pseudoclass, str)) - import spam - finally: - __builtin__.__import__ = orig_import - -def test_losing_dict_ref_segfault(): - # This used to segfault; - # derived from issue #1303614, test67.py - if verbose: - print "Testing losing dict ref segfault..." - - class Strange(object): - def __hash__(self): - return hash('hello') - - def __eq__(self, other): - x.__dict__ = {} # the old x.__dict__ is deallocated - return False - - class X(object): - pass - - v = 123 - x = X() - x.__dict__ = {Strange(): 42, 'hello': v+456} - x.hello + class C(object): + def __setslice__(self, start, stop, value): + self.value = value + + c = C() + c[1:2] = 3 + self.assertEqual(c.value, 3) -def test_main(): - weakref_segfault() # Must be first, somehow - wrapper_segfault() - do_this_first() - class_docstrings() - lists() - dicts() - dict_constructor() - test_dir() - ints() - longs() - floats() - complexes() - spamlists() - spamdicts() - pydicts() - pylists() - metaclass() - pymods() - multi() - mro_disagreement() - diamond() - ex5() - monotonicity() - consistency_with_epg() - objects() - slots() - slotspecials() - dynamics() - errors() - classmethods() - classmethods_in_c() - staticmethods() - staticmethods_in_c() - classic() - compattr() - newslot() - altmro() - overloading() - methods() - specials() - recursions() - weakrefs() - properties() - properties_plus() - supers() - inherits() - keywords() - restricted() - str_subclass_as_dict_key() - classic_comparisons() - rich_comparisons() - coercions() - descrdoc() - setclass() - setdict() - pickles() - copies() - binopoverride() - subclasspropagation() - buffer_inherit() - str_of_str_subclass() - kwdargs() - recursive__call__() - delhook() - hashinherit() - strops() - deepcopyrecursive() - modules() - dictproxyiterkeys() - dictproxyitervalues() - dictproxyiteritems() - pickleslots() - funnynew() - imulbug() - docdescriptor() - copy_setstate() - slices() - subtype_resurrection() - slottrash() - slotmultipleinheritance() - testrmul() - testipow() - test_mutable_bases() - test_mutable_bases_with_failing_mro() - test_mutable_bases_catch_mro_conflict() - mutable_names() - subclass_right_op() - dict_type_with_metaclass() - meth_class_get() - isinst_isclass() - proxysuper() - carloverre() - filefault() - vicious_descriptor_nonsense() - test_init() - methodwrapper() - notimplemented() - test_assign_slice() - test_weakref_in_del_segfault() - test_borrowed_ref_3_segfault() - test_borrowed_ref_4_segfault() - test_losing_dict_ref_segfault() +class DictProxyTests(unittest.TestCase): + def setUp(self): + class C(object): + def meth(self): + pass + self.C = C + + def test_iter_keys(self): + # Testing dict-proxy iterkeys... + keys = [ key for key in self.C.__dict__.iterkeys() ] + keys.sort() + self.assertEquals(keys, ['__dict__', '__doc__', '__module__', + '__weakref__', 'meth']) + + def test_iter_values(self): + # Testing dict-proxy itervalues... + values = [ values for values in self.C.__dict__.itervalues() ] + self.assertEqual(len(values), 5) + + def test_iter_items(self): + # Testing dict-proxy iteritems... + keys = [ key for (key, value) in self.C.__dict__.iteritems() ] + keys.sort() + self.assertEqual(keys, ['__dict__', '__doc__', '__module__', + '__weakref__', 'meth']) + + def test_dict_type_with_metaclass(self): + # Testing type of __dict__ when __metaclass__ set... + class B(object): + pass + class M(type): + pass + class C: + # In 2.3a1, C.__dict__ was a real dict rather than a dict proxy + __metaclass__ = M + self.assertEqual(type(C.__dict__), type(B.__dict__)) + + +class PTypesLongInitTest(unittest.TestCase): + # This is in its own TestCase so that it can be run before any other tests. + def test_pytype_long_ready(self): + # Testing SF bug 551412 ... + + # This dumps core when SF bug 551412 isn't fixed -- + # but only when test_descr.py is run separately. + # (That can't be helped -- as soon as PyType_Ready() + # is called for PyLong_Type, the bug is gone.) + class UserLong(object): + def __pow__(self, *args): + pass + try: + pow(0L, UserLong(), 0L) + except: + pass + + # Another segfault only when run early + # (before PyType_Ready(tuple) is called) + type.mro(tuple) - if verbose: print "All OK" + +def test_main(): + # Run all local test cases, with PTypesLongInitTest first. + test_support.run_unittest(PTypesLongInitTest, OperatorsTest, + ClassPropertiesAndMethods, DictProxyTests) if __name__ == "__main__": test_main() From python-checkins at python.org Sat Feb 2 11:18:16 2008 From: python-checkins at python.org (georg.brandl) Date: Sat, 2 Feb 2008 11:18:16 +0100 (CET) Subject: [Python-checkins] r60522 - python/trunk/Lib/test/test_funcattrs.py Message-ID: <20080202101816.C59EA1E400B@bag.python.org> Author: georg.brandl Date: Sat Feb 2 11:18:15 2008 New Revision: 60522 Modified: python/trunk/Lib/test/test_funcattrs.py Log: Rewrite test_funcattrs as unittest, written for GHOP by Jeff Wheeler. Modified: python/trunk/Lib/test/test_funcattrs.py ============================================================================== --- python/trunk/Lib/test/test_funcattrs.py (original) +++ python/trunk/Lib/test/test_funcattrs.py Sat Feb 2 11:18:15 2008 @@ -1,414 +1,281 @@ -from test.test_support import verbose, TestFailed, verify +from test import test_support import types +import unittest -class F: - def a(self): - pass - -def b(): - 'my docstring' - pass - -# __module__ is a special attribute -verify(b.__module__ == __name__) -verify(verify.__module__ == "test.test_support") - -# setting attributes on functions -try: - b.publish -except AttributeError: pass -else: raise TestFailed, 'expected AttributeError' - -if b.__dict__ <> {}: - raise TestFailed, 'expected unassigned func.__dict__ to be {}' - -b.publish = 1 -if b.publish <> 1: - raise TestFailed, 'function attribute not set to expected value' - -docstring = 'its docstring' -b.__doc__ = docstring -if b.__doc__ <> docstring: - raise TestFailed, 'problem with setting __doc__ attribute' - -if 'publish' not in dir(b): - raise TestFailed, 'attribute not in dir()' - -try: - del b.__dict__ -except TypeError: pass -else: raise TestFailed, 'del func.__dict__ expected TypeError' - -b.publish = 1 -try: - b.__dict__ = None -except TypeError: pass -else: raise TestFailed, 'func.__dict__ = None expected TypeError' - -d = {'hello': 'world'} -b.__dict__ = d -if b.func_dict is not d: - raise TestFailed, 'func.__dict__ assignment to dictionary failed' -if b.hello <> 'world': - raise TestFailed, 'attribute after func.__dict__ assignment failed' - -f1 = F() -f2 = F() - -try: - F.a.publish -except AttributeError: pass -else: raise TestFailed, 'expected AttributeError' - -try: - f1.a.publish -except AttributeError: pass -else: raise TestFailed, 'expected AttributeError' - -# In Python 2.1 beta 1, we disallowed setting attributes on unbound methods -# (it was already disallowed on bound methods). See the PEP for details. -try: - F.a.publish = 1 -except (AttributeError, TypeError): pass -else: raise TestFailed, 'expected AttributeError or TypeError' - -# But setting it explicitly on the underlying function object is okay. -F.a.im_func.publish = 1 - -if F.a.publish <> 1: - raise TestFailed, 'unbound method attribute not set to expected value' - -if f1.a.publish <> 1: - raise TestFailed, 'bound method attribute access did not work' - -if f2.a.publish <> 1: - raise TestFailed, 'bound method attribute access did not work' - -if 'publish' not in dir(F.a): - raise TestFailed, 'attribute not in dir()' - -try: - f1.a.publish = 0 -except (AttributeError, TypeError): pass -else: raise TestFailed, 'expected AttributeError or TypeError' - -# See the comment above about the change in semantics for Python 2.1b1 -try: - F.a.myclass = F -except (AttributeError, TypeError): pass -else: raise TestFailed, 'expected AttributeError or TypeError' - -F.a.im_func.myclass = F - -f1.a.myclass -f2.a.myclass -f1.a.myclass -F.a.myclass - -if f1.a.myclass is not f2.a.myclass or \ - f1.a.myclass is not F.a.myclass: - raise TestFailed, 'attributes were not the same' - -# try setting __dict__ -try: - F.a.__dict__ = (1, 2, 3) -except (AttributeError, TypeError): pass -else: raise TestFailed, 'expected TypeError or AttributeError' - -F.a.im_func.__dict__ = {'one': 11, 'two': 22, 'three': 33} - -if f1.a.two <> 22: - raise TestFailed, 'setting __dict__' - -from UserDict import UserDict -d = UserDict({'four': 44, 'five': 55}) - -try: - F.a.__dict__ = d -except (AttributeError, TypeError): pass -else: raise TestFailed +def cannot_set_attr(obj, name, value, exceptions): + # This method is not called as a test (name doesn't start with 'test'), + # but may be used by other tests. + try: setattr(obj, name, value) + except exceptions: pass + else: self.fail("shouldn't be able to set %s to %r" % (name, value)) + try: delattr(obj, name) + except exceptions: pass + else: self.fail("shouldn't be able to del %s" % name) + +class FuncAttrsTest(unittest.TestCase): + def setUp(self): + class F: + def a(self): + pass + def b(): + return 3 + self.f = F + self.fi = F() + self.b = b + +class FunctionPropertiesTest(FuncAttrsTest): + # Include the external setUp method that is common to all tests + def test_module(self): + self.assertEqual(self.b.__module__, __name__) + + def test_dir_includes_correct_attrs(self): + self.b.known_attr = 7 + self.assert_('known_attr' in dir(self.b), + "set attributes not in dir listing of method") + # Test on underlying function object of method + self.f.a.im_func.known_attr = 7 + self.assert_('known_attr' in dir(self.f.a), + "set attribute on unbound method implementation in class not in " + "dir") + self.assert_('known_attr' in dir(self.fi.a), + "set attribute on unbound method implementations, should show up" + " in next dir") + + def test_duplicate_function_equality(self): + # Body of `duplicate' is the exact same as self.b + def duplicate(): + 'my docstring' + return 3 + self.assertNotEqual(self.b, duplicate) + + def test_copying_func_code(self): + def test(): pass + self.assertEqual(test(), None) + test.func_code = self.b.func_code + self.assertEqual(test(), 3) # self.b always returns 3, arbitrarily + + def test_func_globals(self): + self.assertEqual(self.b.func_globals, globals()) + cannot_set_attr(self.b, 'func_globals', 2, TypeError) + + def test_func_name(self): + self.assertEqual(self.b.__name__, 'b') + self.assertEqual(self.b.func_name, 'b') + self.b.__name__ = 'c' + self.assertEqual(self.b.__name__, 'c') + self.assertEqual(self.b.func_name, 'c') + self.b.func_name = 'd' + self.assertEqual(self.b.__name__, 'd') + self.assertEqual(self.b.func_name, 'd') + # __name__ and func_name must be a string + cannot_set_attr(self.b, '__name__', 7, TypeError) + cannot_set_attr(self.b, 'func_name', 7, TypeError) + # __name__ must be available when in restricted mode. Exec will raise + # AttributeError if __name__ is not available on f. + s = """def f(): pass\nf.__name__""" + exec s in {'__builtins__': {}} + # Test on methods, too + self.assertEqual(self.f.a.__name__, 'a') + self.assertEqual(self.fi.a.__name__, 'a') + cannot_set_attr(self.f.a, "__name__", 'a', AttributeError) + cannot_set_attr(self.fi.a, "__name__", 'a', AttributeError) + + def test_func_code(self): + num_one, num_two = 7, 8 + def a(): pass + def b(): return 12 + def c(): return num_one + def d(): return num_two + def e(): return num_one, num_two + for func in [a, b, c, d, e]: + self.assertEqual(type(func.func_code), types.CodeType) + self.assertEqual(c(), 7) + self.assertEqual(d(), 8) + d.func_code = c.func_code + self.assertEqual(c.func_code, d.func_code) + self.assertEqual(c(), 7) + # self.assertEqual(d(), 7) + try: b.func_code = c.func_code + except ValueError: pass + else: self.fail( + "func_code with different numbers of free vars should not be " + "possible") + try: e.func_code = d.func_code + except ValueError: pass + else: self.fail( + "func_code with different numbers of free vars should not be " + "possible") + + def test_blank_func_defaults(self): + self.assertEqual(self.b.func_defaults, None) + del self.b.func_defaults + self.assertEqual(self.b.func_defaults, None) + + def test_func_default_args(self): + def first_func(a, b): + return a+b + def second_func(a=1, b=2): + return a+b + self.assertEqual(first_func.func_defaults, None) + self.assertEqual(second_func.func_defaults, (1, 2)) + first_func.func_defaults = (1, 2) + self.assertEqual(first_func.func_defaults, (1, 2)) + self.assertEqual(first_func(), 3) + self.assertEqual(first_func(3), 5) + self.assertEqual(first_func(3, 5), 8) + del second_func.func_defaults + self.assertEqual(second_func.func_defaults, None) + try: second_func() + except TypeError: pass + else: self.fail( + "func_defaults does not update; deleting it does not remove " + "requirement") + +class ImplicitReferencesTest(FuncAttrsTest): + def test_im_class(self): + self.assertEqual(self.f.a.im_class, self.f) + self.assertEqual(self.fi.a.im_class, self.f) + cannot_set_attr(self.f.a, "im_class", self.f, TypeError) + cannot_set_attr(self.fi.a, "im_class", self.f, TypeError) + + def test_im_func(self): + self.f.b = self.b + self.assertEqual(self.f.b.im_func, self.b) + self.assertEqual(self.fi.b.im_func, self.b) + cannot_set_attr(self.f.b, "im_func", self.b, TypeError) + cannot_set_attr(self.fi.b, "im_func", self.b, TypeError) + + def test_im_self(self): + self.assertEqual(self.f.a.im_self, None) + self.assertEqual(self.fi.a.im_self, self.fi) + cannot_set_attr(self.f.a, "im_self", None, TypeError) + cannot_set_attr(self.fi.a, "im_self", self.fi, TypeError) + + def test_im_func_non_method(self): + # Behavior should be the same when a method is added via an attr + # assignment + self.f.id = types.MethodType(id, None, self.f) + self.assertEqual(self.fi.id(), id(self.fi)) + self.assertNotEqual(self.fi.id(), id(self.f)) + # Test usage + try: self.f.id.unknown_attr + except AttributeError: pass + else: self.fail("using unknown attributes should raise AttributeError") + # Test assignment and deletion + cannot_set_attr(self.f.id, 'unknown_attr', 2, AttributeError) + cannot_set_attr(self.fi.id, 'unknown_attr', 2, AttributeError) + + def test_implicit_method_properties(self): + self.f.a.im_func.known_attr = 7 + self.assertEqual(self.f.a.known_attr, 7) + self.assertEqual(self.fi.a.known_attr, 7) + +class ArbitraryFunctionAttrTest(FuncAttrsTest): + def test_set_attr(self): + self.b.known_attr = 7 + self.assertEqual(self.b.known_attr, 7) + for func in [self.f.a, self.fi.a]: + try: func.known_attr = 7 + except AttributeError: pass + else: self.fail("setting attributes on methods should raise error") + + def test_delete_unknown_attr(self): + try: del self.b.unknown_attr + except AttributeError: pass + else: self.fail("deleting unknown attribute should raise TypeError") + + def test_setting_attrs_duplicates(self): + try: self.f.a.klass = self.f + except AttributeError: pass + else: self.fail("setting arbitrary attribute in unbound function " + " should raise AttributeError") + self.f.a.im_func.klass = self.f + for method in [self.f.a, self.fi.a, self.fi.a.im_func]: + self.assertEqual(method.klass, self.f) + + def test_unset_attr(self): + for func in [self.b, self.f.a, self.fi.a]: + try: func.non_existant_attr + except AttributeError: pass + else: self.fail("using unknown attributes should raise " + "AttributeError") + +class FunctionDictsTest(FuncAttrsTest): + def test_setting_dict_to_invalid(self): + cannot_set_attr(self.b, '__dict__', None, TypeError) + cannot_set_attr(self.b, 'func_dict', None, TypeError) + from UserDict import UserDict + d = UserDict({'known_attr': 7}) + cannot_set_attr(self.f.a.im_func, '__dict__', d, TypeError) + cannot_set_attr(self.fi.a.im_func, '__dict__', d, TypeError) + + def test_setting_dict_to_valid(self): + d = {'known_attr': 7} + self.b.__dict__ = d + # Setting dict is only possible on the underlying function objects + self.f.a.im_func.__dict__ = d + # Test assignment + self.assertEqual(d, self.b.__dict__) + self.assertEqual(d, self.b.func_dict) + # ... and on all the different ways of referencing the method's func + self.assertEqual(d, self.f.a.im_func.__dict__) + self.assertEqual(d, self.f.a.__dict__) + self.assertEqual(d, self.fi.a.im_func.__dict__) + self.assertEqual(d, self.fi.a.__dict__) + # Test value + self.assertEqual(self.b.known_attr, 7) + self.assertEqual(self.b.__dict__['known_attr'], 7) + self.assertEqual(self.b.func_dict['known_attr'], 7) + # ... and again, on all the different method's names + self.assertEqual(self.f.a.im_func.known_attr, 7) + self.assertEqual(self.f.a.known_attr, 7) + self.assertEqual(self.fi.a.im_func.known_attr, 7) + self.assertEqual(self.fi.a.known_attr, 7) + + def test_delete_func_dict(self): + try: del self.b.__dict__ + except TypeError: pass + else: self.fail("deleting function dictionary should raise TypeError") + try: del self.b.func_dict + except TypeError: pass + else: self.fail("deleting function dictionary should raise TypeError") + + def test_unassigned_dict(self): + self.assertEqual(self.b.__dict__, {}) + + def test_func_as_dict_key(self): + value = "Some string" + d = {} + d[self.b] = value + self.assertEqual(d[self.b], value) + +class FunctionDocstringTest(FuncAttrsTest): + def test_set_docstring_attr(self): + self.assertEqual(self.b.__doc__, None) + self.assertEqual(self.b.func_doc, None) + docstr = "A test method that does nothing" + self.b.__doc__ = self.f.a.im_func.__doc__ = docstr + self.assertEqual(self.b.__doc__, docstr) + self.assertEqual(self.b.func_doc, docstr) + self.assertEqual(self.f.a.__doc__, docstr) + self.assertEqual(self.fi.a.__doc__, docstr) + cannot_set_attr(self.f.a, "__doc__", docstr, AttributeError) + cannot_set_attr(self.fi.a, "__doc__", docstr, AttributeError) + + def test_delete_docstring(self): + self.b.__doc__ = "The docstring" + del self.b.__doc__ + self.assertEqual(self.b.__doc__, None) + self.assertEqual(self.b.func_doc, None) + self.b.func_doc = "The docstring" + del self.b.func_doc + self.assertEqual(self.b.__doc__, None) + self.assertEqual(self.b.func_doc, None) + +def test_main(): + test_support.run_unittest(FunctionPropertiesTest, ImplicitReferencesTest, + ArbitraryFunctionAttrTest, FunctionDictsTest, + FunctionDocstringTest) -if f2.a.one <> f1.a.one <> F.a.one <> 11: - raise TestFailed - -# im_func may not be a Python method! -import types -F.id = types.MethodType(id, None, F) - -eff = F() -if eff.id() <> id(eff): - raise TestFailed - -try: - F.id.foo -except AttributeError: pass -else: raise TestFailed - -try: - F.id.foo = 12 -except (AttributeError, TypeError): pass -else: raise TestFailed - -try: - F.id.foo -except AttributeError: pass -else: raise TestFailed - -try: - eff.id.foo -except AttributeError: pass -else: raise TestFailed - -try: - eff.id.foo = 12 -except (AttributeError, TypeError): pass -else: raise TestFailed - -try: - eff.id.foo -except AttributeError: pass -else: raise TestFailed - -# Regression test for a crash in pre-2.1a1 -def another(): - pass - -try: - del another.__dict__ -except TypeError: pass -else: raise TestFailed - -try: - del another.func_dict -except TypeError: pass -else: raise TestFailed - -try: - another.func_dict = None -except TypeError: pass -else: raise TestFailed - -try: - del another.bar -except AttributeError: pass -else: raise TestFailed - -# This isn't specifically related to function attributes, but it does test a -# core dump regression in funcobject.c -del another.func_defaults - -def foo(): - pass - -def bar(): - pass - -def temp(): - print 1 - -if foo==bar: - raise TestFailed - -d={} -d[foo] = 1 - -foo.func_code = temp.func_code - -d[foo] - -# Test all predefined function attributes systematically - -def cantset(obj, name, value, exception=(AttributeError, TypeError)): - verify(hasattr(obj, name)) # Otherwise it's probably a typo - try: - setattr(obj, name, value) - except exception: - pass - else: - raise TestFailed, "shouldn't be able to set %s to %r" % (name, value) - try: - delattr(obj, name) - except (AttributeError, TypeError): - pass - else: - raise TestFailed, "shouldn't be able to del %s" % name - -def test_func_closure(): - a = 12 - def f(): print a - c = f.func_closure - verify(isinstance(c, tuple)) - verify(len(c) == 1) - verify(c[0].__class__.__name__ == "cell") # don't have a type object handy - cantset(f, "func_closure", c) - -def test_empty_cell(): - def f(): print a - try: - f.func_closure[0].cell_contents - except ValueError: - pass - else: - raise TestFailed, "shouldn't be able to read an empty cell" - - a = 12 - -def test_func_doc(): - def f(): pass - verify(f.__doc__ is None) - verify(f.func_doc is None) - f.__doc__ = "hello" - verify(f.__doc__ == "hello") - verify(f.func_doc == "hello") - del f.__doc__ - verify(f.__doc__ is None) - verify(f.func_doc is None) - f.func_doc = "world" - verify(f.__doc__ == "world") - verify(f.func_doc == "world") - del f.func_doc - verify(f.func_doc is None) - verify(f.__doc__ is None) - -def test_func_globals(): - def f(): pass - verify(f.func_globals is globals()) - cantset(f, "func_globals", globals()) - -def test_func_name(): - def f(): pass - verify(f.__name__ == "f") - verify(f.func_name == "f") - f.__name__ = "g" - verify(f.__name__ == "g") - verify(f.func_name == "g") - f.func_name = "h" - verify(f.__name__ == "h") - verify(f.func_name == "h") - cantset(f, "func_globals", 1) - cantset(f, "__name__", 1) - # test that you can access func.__name__ in restricted mode - s = """def f(): pass\nf.__name__""" - exec s in {'__builtins__':{}} - - -def test_func_code(): - a = b = 24 - def f(): pass - def g(): print 12 - def f1(): print a - def g1(): print b - def f2(): print a, b - verify(type(f.func_code) is types.CodeType) - f.func_code = g.func_code - cantset(f, "func_code", None) - # can't change the number of free vars - cantset(f, "func_code", f1.func_code, exception=ValueError) - cantset(f1, "func_code", f.func_code, exception=ValueError) - cantset(f1, "func_code", f2.func_code, exception=ValueError) - f1.func_code = g1.func_code - -def test_func_defaults(): - def f(a, b): return (a, b) - verify(f.func_defaults is None) - f.func_defaults = (1, 2) - verify(f.func_defaults == (1, 2)) - verify(f(10) == (10, 2)) - def g(a=1, b=2): return (a, b) - verify(g.func_defaults == (1, 2)) - del g.func_defaults - verify(g.func_defaults is None) - try: - g() - except TypeError: - pass - else: - raise TestFailed, "shouldn't be allowed to call g() w/o defaults" - -def test_func_dict(): - def f(): pass - a = f.__dict__ - b = f.func_dict - verify(a == {}) - verify(a is b) - f.hello = 'world' - verify(a == {'hello': 'world'}) - verify(f.func_dict is a is f.__dict__) - f.func_dict = {} - verify(not hasattr(f, "hello")) - f.__dict__ = {'world': 'hello'} - verify(f.world == "hello") - verify(f.__dict__ is f.func_dict == {'world': 'hello'}) - cantset(f, "func_dict", None) - cantset(f, "__dict__", None) - -def test_im_class(): - class C: - def foo(self): pass - verify(C.foo.im_class is C) - verify(C().foo.im_class is C) - cantset(C.foo, "im_class", C) - cantset(C().foo, "im_class", C) - -def test_im_func(): - def foo(self): pass - class C: - pass - C.foo = foo - verify(C.foo.im_func is foo) - verify(C().foo.im_func is foo) - cantset(C.foo, "im_func", foo) - cantset(C().foo, "im_func", foo) - -def test_im_self(): - class C: - def foo(self): pass - verify(C.foo.im_self is None) - c = C() - verify(c.foo.im_self is c) - cantset(C.foo, "im_self", None) - cantset(c.foo, "im_self", c) - -def test_im_dict(): - class C: - def foo(self): pass - foo.bar = 42 - verify(C.foo.__dict__ == {'bar': 42}) - verify(C().foo.__dict__ == {'bar': 42}) - cantset(C.foo, "__dict__", C.foo.__dict__) - cantset(C().foo, "__dict__", C.foo.__dict__) - -def test_im_doc(): - class C: - def foo(self): "hello" - verify(C.foo.__doc__ == "hello") - verify(C().foo.__doc__ == "hello") - cantset(C.foo, "__doc__", "hello") - cantset(C().foo, "__doc__", "hello") - -def test_im_name(): - class C: - def foo(self): pass - verify(C.foo.__name__ == "foo") - verify(C().foo.__name__ == "foo") - cantset(C.foo, "__name__", "foo") - cantset(C().foo, "__name__", "foo") - -def testmore(): - test_func_closure() - test_empty_cell() - test_func_doc() - test_func_globals() - test_func_name() - test_func_code() - test_func_defaults() - test_func_dict() - # Tests for instance method attributes - test_im_class() - test_im_func() - test_im_self() - test_im_dict() - test_im_doc() - test_im_name() - -testmore() +if __name__ == "__main__": + test_main() From python-checkins at python.org Sat Feb 2 11:49:58 2008 From: python-checkins at python.org (georg.brandl) Date: Sat, 2 Feb 2008 11:49:58 +0100 (CET) Subject: [Python-checkins] r60525 - in python/trunk/Doc: includes/email-alternative.py library/email-examples.rst Message-ID: <20080202104958.D37901E400B@bag.python.org> Author: georg.brandl Date: Sat Feb 2 11:49:58 2008 New Revision: 60525 Added: python/trunk/Doc/includes/email-alternative.py Modified: python/trunk/Doc/library/email-examples.rst Log: Add email example how to send a multipart message. Written for GHOP by Martin Matejek. Added: python/trunk/Doc/includes/email-alternative.py ============================================================================== --- (empty file) +++ python/trunk/Doc/includes/email-alternative.py Sat Feb 2 11:49:58 2008 @@ -0,0 +1,48 @@ +#! /usr/bin/python + +import smtplib + +from email.mime.multipart import MIMEMultipart +from email.mime.text import MIMEText + +# me == my email address +# you == recipient's email address +me = "my at email.com" +you = "your at email.com" + +# Create message container - the correct MIME type is multipart/alternative. +msg = MIMEMultipart('alternative') +msg['Subject'] = "Link" +msg['From'] = me +msg['To'] = you + +# Create the body of the message (a plain-text and an HTML version). +text = "Hi!\nHow are you?\nHere is the link you wanted:\nhttp://www.python.org" +html = """\ + + + +

    Hi!
    + How are you?
    + Here is the link you wanted. +

    + + +""" + +# Record the MIME types of both parts - text/plain and text/html. +part1 = MIMEText(text, 'plain') +part2 = MIMEText(html, 'html') + +# Attach parts into message container. +# According to RFC 2046, the last part of a multipart message, in this case +# the HTML message, is best and preferred. +msg.attach(part1) +msg.attach(part2) + +# Send the message via local SMTP server. +s = smtplib.SMTP('localhost') +# sendmail function takes 3 arguments: sender's address, recipient's address +# and message to send - here it is sent as one string. +s.sendmail(me, you, msg.as_string()) +s.close() Modified: python/trunk/Doc/library/email-examples.rst ============================================================================== --- python/trunk/Doc/library/email-examples.rst (original) +++ python/trunk/Doc/library/email-examples.rst Sat Feb 2 11:49:58 2008 @@ -16,18 +16,23 @@ Here's an example of how to send the entire contents of a directory as an email -message: [1]_ +message: [1]_ .. literalinclude:: ../includes/email-dir.py -And finally, here's an example of how to unpack a MIME message like the one +Here's an example of how to unpack a MIME message like the one above, into a directory of files: .. literalinclude:: ../includes/email-unpack.py +Here's an example of how to create an HTML message with an alternative plain +text version: [2]_ + +.. literalinclude:: ../includes/email-alternative.py + .. rubric:: Footnotes .. [1] Thanks to Matthew Dixon Cowles for the original inspiration and examples. - +.. [2] Contributed by Martin Matejek. From python-checkins at python.org Sat Feb 2 12:05:00 2008 From: python-checkins at python.org (georg.brandl) Date: Sat, 2 Feb 2008 12:05:00 +0100 (CET) Subject: [Python-checkins] r60526 - python/trunk/Lib/test/test_socketserver.py Message-ID: <20080202110500.CE3301E4002@bag.python.org> Author: georg.brandl Date: Sat Feb 2 12:05:00 2008 New Revision: 60526 Modified: python/trunk/Lib/test/test_socketserver.py Log: Rewrite test_socketserver as unittest, written for GHOP by Benjamin Petersen. Modified: python/trunk/Lib/test/test_socketserver.py ============================================================================== --- python/trunk/Lib/test/test_socketserver.py (original) +++ python/trunk/Lib/test/test_socketserver.py Sat Feb 2 12:05:00 2008 @@ -1,20 +1,32 @@ -# Test suite for SocketServer.py +""" +Test suite for SocketServer.py. +""" -from test import test_support -from test.test_support import (verbose, verify, TESTFN, TestSkipped, - reap_children) -test_support.requires('network') - -from SocketServer import * +import os import socket import errno +import imp import select import time import threading -import os +from functools import wraps +import unittest +import SocketServer + +import test.test_support +from test.test_support import reap_children, verbose, TestSkipped +from test.test_support import TESTFN as TEST_FILE + +test.test_support.requires("network") NREQ = 3 DELAY = 0.5 +TEST_STR = "hello world\n" +HOST = "localhost" + +HAVE_UNIX_SOCKETS = hasattr(socket, "AF_UNIX") +HAVE_FORKING = hasattr(os, "fork") and os.name != "os2" + class MyMixinHandler: def handle(self): @@ -23,50 +35,41 @@ time.sleep(DELAY) self.wfile.write(line) -class MyStreamHandler(MyMixinHandler, StreamRequestHandler): + +def receive(sock, n, timeout=20): + r, w, x = select.select([sock], [], [], timeout) + if sock in r: + return sock.recv(n) + else: + raise RuntimeError, "timed out on %r" % (sock,) + + +class MyStreamHandler(MyMixinHandler, SocketServer.StreamRequestHandler): pass -class MyDatagramHandler(MyMixinHandler, DatagramRequestHandler): +class MyDatagramHandler(MyMixinHandler, + SocketServer.DatagramRequestHandler): pass +class ForkingUnixStreamServer(SocketServer.ForkingMixIn, + SocketServer.UnixStreamServer): + pass + +class ForkingUnixDatagramServer(SocketServer.ForkingMixIn, + SocketServer.UnixDatagramServer): + pass + + class MyMixinServer: def serve_a_few(self): for i in range(NREQ): self.handle_request() + def handle_error(self, request, client_address): self.close_request(request) self.server_close() raise -teststring = "hello world\n" - -def receive(sock, n, timeout=20): - r, w, x = select.select([sock], [], [], timeout) - if sock in r: - return sock.recv(n) - else: - raise RuntimeError, "timed out on %r" % (sock,) - -def testdgram(proto, addr): - s = socket.socket(proto, socket.SOCK_DGRAM) - s.sendto(teststring, addr) - buf = data = receive(s, 100) - while data and '\n' not in buf: - data = receive(s, 100) - buf += data - verify(buf == teststring) - s.close() - -def teststream(proto, addr): - s = socket.socket(proto, socket.SOCK_STREAM) - s.connect(addr) - s.sendall(teststring) - buf = data = receive(s, 100) - while data and '\n' not in buf: - data = receive(s, 100) - buf += data - verify(buf == teststring) - s.close() class ServerThread(threading.Thread): def __init__(self, addr, svrcls, hdlrcls): @@ -75,6 +78,7 @@ self.__svrcls = svrcls self.__hdlrcls = hdlrcls self.ready = threading.Event() + def run(self): class svrcls(MyMixinServer, self.__svrcls): pass @@ -93,64 +97,8 @@ svr.serve_a_few() if verbose: print "thread: done" -seed = 0 -def pickport(): - global seed - seed += 1 - return 10000 + (os.getpid() % 1000)*10 + seed - -host = "localhost" -testfiles = [] -def pickaddr(proto): - if proto == socket.AF_INET: - return (host, pickport()) - else: - fn = TESTFN + str(pickport()) - if os.name == 'os2': - # AF_UNIX socket names on OS/2 require a specific prefix - # which can't include a drive letter and must also use - # backslashes as directory separators - if fn[1] == ':': - fn = fn[2:] - if fn[0] in (os.sep, os.altsep): - fn = fn[1:] - fn = os.path.join('\socket', fn) - if os.sep == '/': - fn = fn.replace(os.sep, os.altsep) - else: - fn = fn.replace(os.altsep, os.sep) - testfiles.append(fn) - return fn - -def cleanup(): - for fn in testfiles: - try: - os.remove(fn) - except os.error: - pass - testfiles[:] = [] -def testloop(proto, servers, hdlrcls, testfunc): - for svrcls in servers: - addr = pickaddr(proto) - if verbose: - print "ADDR =", addr - print "CLASS =", svrcls - t = ServerThread(addr, svrcls, hdlrcls) - if verbose: print "server created" - t.start() - if verbose: print "server running" - for i in range(NREQ): - t.ready.wait(10*DELAY) - if not t.ready.isSet(): - raise RuntimeError("Server not ready within a reasonable time") - if verbose: print "test client", i - testfunc(proto, addr) - if verbose: print "waiting for server" - t.join() - if verbose: print "done" - -class ForgivingTCPServer(TCPServer): +class ForgivingTCPServer(SocketServer.TCPServer): # prevent errors if another process is using the port we want def server_bind(self): host, default_port = self.server_address @@ -160,64 +108,147 @@ for port in [default_port, 3434, 8798, 23833]: try: self.server_address = host, port - TCPServer.server_bind(self) + SocketServer.TCPServer.server_bind(self) break except socket.error, (err, msg): if err != errno.EADDRINUSE: raise - print >>sys.__stderr__, \ - ' WARNING: failed to listen on port %d, trying another' % port + print >> sys.__stderr__, \ + "WARNING: failed to listen on port %d, trying another: " % port + + +class SocketServerTest(unittest.TestCase): + """Test all socket servers.""" + + def setUp(self): + self.port_seed = 0 + self.test_files = [] + + def tearDown(self): + reap_children() + + for fn in self.test_files: + try: + os.remove(fn) + except os.error: + pass + self.test_files[:] = [] + + def pickport(self): + self.port_seed += 1 + return 10000 + (os.getpid() % 1000)*10 + self.port_seed + + def pickaddr(self, proto): + if proto == socket.AF_INET: + return (HOST, self.pickport()) + else: + fn = TEST_FILE + str(self.pickport()) + if os.name == 'os2': + # AF_UNIX socket names on OS/2 require a specific prefix + # which can't include a drive letter and must also use + # backslashes as directory separators + if fn[1] == ':': + fn = fn[2:] + if fn[0] in (os.sep, os.altsep): + fn = fn[1:] + fn = os.path.join('\socket', fn) + if os.sep == '/': + fn = fn.replace(os.sep, os.altsep) + else: + fn = fn.replace(os.altsep, os.sep) + self.test_files.append(fn) + return fn + + def run_servers(self, proto, servers, hdlrcls, testfunc): + for svrcls in servers: + addr = self.pickaddr(proto) + if verbose: + print "ADDR =", addr + print "CLASS =", svrcls + t = ServerThread(addr, svrcls, hdlrcls) + if verbose: print "server created" + t.start() + if verbose: print "server running" + for i in range(NREQ): + t.ready.wait(10*DELAY) + self.assert_(t.ready.isSet(), + "Server not ready within a reasonable time") + if verbose: print "test client", i + testfunc(proto, addr) + if verbose: print "waiting for server" + t.join() + if verbose: print "done" + + def stream_examine(self, proto, addr): + s = socket.socket(proto, socket.SOCK_STREAM) + s.connect(addr) + s.sendall(TEST_STR) + buf = data = receive(s, 100) + while data and '\n' not in buf: + data = receive(s, 100) + buf += data + self.assertEquals(buf, TEST_STR) + s.close() + + def dgram_examine(self, proto, addr): + s = socket.socket(proto, socket.SOCK_DGRAM) + s.sendto(TEST_STR, addr) + buf = data = receive(s, 100) + while data and '\n' not in buf: + data = receive(s, 100) + buf += data + self.assertEquals(buf, TEST_STR) + s.close() + + def test_TCPServers(self): + # Test SocketServer.TCPServer + servers = [ForgivingTCPServer, SocketServer.ThreadingTCPServer] + if HAVE_FORKING: + servers.append(SocketServer.ForkingTCPServer) + self.run_servers(socket.AF_INET, servers, + MyStreamHandler, self.stream_examine) + + def test_UDPServers(self): + # Test SocketServer.UPDServer + servers = [SocketServer.UDPServer, + SocketServer.ThreadingUDPServer] + if HAVE_FORKING: + servers.append(SocketServer.ForkingUDPServer) + self.run_servers(socket.AF_INET, servers, MyDatagramHandler, + self.dgram_examine) + + def test_stream_servers(self): + # Test SocketServer's stream servers + if not HAVE_UNIX_SOCKETS: + return + servers = [SocketServer.UnixStreamServer, + SocketServer.ThreadingUnixStreamServer] + if HAVE_FORKING: + servers.append(ForkingUnixStreamServer) + self.run_servers(socket.AF_UNIX, servers, MyStreamHandler, + self.stream_examine) + + # Alas, on Linux (at least) recvfrom() doesn't return a meaningful + # client address so this cannot work: + + # def test_dgram_servers(self): + # # Test SocketServer.UnixDatagramServer + # if not HAVE_UNIX_SOCKETS: + # return + # servers = [SocketServer.UnixDatagramServer, + # SocketServer.ThreadingUnixDatagramServer] + # if HAVE_FORKING: + # servers.append(ForkingUnixDatagramServer) + # self.run_servers(socket.AF_UNIX, servers, MyDatagramHandler, + # self.dgram_examine) -tcpservers = [ForgivingTCPServer, ThreadingTCPServer] -if hasattr(os, 'fork') and os.name not in ('os2',): - tcpservers.append(ForkingTCPServer) -udpservers = [UDPServer, ThreadingUDPServer] -if hasattr(os, 'fork') and os.name not in ('os2',): - udpservers.append(ForkingUDPServer) - -if not hasattr(socket, 'AF_UNIX'): - streamservers = [] - dgramservers = [] -else: - class ForkingUnixStreamServer(ForkingMixIn, UnixStreamServer): pass - streamservers = [UnixStreamServer, ThreadingUnixStreamServer] - if hasattr(os, 'fork') and os.name not in ('os2',): - streamservers.append(ForkingUnixStreamServer) - class ForkingUnixDatagramServer(ForkingMixIn, UnixDatagramServer): pass - dgramservers = [UnixDatagramServer, ThreadingUnixDatagramServer] - if hasattr(os, 'fork') and os.name not in ('os2',): - dgramservers.append(ForkingUnixDatagramServer) - -def sloppy_cleanup(): - # See http://python.org/sf/1540386 - # We need to reap children here otherwise a child from one server - # can be left running for the next server and cause a test failure. - time.sleep(DELAY) - reap_children() - -def testall(): - testloop(socket.AF_INET, tcpservers, MyStreamHandler, teststream) - sloppy_cleanup() - testloop(socket.AF_INET, udpservers, MyDatagramHandler, testdgram) - if hasattr(socket, 'AF_UNIX'): - sloppy_cleanup() - testloop(socket.AF_UNIX, streamservers, MyStreamHandler, teststream) - # Alas, on Linux (at least) recvfrom() doesn't return a meaningful - # client address so this cannot work: - ##testloop(socket.AF_UNIX, dgramservers, MyDatagramHandler, testdgram) def test_main(): - import imp if imp.lock_held(): - # If the import lock is held, the threads will hang. + # If the import lock is held, the threads will hang raise TestSkipped("can't run when import lock is held") - reap_children() - try: - testall() - finally: - cleanup() - reap_children() + test.test_support.run_unittest(SocketServerTest) if __name__ == "__main__": test_main() From python-checkins at python.org Sat Feb 2 12:05:35 2008 From: python-checkins at python.org (georg.brandl) Date: Sat, 2 Feb 2008 12:05:35 +0100 (CET) Subject: [Python-checkins] r60527 - python/trunk/Misc/ACKS Message-ID: <20080202110535.3F35B1E4002@bag.python.org> Author: georg.brandl Date: Sat Feb 2 12:05:34 2008 New Revision: 60527 Modified: python/trunk/Misc/ACKS Log: Add GHOP contributor. Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Sat Feb 2 12:05:34 2008 @@ -509,6 +509,7 @@ Mark Perrego Trevor Perrin Tim Peters +Benjamin Peterson Chris Petrilli Bjorn Pettersen Geoff Philbrick From buildbot at python.org Sat Feb 2 12:32:40 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 Feb 2008 11:32:40 +0000 Subject: [Python-checkins] buildbot failure in x86 mvlgcc trunk Message-ID: <20080202113240.E2F7F1E4002@bag.python.org> The Buildbot has detected a new failure of x86 mvlgcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20mvlgcc%20trunk/builds/1386 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-linux Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/threading.py", line 486, in __bootstrap_inner self.run() File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/test/test_socketserver.py", line 97, in run svr.serve_a_few() File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/test/test_socketserver.py", line 66, in serve_a_few self.handle_request() File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/SocketServer.py", line 229, in handle_request self.handle_error(request, client_address) File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/SocketServer.py", line 466, in process_request self.collect_children() File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/SocketServer.py", line 455, in collect_children self.active_children.remove(pid) ValueError: list.remove(x): x not in list 1 test failed: test_socketserver Traceback (most recent call last): File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/threading.py", line 486, in __bootstrap_inner self.run() File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/test/test_socketserver.py", line 97, in run svr.serve_a_few() File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/test/test_socketserver.py", line 66, in serve_a_few self.handle_request() File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/SocketServer.py", line 229, in handle_request self.handle_error(request, client_address) File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/SocketServer.py", line 466, in process_request self.collect_children() File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/SocketServer.py", line 455, in collect_children self.active_children.remove(pid) ValueError: list.remove(x): x not in list ====================================================================== ERROR: test_UDPServers (test.test_socketserver.SocketServerTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/test/test_socketserver.py", line 218, in test_UDPServers self.dgram_examine) File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/test/test_socketserver.py", line 177, in run_servers testfunc(proto, addr) File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/test/test_socketserver.py", line 196, in dgram_examine buf = data = receive(s, 100) File "/home2/buildbot/slave/trunk.loewis-linux/build/Lib/test/test_socketserver.py", line 44, in receive raise RuntimeError, "timed out on %r" % (sock,) RuntimeError: timed out on make: *** [buildbottest] Fehler 1 sincerely, -The Buildbot From python-checkins at python.org Sat Feb 2 12:39:30 2008 From: python-checkins at python.org (georg.brandl) Date: Sat, 2 Feb 2008 12:39:30 +0100 (CET) Subject: [Python-checkins] r60528 - in python/trunk: Lib/test/test_queue.py Misc/ACKS Message-ID: <20080202113930.78FA61E4019@bag.python.org> Author: georg.brandl Date: Sat Feb 2 12:39:29 2008 New Revision: 60528 Modified: python/trunk/Lib/test/test_queue.py python/trunk/Misc/ACKS Log: Rewrite test_queue as unittest. Written for GHOP by Ian Seyer. Modified: python/trunk/Lib/test/test_queue.py ============================================================================== --- python/trunk/Lib/test/test_queue.py (original) +++ python/trunk/Lib/test/test_queue.py Sat Feb 2 12:39:29 2008 @@ -4,8 +4,8 @@ import sys import threading import time - -from test.test_support import verify, TestFailed, verbose +import unittest +from test import test_support QUEUE_SIZE = 5 @@ -30,50 +30,179 @@ self.startedEvent.set() self.fn(*self.args) + # Execute a function that blocks, and in a separate thread, a function that -# triggers the release. Returns the result of the blocking function. -# Caution: block_func must guarantee to block until trigger_func is -# called, and trigger_func must guarantee to change queue state so that -# block_func can make enough progress to return. In particular, a -# block_func that just raises an exception regardless of whether trigger_func -# is called will lead to timing-dependent sporadic failures, and one of -# those went rarely seen but undiagnosed for years. Now block_func -# must be unexceptional. If block_func is supposed to raise an exception, -# call _doExceptionalBlockingTest() instead. -def _doBlockingTest(block_func, block_args, trigger_func, trigger_args): - t = _TriggerThread(trigger_func, trigger_args) - t.start() - result = block_func(*block_args) - # If block_func returned before our thread made the call, we failed! - if not t.startedEvent.isSet(): - raise TestFailed("blocking function '%r' appeared not to block" % - block_func) - t.join(10) # make sure the thread terminates - if t.isAlive(): - raise TestFailed("trigger function '%r' appeared to not return" % - trigger_func) - return result - -# Call this instead if block_func is supposed to raise an exception. -def _doExceptionalBlockingTest(block_func, block_args, trigger_func, - trigger_args, expected_exception_class): - t = _TriggerThread(trigger_func, trigger_args) - t.start() - try: - try: - block_func(*block_args) - except expected_exception_class: - raise +# triggers the release. Returns the result of the blocking function. Caution: +# block_func must guarantee to block until trigger_func is called, and +# trigger_func must guarantee to change queue state so that block_func can make +# enough progress to return. In particular, a block_func that just raises an +# exception regardless of whether trigger_func is called will lead to +# timing-dependent sporadic failures, and one of those went rarely seen but +# undiagnosed for years. Now block_func must be unexceptional. If block_func +# is supposed to raise an exception, call do_exceptional_blocking_test() +# instead. + +class BlockingTestMixin: + + def do_blocking_test(self, block_func, block_args, trigger_func, trigger_args): + self.t = _TriggerThread(trigger_func, trigger_args) + self.t.start() + self.result = block_func(*block_args) + # If block_func returned before our thread made the call, we failed! + if not self.t.startedEvent.isSet(): + self.fail("blocking function '%r' appeared not to block" % + block_func) + self.t.join(10) # make sure the thread terminates + if self.t.isAlive(): + self.fail("trigger function '%r' appeared to not return" % + trigger_func) + return self.result + + # Call this instead if block_func is supposed to raise an exception. + def do_exceptional_blocking_test(self,block_func, block_args, trigger_func, + trigger_args, expected_exception_class): + self.t = _TriggerThread(trigger_func, trigger_args) + self.t.start() + try: + try: + block_func(*block_args) + except expected_exception_class: + raise + else: + self.fail("expected exception of kind %r" % + expected_exception_class) + finally: + self.t.join(10) # make sure the thread terminates + if self.t.isAlive(): + self.fail("trigger function '%r' appeared to not return" % + trigger_func) + if not self.t.startedEvent.isSet(): + self.fail("trigger thread ended but event never set") + + +class BaseQueueTest(unittest.TestCase, BlockingTestMixin): + def setUp(self): + self.cum = 0 + self.cumlock = threading.Lock() + + def simple_queue_test(self, q): + if not q.empty(): + raise RuntimeError, "Call this function with an empty queue" + # I guess we better check things actually queue correctly a little :) + q.put(111) + q.put(333) + q.put(222) + target_order = dict(Queue = [111, 333, 222], + LifoQueue = [222, 333, 111], + PriorityQueue = [111, 222, 333]) + actual_order = [q.get(), q.get(), q.get()] + self.assertEquals(actual_order, target_order[q.__class__.__name__], + "Didn't seem to queue the correct data!") + for i in range(QUEUE_SIZE-1): + q.put(i) + self.assert_(not q.empty(), "Queue should not be empty") + self.assert_(not q.full(), "Queue should not be full") + q.put("last") + self.assert_(q.full(), "Queue should be full") + try: + q.put("full", block=0) + self.fail("Didn't appear to block with a full queue") + except Queue.Full: + pass + try: + q.put("full", timeout=0.01) + self.fail("Didn't appear to time-out with a full queue") + except Queue.Full: + pass + # Test a blocking put + self.do_blocking_test(q.put, ("full",), q.get, ()) + self.do_blocking_test(q.put, ("full", True, 10), q.get, ()) + # Empty it + for i in range(QUEUE_SIZE): + q.get() + self.assert_(q.empty(), "Queue should be empty") + try: + q.get(block=0) + self.fail("Didn't appear to block with an empty queue") + except Queue.Empty: + pass + try: + q.get(timeout=0.01) + self.fail("Didn't appear to time-out with an empty queue") + except Queue.Empty: + pass + # Test a blocking get + self.do_blocking_test(q.get, (), q.put, ('empty',)) + self.do_blocking_test(q.get, (True, 10), q.put, ('empty',)) + + + def worker(self, q): + while True: + self.x = q.get() + if self.x is None: + q.task_done() + return + self.cumlock.acquire() + try: + self.cum += self.x + finally: + self.cumlock.release() + q.task_done() + + def queue_join_test(self, q): + self.cum = 0 + for i in (0,1): + threading.Thread(target=self.worker, args=(q,)).start() + for i in xrange(100): + q.put(i) + q.join() + self.assertEquals(self.cum, sum(range(100)), + "q.join() did not block until all tasks were done") + for i in (0,1): + q.put(None) # instruct the threads to close + q.join() # verify that you can join twice + + def test_queue_task_done(self): + # Test to make sure a queue task completed successfully. + q = self.type2test() + try: + q.task_done() + except ValueError: + pass else: - raise TestFailed("expected exception of kind %r" % - expected_exception_class) - finally: - t.join(10) # make sure the thread terminates - if t.isAlive(): - raise TestFailed("trigger function '%r' appeared to not return" % - trigger_func) - if not t.startedEvent.isSet(): - raise TestFailed("trigger thread ended but event never set") + self.fail("Did not detect task count going negative") + + def test_queue_join(self): + # Test that a queue join()s successfully, and before anything else + # (done twice for insurance). + q = self.type2test() + self.queue_join_test(q) + self.queue_join_test(q) + try: + q.task_done() + except ValueError: + pass + else: + self.fail("Did not detect task count going negative") + + def test_simple_queue(self): + # Do it a couple of times on the same queue. + # Done twice to make sure works with same instance reused. + q = self.type2test(QUEUE_SIZE) + self.simple_queue_test(q) + self.simple_queue_test(q) + + +class QueueTest(BaseQueueTest): + type2test = Queue.Queue + +class LifoQueueTest(BaseQueueTest): + type2test = Queue.LifoQueue + +class PriorityQueueTest(BaseQueueTest): + type2test = Queue.PriorityQueue + + # A Queue subclass that can provoke failure at a moment's notice :) class FailingQueueException(Exception): @@ -95,194 +224,101 @@ raise FailingQueueException, "You Lose" return Queue.Queue._get(self) -def FailingQueueTest(q): - if not q.empty(): - raise RuntimeError, "Call this function with an empty queue" - for i in range(QUEUE_SIZE-1): - q.put(i) - # Test a failing non-blocking put. - q.fail_next_put = True - try: - q.put("oops", block=0) - raise TestFailed("The queue didn't fail when it should have") - except FailingQueueException: - pass - q.fail_next_put = True - try: - q.put("oops", timeout=0.1) - raise TestFailed("The queue didn't fail when it should have") - except FailingQueueException: - pass - q.put("last") - verify(q.full(), "Queue should be full") - # Test a failing blocking put - q.fail_next_put = True - try: - _doBlockingTest(q.put, ("full",), q.get, ()) - raise TestFailed("The queue didn't fail when it should have") - except FailingQueueException: - pass - # Check the Queue isn't damaged. - # put failed, but get succeeded - re-add - q.put("last") - # Test a failing timeout put - q.fail_next_put = True - try: - _doExceptionalBlockingTest(q.put, ("full", True, 10), q.get, (), - FailingQueueException) - raise TestFailed("The queue didn't fail when it should have") - except FailingQueueException: - pass - # Check the Queue isn't damaged. - # put failed, but get succeeded - re-add - q.put("last") - verify(q.full(), "Queue should be full") - q.get() - verify(not q.full(), "Queue should not be full") - q.put("last") - verify(q.full(), "Queue should be full") - # Test a blocking put - _doBlockingTest( q.put, ("full",), q.get, ()) - # Empty it - for i in range(QUEUE_SIZE): - q.get() - verify(q.empty(), "Queue should be empty") - q.put("first") - q.fail_next_get = True - try: +class FailingQueueTest(unittest.TestCase, BlockingTestMixin): + + def failing_queue_test(self, q): + if not q.empty(): + raise RuntimeError, "Call this function with an empty queue" + for i in range(QUEUE_SIZE-1): + q.put(i) + # Test a failing non-blocking put. + q.fail_next_put = True + try: + q.put("oops", block=0) + self.fail("The queue didn't fail when it should have") + except FailingQueueException: + pass + q.fail_next_put = True + try: + q.put("oops", timeout=0.1) + self.fail("The queue didn't fail when it should have") + except FailingQueueException: + pass + q.put("last") + self.assert_(q.full(), "Queue should be full") + # Test a failing blocking put + q.fail_next_put = True + try: + self.do_blocking_test(q.put, ("full",), q.get, ()) + self.fail("The queue didn't fail when it should have") + except FailingQueueException: + pass + # Check the Queue isn't damaged. + # put failed, but get succeeded - re-add + q.put("last") + # Test a failing timeout put + q.fail_next_put = True + try: + self.do_exceptional_blocking_test(q.put, ("full", True, 10), q.get, (), + FailingQueueException) + self.fail("The queue didn't fail when it should have") + except FailingQueueException: + pass + # Check the Queue isn't damaged. + # put failed, but get succeeded - re-add + q.put("last") + self.assert_(q.full(), "Queue should be full") q.get() - raise TestFailed("The queue didn't fail when it should have") - except FailingQueueException: - pass - verify(not q.empty(), "Queue should not be empty") - q.fail_next_get = True - try: - q.get(timeout=0.1) - raise TestFailed("The queue didn't fail when it should have") - except FailingQueueException: - pass - verify(not q.empty(), "Queue should not be empty") - q.get() - verify(q.empty(), "Queue should be empty") - q.fail_next_get = True - try: - _doExceptionalBlockingTest(q.get, (), q.put, ('empty',), - FailingQueueException) - raise TestFailed("The queue didn't fail when it should have") - except FailingQueueException: - pass - # put succeeded, but get failed. - verify(not q.empty(), "Queue should not be empty") - q.get() - verify(q.empty(), "Queue should be empty") - -def SimpleQueueTest(q): - if not q.empty(): - raise RuntimeError, "Call this function with an empty queue" - # I guess we better check things actually queue correctly a little :) - q.put(111) - q.put(333) - q.put(222) - target_order = dict(Queue = [111, 333, 222], - LifoQueue = [222, 333, 111], - PriorityQueue = [111, 222, 333]) - actual_order = [q.get(), q.get(), q.get()] - verify(actual_order == target_order[q.__class__.__name__], - "Didn't seem to queue the correct data!") - for i in range(QUEUE_SIZE-1): - q.put(i) - verify(not q.empty(), "Queue should not be empty") - verify(not q.full(), "Queue should not be full") - q.put("last") - verify(q.full(), "Queue should be full") - try: - q.put("full", block=0) - raise TestFailed("Didn't appear to block with a full queue") - except Queue.Full: - pass - try: - q.put("full", timeout=0.01) - raise TestFailed("Didn't appear to time-out with a full queue") - except Queue.Full: - pass - # Test a blocking put - _doBlockingTest(q.put, ("full",), q.get, ()) - _doBlockingTest(q.put, ("full", True, 10), q.get, ()) - # Empty it - for i in range(QUEUE_SIZE): + self.assert_(not q.full(), "Queue should not be full") + q.put("last") + self.assert_(q.full(), "Queue should be full") + # Test a blocking put + self.do_blocking_test(q.put, ("full",), q.get, ()) + # Empty it + for i in range(QUEUE_SIZE): + q.get() + self.assert_(q.empty(), "Queue should be empty") + q.put("first") + q.fail_next_get = True + try: + q.get() + self.fail("The queue didn't fail when it should have") + except FailingQueueException: + pass + self.assert_(not q.empty(), "Queue should not be empty") + q.fail_next_get = True + try: + q.get(timeout=0.1) + self.fail("The queue didn't fail when it should have") + except FailingQueueException: + pass + self.assert_(not q.empty(), "Queue should not be empty") q.get() - verify(q.empty(), "Queue should be empty") - try: - q.get(block=0) - raise TestFailed("Didn't appear to block with an empty queue") - except Queue.Empty: - pass - try: - q.get(timeout=0.01) - raise TestFailed("Didn't appear to time-out with an empty queue") - except Queue.Empty: - pass - # Test a blocking get - _doBlockingTest(q.get, (), q.put, ('empty',)) - _doBlockingTest(q.get, (True, 10), q.put, ('empty',)) - -cum = 0 -cumlock = threading.Lock() - -def worker(q): - global cum - while True: - x = q.get() - if x is None: - q.task_done() - return - cumlock.acquire() + self.assert_(q.empty(), "Queue should be empty") + q.fail_next_get = True try: - cum += x - finally: - cumlock.release() - q.task_done() + self.do_exceptional_blocking_test(q.get, (), q.put, ('empty',), + FailingQueueException) + self.fail("The queue didn't fail when it should have") + except FailingQueueException: + pass + # put succeeded, but get failed. + self.assert_(not q.empty(), "Queue should not be empty") + q.get() + self.assert_(q.empty(), "Queue should be empty") + + def test_failing_queue(self): + # Test to make sure a queue is functioning correctly. + # Done twice to the same instance. + q = FailingQueue(QUEUE_SIZE) + self.failing_queue_test(q) + self.failing_queue_test(q) + + +def test_main(): + test_support.run_unittest(QueueTest, LifoQueueTest, PriorityQueueTest, + FailingQueueTest) -def QueueJoinTest(q): - global cum - cum = 0 - for i in (0,1): - threading.Thread(target=worker, args=(q,)).start() - for i in xrange(100): - q.put(i) - q.join() - verify(cum==sum(range(100)), "q.join() did not block until all tasks were done") - for i in (0,1): - q.put(None) # instruct the threads to close - q.join() # verify that you can join twice - -def QueueTaskDoneTest(q): - try: - q.task_done() - except ValueError: - pass - else: - raise TestFailed("Did not detect task count going negative") - -def test(): - for Q in Queue.Queue, Queue.LifoQueue, Queue.PriorityQueue: - q = Q() - QueueTaskDoneTest(q) - QueueJoinTest(q) - QueueJoinTest(q) - QueueTaskDoneTest(q) - - q = Q(QUEUE_SIZE) - # Do it a couple of times on the same queue - SimpleQueueTest(q) - SimpleQueueTest(q) - if verbose: - print "Simple Queue tests seemed to work for", Q.__name__ - - q = FailingQueue(QUEUE_SIZE) - FailingQueueTest(q) - FailingQueueTest(q) - if verbose: - print "Failing Queue tests seemed to work" -test() +if __name__ == "__main__": + test_main() Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Sat Feb 2 12:39:29 2008 @@ -599,6 +599,7 @@ Jiwon Seo Jerry Seutter Denis Severson +Ian Seyer Ha Shao Bruce Sherwood Pete Shinners From python-checkins at python.org Sat Feb 2 12:46:08 2008 From: python-checkins at python.org (georg.brandl) Date: Sat, 2 Feb 2008 12:46:08 +0100 (CET) Subject: [Python-checkins] r60529 - in python/trunk/Lib/test: output/test_cProfile test_cProfile.py test_cprofile.py Message-ID: <20080202114608.23F901E4002@bag.python.org> Author: georg.brandl Date: Sat Feb 2 12:46:07 2008 New Revision: 60529 Added: python/trunk/Lib/test/test_cprofile.py - copied, changed from r60520, python/trunk/Lib/test/test_cProfile.py Removed: python/trunk/Lib/test/output/test_cProfile python/trunk/Lib/test/test_cProfile.py Log: Rewrite test_cprofile as unittest (and rename the file to be consistent with all other test files). Written for GHOP by Benjamin Peterson. Deleted: /python/trunk/Lib/test/output/test_cProfile ============================================================================== --- /python/trunk/Lib/test/output/test_cProfile Sat Feb 2 12:46:07 2008 +++ (empty file) @@ -1,79 +0,0 @@ -test_cProfile - 126 function calls (106 primitive calls) in 1.000 CPU seconds - - Ordered by: standard name - - ncalls tottime percall cumtime percall filename:lineno(function) - 1 0.000 0.000 1.000 1.000 :1() - 8 0.064 0.008 0.080 0.010 test_cProfile.py:103(subhelper) - 28 0.028 0.001 0.028 0.001 test_cProfile.py:115(__getattr__) - 1 0.270 0.270 1.000 1.000 test_cProfile.py:30(testfunc) - 23/3 0.150 0.007 0.170 0.057 test_cProfile.py:40(factorial) - 20 0.020 0.001 0.020 0.001 test_cProfile.py:53(mul) - 2 0.040 0.020 0.600 0.300 test_cProfile.py:60(helper) - 4 0.116 0.029 0.120 0.030 test_cProfile.py:78(helper1) - 2 0.000 0.000 0.140 0.070 test_cProfile.py:89(helper2_indirect) - 8 0.312 0.039 0.400 0.050 test_cProfile.py:93(helper2) - 12 0.000 0.000 0.012 0.001 {hasattr} - 4 0.000 0.000 0.000 0.000 {method 'append' of 'list' objects} - 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} - 8 0.000 0.000 0.000 0.000 {range} - 4 0.000 0.000 0.000 0.000 {sys.exc_info} - - - Ordered by: standard name - -Function called... - ncalls tottime cumtime -:1() -> 1 0.270 1.000 test_cProfile.py:30(testfunc) -test_cProfile.py:103(subhelper) -> 16 0.016 0.016 test_cProfile.py:115(__getattr__) - 8 0.000 0.000 {range} -test_cProfile.py:115(__getattr__) -> -test_cProfile.py:30(testfunc) -> 1 0.014 0.130 test_cProfile.py:40(factorial) - 2 0.040 0.600 test_cProfile.py:60(helper) -test_cProfile.py:40(factorial) -> 20/3 0.130 0.147 test_cProfile.py:40(factorial) - 20 0.020 0.020 test_cProfile.py:53(mul) -test_cProfile.py:53(mul) -> -test_cProfile.py:60(helper) -> 4 0.116 0.120 test_cProfile.py:78(helper1) - 2 0.000 0.140 test_cProfile.py:89(helper2_indirect) - 6 0.234 0.300 test_cProfile.py:93(helper2) -test_cProfile.py:78(helper1) -> 4 0.000 0.004 {hasattr} - 4 0.000 0.000 {method 'append' of 'list' objects} - 4 0.000 0.000 {sys.exc_info} -test_cProfile.py:89(helper2_indirect) -> 2 0.006 0.040 test_cProfile.py:40(factorial) - 2 0.078 0.100 test_cProfile.py:93(helper2) -test_cProfile.py:93(helper2) -> 8 0.064 0.080 test_cProfile.py:103(subhelper) - 8 0.000 0.008 {hasattr} -{hasattr} -> 12 0.012 0.012 test_cProfile.py:115(__getattr__) -{method 'append' of 'list' objects} -> -{method 'disable' of '_lsprof.Profiler' objects} -> -{range} -> -{sys.exc_info} -> - - - Ordered by: standard name - -Function was called by... - ncalls tottime cumtime -:1() <- -test_cProfile.py:103(subhelper) <- 8 0.064 0.080 test_cProfile.py:93(helper2) -test_cProfile.py:115(__getattr__) <- 16 0.016 0.016 test_cProfile.py:103(subhelper) - 12 0.012 0.012 {hasattr} -test_cProfile.py:30(testfunc) <- 1 0.270 1.000 :1() -test_cProfile.py:40(factorial) <- 1 0.014 0.130 test_cProfile.py:30(testfunc) - 20/3 0.130 0.147 test_cProfile.py:40(factorial) - 2 0.006 0.040 test_cProfile.py:89(helper2_indirect) -test_cProfile.py:53(mul) <- 20 0.020 0.020 test_cProfile.py:40(factorial) -test_cProfile.py:60(helper) <- 2 0.040 0.600 test_cProfile.py:30(testfunc) -test_cProfile.py:78(helper1) <- 4 0.116 0.120 test_cProfile.py:60(helper) -test_cProfile.py:89(helper2_indirect) <- 2 0.000 0.140 test_cProfile.py:60(helper) -test_cProfile.py:93(helper2) <- 6 0.234 0.300 test_cProfile.py:60(helper) - 2 0.078 0.100 test_cProfile.py:89(helper2_indirect) -{hasattr} <- 4 0.000 0.004 test_cProfile.py:78(helper1) - 8 0.000 0.008 test_cProfile.py:93(helper2) -{method 'append' of 'list' objects} <- 4 0.000 0.000 test_cProfile.py:78(helper1) -{method 'disable' of '_lsprof.Profiler' objects} <- -{range} <- 8 0.000 0.000 test_cProfile.py:103(subhelper) -{sys.exc_info} <- 4 0.000 0.000 test_cProfile.py:78(helper1) - - Deleted: /python/trunk/Lib/test/test_cProfile.py ============================================================================== --- /python/trunk/Lib/test/test_cProfile.py Sat Feb 2 12:46:07 2008 +++ (empty file) @@ -1,123 +0,0 @@ -"""Test suite for the cProfile module.""" - -import cProfile, pstats, sys - -# In order to have reproducible time, we simulate a timer in the global -# variable 'ticks', which represents simulated time in milliseconds. -# (We can't use a helper function increment the timer since it would be -# included in the profile and would appear to consume all the time.) -ticks = 0 - -# IMPORTANT: this is an output test. *ALL* NUMBERS in the expected -# output are relevant. If you change the formatting of pstats, -# please don't just regenerate output/test_cProfile without checking -# very carefully that not a single number has changed. - -def test_main(): - global ticks - ticks = 42000 - prof = cProfile.Profile(timer, 0.001) - prof.runctx("testfunc()", globals(), locals()) - assert ticks == 43000, ticks - st = pstats.Stats(prof) - st.strip_dirs().sort_stats('stdname').print_stats() - st.print_callees() - st.print_callers() - -def timer(): - return ticks - -def testfunc(): - # 1 call - # 1000 ticks total: 270 ticks local, 730 ticks in subfunctions - global ticks - ticks += 99 - helper() # 300 - helper() # 300 - ticks += 171 - factorial(14) # 130 - -def factorial(n): - # 23 calls total - # 170 ticks total, 150 ticks local - # 3 primitive calls, 130, 20 and 20 ticks total - # including 116, 17, 17 ticks local - global ticks - if n > 0: - ticks += n - return mul(n, factorial(n-1)) - else: - ticks += 11 - return 1 - -def mul(a, b): - # 20 calls - # 1 tick, local - global ticks - ticks += 1 - return a * b - -def helper(): - # 2 calls - # 300 ticks total: 20 ticks local, 260 ticks in subfunctions - global ticks - ticks += 1 - helper1() # 30 - ticks += 2 - helper1() # 30 - ticks += 6 - helper2() # 50 - ticks += 3 - helper2() # 50 - ticks += 2 - helper2() # 50 - ticks += 5 - helper2_indirect() # 70 - ticks += 1 - -def helper1(): - # 4 calls - # 30 ticks total: 29 ticks local, 1 tick in subfunctions - global ticks - ticks += 10 - hasattr(C(), "foo") # 1 - ticks += 19 - lst = [] - lst.append(42) # 0 - sys.exc_info() # 0 - -def helper2_indirect(): - helper2() # 50 - factorial(3) # 20 - -def helper2(): - # 8 calls - # 50 ticks local: 39 ticks local, 11 ticks in subfunctions - global ticks - ticks += 11 - hasattr(C(), "bar") # 1 - ticks += 13 - subhelper() # 10 - ticks += 15 - -def subhelper(): - # 8 calls - # 10 ticks total: 8 ticks local, 2 ticks in subfunctions - global ticks - ticks += 2 - for i in range(2): # 0 - try: - C().foo # 1 x 2 - except AttributeError: - ticks += 3 # 3 x 2 - -class C: - def __getattr__(self, name): - # 28 calls - # 1 tick, local - global ticks - ticks += 1 - raise AttributeError - -if __name__ == "__main__": - test_main() Copied: python/trunk/Lib/test/test_cprofile.py (from r60520, python/trunk/Lib/test/test_cProfile.py) ============================================================================== --- python/trunk/Lib/test/test_cProfile.py (original) +++ python/trunk/Lib/test/test_cprofile.py Sat Feb 2 12:46:07 2008 @@ -1,40 +1,27 @@ -"""Test suite for the cProfile module.""" +import sys +import cProfile +import pstats +import test.test_support + +################################# +# Warning! +# This stuff is touchy. If you modify anything above the test_main function, +# you'll have to regenerate the stats for the doctest! +################################ -import cProfile, pstats, sys - -# In order to have reproducible time, we simulate a timer in the global -# variable 'ticks', which represents simulated time in milliseconds. -# (We can't use a helper function increment the timer since it would be -# included in the profile and would appear to consume all the time.) -ticks = 0 - -# IMPORTANT: this is an output test. *ALL* NUMBERS in the expected -# output are relevant. If you change the formatting of pstats, -# please don't just regenerate output/test_cProfile without checking -# very carefully that not a single number has changed. - -def test_main(): - global ticks - ticks = 42000 - prof = cProfile.Profile(timer, 0.001) - prof.runctx("testfunc()", globals(), locals()) - assert ticks == 43000, ticks - st = pstats.Stats(prof) - st.strip_dirs().sort_stats('stdname').print_stats() - st.print_callees() - st.print_callers() +TICKS = 42000 def timer(): - return ticks + return TICKS def testfunc(): # 1 call # 1000 ticks total: 270 ticks local, 730 ticks in subfunctions - global ticks - ticks += 99 + global TICKS + TICKS += 99 helper() # 300 helper() # 300 - ticks += 171 + TICKS += 171 factorial(14) # 130 def factorial(n): @@ -42,46 +29,46 @@ # 170 ticks total, 150 ticks local # 3 primitive calls, 130, 20 and 20 ticks total # including 116, 17, 17 ticks local - global ticks + global TICKS if n > 0: - ticks += n + TICKS += n return mul(n, factorial(n-1)) else: - ticks += 11 + TICKS += 11 return 1 def mul(a, b): # 20 calls # 1 tick, local - global ticks - ticks += 1 + global TICKS + TICKS += 1 return a * b def helper(): # 2 calls # 300 ticks total: 20 ticks local, 260 ticks in subfunctions - global ticks - ticks += 1 + global TICKS + TICKS += 1 helper1() # 30 - ticks += 2 + TICKS += 2 helper1() # 30 - ticks += 6 + TICKS += 6 helper2() # 50 - ticks += 3 + TICKS += 3 helper2() # 50 - ticks += 2 + TICKS += 2 helper2() # 50 - ticks += 5 + TICKS += 5 helper2_indirect() # 70 - ticks += 1 + TICKS += 1 def helper1(): # 4 calls # 30 ticks total: 29 ticks local, 1 tick in subfunctions - global ticks - ticks += 10 + global TICKS + TICKS += 10 hasattr(C(), "foo") # 1 - ticks += 19 + TICKS += 19 lst = [] lst.append(42) # 0 sys.exc_info() # 0 @@ -93,31 +80,129 @@ def helper2(): # 8 calls # 50 ticks local: 39 ticks local, 11 ticks in subfunctions - global ticks - ticks += 11 + global TICKS + TICKS += 11 hasattr(C(), "bar") # 1 - ticks += 13 + TICKS += 13 subhelper() # 10 - ticks += 15 + TICKS += 15 def subhelper(): # 8 calls # 10 ticks total: 8 ticks local, 2 ticks in subfunctions - global ticks - ticks += 2 + global TICKS + TICKS += 2 for i in range(2): # 0 try: C().foo # 1 x 2 except AttributeError: - ticks += 3 # 3 x 2 + TICKS += 3 # 3 x 2 class C: def __getattr__(self, name): # 28 calls # 1 tick, local - global ticks - ticks += 1 + global TICKS + TICKS += 1 raise AttributeError +def test_main(): + """ + >>> prof = cProfile.Profile(timer, 0.001) + >>> prof.runctx("testfunc()", globals(), locals()) #doctest: +ELLIPSIS + + >>> timer() + 43000 + >>> stats = pstats.Stats(prof) + >>> stats.strip_dirs().sort_stats("stdname") #doctest: +ELLIPSIS + + >>> stats.print_stats() #doctest: +ELLIPSIS + 126 function calls (106 primitive calls) in 1.000 CPU seconds + + Ordered by: standard name + + ncalls tottime percall cumtime percall filename:lineno(function) + 1 0.000 0.000 1.000 1.000 :1() + 28 0.028 0.001 0.028 0.001 test_cprofile.py:102(__getattr__) + 1 0.270 0.270 1.000 1.000 test_cprofile.py:17(testfunc) + 23/3 0.150 0.007 0.170 0.057 test_cprofile.py:27(factorial) + 20 0.020 0.001 0.020 0.001 test_cprofile.py:40(mul) + 2 0.040 0.020 0.600 0.300 test_cprofile.py:47(helper) + 4 0.116 0.029 0.120 0.030 test_cprofile.py:65(helper1) + 2 0.000 0.000 0.140 0.070 test_cprofile.py:76(helper2_indirect) + 8 0.312 0.039 0.400 0.050 test_cprofile.py:80(helper2) + 8 0.064 0.008 0.080 0.010 test_cprofile.py:90(subhelper) + 12 0.000 0.000 0.012 0.001 {hasattr} + 4 0.000 0.000 0.000 0.000 {method 'append' of 'list' objects} + 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} + 8 0.000 0.000 0.000 0.000 {range} + 4 0.000 0.000 0.000 0.000 {sys.exc_info} + + + + >>> stats.print_callers() #doctest: +ELLIPSIS + Ordered by: standard name + + Function was called by... + ncalls tottime cumtime + :1() <- + test_cprofile.py:102(__getattr__) <- 16 0.016 0.016 test_cprofile.py:90(subhelper) + 12 0.012 0.012 {hasattr} + test_cprofile.py:17(testfunc) <- 1 0.270 1.000 :1() + test_cprofile.py:27(factorial) <- 1 0.014 0.130 test_cprofile.py:17(testfunc) + 20/3 0.130 0.147 test_cprofile.py:27(factorial) + 2 0.006 0.040 test_cprofile.py:76(helper2_indirect) + test_cprofile.py:40(mul) <- 20 0.020 0.020 test_cprofile.py:27(factorial) + test_cprofile.py:47(helper) <- 2 0.040 0.600 test_cprofile.py:17(testfunc) + test_cprofile.py:65(helper1) <- 4 0.116 0.120 test_cprofile.py:47(helper) + test_cprofile.py:76(helper2_indirect) <- 2 0.000 0.140 test_cprofile.py:47(helper) + test_cprofile.py:80(helper2) <- 6 0.234 0.300 test_cprofile.py:47(helper) + 2 0.078 0.100 test_cprofile.py:76(helper2_indirect) + test_cprofile.py:90(subhelper) <- 8 0.064 0.080 test_cprofile.py:80(helper2) + {hasattr} <- 4 0.000 0.004 test_cprofile.py:65(helper1) + 8 0.000 0.008 test_cprofile.py:80(helper2) + {method 'append' of 'list' objects} <- 4 0.000 0.000 test_cprofile.py:65(helper1) + {method 'disable' of '_lsprof.Profiler' objects} <- + {range} <- 8 0.000 0.000 test_cprofile.py:90(subhelper) + {sys.exc_info} <- 4 0.000 0.000 test_cprofile.py:65(helper1) + + + + >>> stats.print_callees() #doctest: +ELLIPSIS + Ordered by: standard name + + Function called... + ncalls tottime cumtime + :1() -> 1 0.270 1.000 test_cprofile.py:17(testfunc) + test_cprofile.py:102(__getattr__) -> + test_cprofile.py:17(testfunc) -> 1 0.014 0.130 test_cprofile.py:27(factorial) + 2 0.040 0.600 test_cprofile.py:47(helper) + test_cprofile.py:27(factorial) -> 20/3 0.130 0.147 test_cprofile.py:27(factorial) + 20 0.020 0.020 test_cprofile.py:40(mul) + test_cprofile.py:40(mul) -> + test_cprofile.py:47(helper) -> 4 0.116 0.120 test_cprofile.py:65(helper1) + 2 0.000 0.140 test_cprofile.py:76(helper2_indirect) + 6 0.234 0.300 test_cprofile.py:80(helper2) + test_cprofile.py:65(helper1) -> 4 0.000 0.004 {hasattr} + 4 0.000 0.000 {method 'append' of 'list' objects} + 4 0.000 0.000 {sys.exc_info} + test_cprofile.py:76(helper2_indirect) -> 2 0.006 0.040 test_cprofile.py:27(factorial) + 2 0.078 0.100 test_cprofile.py:80(helper2) + test_cprofile.py:80(helper2) -> 8 0.064 0.080 test_cprofile.py:90(subhelper) + 8 0.000 0.008 {hasattr} + test_cprofile.py:90(subhelper) -> 16 0.016 0.016 test_cprofile.py:102(__getattr__) + 8 0.000 0.000 {range} + {hasattr} -> 12 0.012 0.012 test_cprofile.py:102(__getattr__) + {method 'append' of 'list' objects} -> + {method 'disable' of '_lsprof.Profiler' objects} -> + {range} -> + {sys.exc_info} -> + + + + """ + from test import test_cprofile + test.test_support.run_doctest(test_cprofile) + if __name__ == "__main__": test_main() From buildbot at python.org Sat Feb 2 13:05:23 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 Feb 2008 12:05:23 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20080202120523.6885F1E4002@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/725 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/threading.py", line 486, in __bootstrap_inner self.run() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_socketserver.py", line 97, in run svr.serve_a_few() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_socketserver.py", line 66, in serve_a_few self.handle_request() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/SocketServer.py", line 229, in handle_request self.handle_error(request, client_address) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/SocketServer.py", line 466, in process_request self.collect_children() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/SocketServer.py", line 455, in collect_children self.active_children.remove(pid) ValueError: list.remove(x): x not in list 1 test failed: test_socketserver Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/threading.py", line 486, in __bootstrap_inner self.run() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_socketserver.py", line 97, in run svr.serve_a_few() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_socketserver.py", line 66, in serve_a_few self.handle_request() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/SocketServer.py", line 229, in handle_request self.handle_error(request, client_address) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/SocketServer.py", line 466, in process_request self.collect_children() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/SocketServer.py", line 455, in collect_children self.active_children.remove(pid) ValueError: list.remove(x): x not in list ====================================================================== ERROR: test_UDPServers (test.test_socketserver.SocketServerTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_socketserver.py", line 218, in test_UDPServers self.dgram_examine) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_socketserver.py", line 177, in run_servers testfunc(proto, addr) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_socketserver.py", line 196, in dgram_examine buf = data = receive(s, 100) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_socketserver.py", line 44, in receive raise RuntimeError, "timed out on %r" % (sock,) RuntimeError: timed out on make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 2 13:06:05 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 Feb 2008 12:06:05 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20080202120605.2F25B1E4002@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/3016 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_queue ====================================================================== FAIL: test_queue_join (test.test_queue.QueueTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_queue.py", line 180, in test_queue_join self.queue_join_test(q) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_queue.py", line 160, in queue_join_test "q.join() did not block until all tasks were done") AssertionError: q.join() did not block until all tasks were done make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 2 13:07:59 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 Feb 2008 12:07:59 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20080202120800.073881E4002@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%20trunk/builds/90 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/threading.py", line 486, in __bootstrap_inner self.run() File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/threading.py", line 446, in run self.__target(*self.__args, **self.__kwargs) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/bsddb/test/test_thread.py", line 284, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/bsddb/dbutils.py", line 62, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30995, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') 1 test failed: test_queue ====================================================================== FAIL: test_queue_join (test.test_queue.QueueTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_queue.py", line 179, in test_queue_join self.queue_join_test(q) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_queue.py", line 160, in queue_join_test "q.join() did not block until all tasks were done") AssertionError: q.join() did not block until all tasks were done ====================================================================== FAIL: test_queue_join (test.test_queue.LifoQueueTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_queue.py", line 180, in test_queue_join self.queue_join_test(q) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_queue.py", line 160, in queue_join_test "q.join() did not block until all tasks were done") AssertionError: q.join() did not block until all tasks were done ====================================================================== FAIL: test_queue_join (test.test_queue.PriorityQueueTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_queue.py", line 179, in test_queue_join self.queue_join_test(q) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/test/test_queue.py", line 160, in queue_join_test "q.join() did not block until all tasks were done") AssertionError: q.join() did not block until all tasks were done make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 2 13:16:07 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 Feb 2008 12:16:07 +0000 Subject: [Python-checkins] buildbot failure in alpha Tru64 5.1 trunk Message-ID: <20080202121607.60F4D1E401F@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%20Tru64%205.1%20trunk/builds/2459 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-tru64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 4 tests failed: test_asynchat test_signal test_smtplib test_socket ====================================================================== FAIL: testSend (test.test_smtplib.DebuggingServerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/net/taipan/scratch1/nnorwitz/python/trunk.norwitz-tru64/build/Lib/test/test_smtplib.py", line 257, in testSend self.assertEqual(self.output.getvalue(), mexpect) AssertionError: '---------- MESSAGE FOLLOWS ----------\nA test message\n------------ END MESSAGE ------------\nwarning: unhandled exception\n' != '---------- MESSAGE FOLLOWS ----------\nA test message\n------------ END MESSAGE ------------\n' sincerely, -The Buildbot From buildbot at python.org Sat Feb 2 13:17:28 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 Feb 2008 12:17:28 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian trunk Message-ID: <20080202121729.2903F1E4002@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%20Debian%20trunk/builds/238 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/threading.py", line 486, in __bootstrap_inner self.run() File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/test/test_socketserver.py", line 97, in run svr.serve_a_few() File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/test/test_socketserver.py", line 66, in serve_a_few self.handle_request() File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/SocketServer.py", line 229, in handle_request self.handle_error(request, client_address) File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/SocketServer.py", line 466, in process_request self.collect_children() File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/SocketServer.py", line 455, in collect_children self.active_children.remove(pid) ValueError: list.remove(x): x not in list 1 test failed: test_socketserver Traceback (most recent call last): File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/threading.py", line 486, in __bootstrap_inner self.run() File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/test/test_socketserver.py", line 97, in run svr.serve_a_few() File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/test/test_socketserver.py", line 66, in serve_a_few self.handle_request() File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/SocketServer.py", line 229, in handle_request self.handle_error(request, client_address) File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/SocketServer.py", line 466, in process_request self.collect_children() File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/SocketServer.py", line 455, in collect_children self.active_children.remove(pid) ValueError: list.remove(x): x not in list ====================================================================== ERROR: test_UDPServers (test.test_socketserver.SocketServerTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/test/test_socketserver.py", line 218, in test_UDPServers self.dgram_examine) File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/test/test_socketserver.py", line 177, in run_servers testfunc(proto, addr) File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/test/test_socketserver.py", line 196, in dgram_examine buf = data = receive(s, 100) File "/home/pybot/buildarea64/trunk.klose-debian-ppc64/build/Lib/test/test_socketserver.py", line 44, in receive raise RuntimeError, "timed out on %r" % (sock,) RuntimeError: timed out on make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 2 13:54:16 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 Feb 2008 12:54:16 +0000 Subject: [Python-checkins] buildbot failure in x86 FreeBSD trunk Message-ID: <20080202125416.D9EE51E4016@bag.python.org> The Buildbot has detected a new failure of x86 FreeBSD trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20FreeBSD%20trunk/builds/518 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-freebsd Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_queue ====================================================================== FAIL: test_queue_join (test.test_queue.QueueTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/test/test_queue.py", line 179, in test_queue_join self.queue_join_test(q) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/test/test_queue.py", line 160, in queue_join_test "q.join() did not block until all tasks were done") AssertionError: q.join() did not block until all tasks were done ====================================================================== FAIL: test_queue_join (test.test_queue.LifoQueueTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/test/test_queue.py", line 180, in test_queue_join self.queue_join_test(q) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/test/test_queue.py", line 160, in queue_join_test "q.join() did not block until all tasks were done") AssertionError: q.join() did not block until all tasks were done ====================================================================== FAIL: test_queue_join (test.test_queue.PriorityQueueTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/test/test_queue.py", line 180, in test_queue_join self.queue_join_test(q) File "/usr/home/db3l/buildarea/trunk.bolen-freebsd/build/Lib/test/test_queue.py", line 160, in queue_join_test "q.join() did not block until all tasks were done") AssertionError: q.join() did not block until all tasks were done sincerely, -The Buildbot From buildbot at python.org Sat Feb 2 13:57:39 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 Feb 2008 12:57:39 +0000 Subject: [Python-checkins] buildbot failure in hppa Ubuntu trunk Message-ID: <20080202125740.00D171E401F@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%20Ubuntu%20trunk/builds/585 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-hppa Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/threading.py", line 486, in __bootstrap_inner self.run() File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/test/test_socketserver.py", line 97, in run svr.serve_a_few() File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/test/test_socketserver.py", line 66, in serve_a_few self.handle_request() File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/SocketServer.py", line 229, in handle_request self.handle_error(request, client_address) File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/SocketServer.py", line 466, in process_request self.collect_children() File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/SocketServer.py", line 455, in collect_children self.active_children.remove(pid) ValueError: list.remove(x): x not in list 1 test failed: test_socketserver Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/threading.py", line 486, in __bootstrap_inner self.run() File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/test/test_socketserver.py", line 97, in run svr.serve_a_few() File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/test/test_socketserver.py", line 66, in serve_a_few self.handle_request() File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/SocketServer.py", line 229, in handle_request self.handle_error(request, client_address) File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/SocketServer.py", line 466, in process_request self.collect_children() File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/SocketServer.py", line 455, in collect_children self.active_children.remove(pid) ValueError: list.remove(x): x not in list ====================================================================== ERROR: test_UDPServers (test.test_socketserver.SocketServerTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/test/test_socketserver.py", line 218, in test_UDPServers self.dgram_examine) File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/test/test_socketserver.py", line 177, in run_servers testfunc(proto, addr) File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/test/test_socketserver.py", line 196, in dgram_examine buf = data = receive(s, 100) File "/home/pybot/buildarea/trunk.klose-ubuntu-hppa/build/Lib/test/test_socketserver.py", line 44, in receive raise RuntimeError, "timed out on %r" % (sock,) RuntimeError: timed out on make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 2 15:12:48 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 Feb 2008 14:12:48 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu trunk Message-ID: <20080202141248.8CE201E4016@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Ubuntu%20trunk/builds/160 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-sparc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/threading.py", line 486, in __bootstrap_inner self.run() File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/test/test_socketserver.py", line 97, in run svr.serve_a_few() File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/test/test_socketserver.py", line 66, in serve_a_few self.handle_request() File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/SocketServer.py", line 229, in handle_request self.handle_error(request, client_address) File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/SocketServer.py", line 466, in process_request self.collect_children() File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/SocketServer.py", line 455, in collect_children self.active_children.remove(pid) ValueError: list.remove(x): x not in list 2 tests failed: test_queue test_socketserver ====================================================================== FAIL: test_queue_join (test.test_queue.QueueTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/test/test_queue.py", line 180, in test_queue_join self.queue_join_test(q) File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/test/test_queue.py", line 160, in queue_join_test "q.join() did not block until all tasks were done") AssertionError: q.join() did not block until all tasks were done ====================================================================== FAIL: test_queue_join (test.test_queue.LifoQueueTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/test/test_queue.py", line 179, in test_queue_join self.queue_join_test(q) File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/test/test_queue.py", line 160, in queue_join_test "q.join() did not block until all tasks were done") AssertionError: q.join() did not block until all tasks were done ====================================================================== FAIL: test_queue_join (test.test_queue.PriorityQueueTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/test/test_queue.py", line 179, in test_queue_join self.queue_join_test(q) File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/test/test_queue.py", line 160, in queue_join_test "q.join() did not block until all tasks were done") AssertionError: q.join() did not block until all tasks were done Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/threading.py", line 486, in __bootstrap_inner self.run() File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/test/test_socketserver.py", line 97, in run svr.serve_a_few() File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/test/test_socketserver.py", line 66, in serve_a_few self.handle_request() File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/SocketServer.py", line 229, in handle_request self.handle_error(request, client_address) File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/SocketServer.py", line 466, in process_request self.collect_children() File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/SocketServer.py", line 455, in collect_children self.active_children.remove(pid) ValueError: list.remove(x): x not in list ====================================================================== ERROR: test_UDPServers (test.test_socketserver.SocketServerTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/test/test_socketserver.py", line 218, in test_UDPServers self.dgram_examine) File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/test/test_socketserver.py", line 177, in run_servers testfunc(proto, addr) File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/test/test_socketserver.py", line 196, in dgram_examine buf = data = receive(s, 100) File "/home/pybot/buildarea/trunk.klose-ubuntu-sparc/build/Lib/test/test_socketserver.py", line 44, in receive raise RuntimeError, "timed out on %r" % (sock,) RuntimeError: timed out on make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat Feb 2 15:22:44 2008 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 Feb 2008 14:22:44 +0000 Subject: [Python-checkins] buildbot failure in sparc Debian trunk Message-ID: <20080202142244.8CB1E1E4016@bag.python.org> The Buildbot has detected a new failure of sparc Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20Debian%20trunk/builds/7 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-sparc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/threading.py", line 486, in __bootstrap_inner self.run() File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/test/test_socketserver.py", line 97, in run svr.serve_a_few() File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/test/test_socketserver.py", line 66, in serve_a_few self.handle_request() File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/SocketServer.py", line 229, in handle_request self.handle_error(request, client_address) File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/SocketServer.py", line 466, in process_request self.collect_children() File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/SocketServer.py", line 455, in collect_children self.active_children.remove(pid) ValueError: list.remove(x): x not in list 2 tests failed: test_queue test_socketserver ====================================================================== FAIL: test_queue_join (test.test_queue.QueueTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/test/test_queue.py", line 179, in test_queue_join self.queue_join_test(q) File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/test/test_queue.py", line 160, in queue_join_test "q.join() did not block until all tasks were done") AssertionError: q.join() did not block until all tasks were done ====================================================================== FAIL: test_queue_join (test.test_queue.LifoQueueTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/test/test_queue.py", line 179, in test_queue_join self.queue_join_test(q) File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/test/test_queue.py", line 160, in queue_join_test "q.join() did not block until all tasks were done") AssertionError: q.join() did not block until all tasks were done ====================================================================== FAIL: test_queue_join (test.test_queue.PriorityQueueTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/test/test_queue.py", line 179, in test_queue_join self.queue_join_test(q) File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/test/test_queue.py", line 160, in queue_join_test "q.join() did not block until all tasks were done") AssertionError: q.join() did not block until all tasks were done Traceback (most recent call last): File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/threading.py", line 486, in __bootstrap_inner self.run() File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/test/test_socketserver.py", line 97, in run svr.serve_a_few() File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/test/test_socketserver.py", line 66, in serve_a_few self.handle_request() File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/SocketServer.py", line 229, in handle_request self.handle_error(request, client_address) File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/SocketServer.py", line 227, in handle_request self.process_request(request, client_address) File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/SocketServer.py", line 466, in process_request self.collect_children() File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/SocketServer.py", line 455, in collect_children self.active_children.remove(pid) ValueError: list.remove(x): x not in list ====================================================================== ERROR: test_UDPServers (test.test_socketserver.SocketServerTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/test/test_socketserver.py", line 218, in test_UDPServers self.dgram_examine) File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/test/test_socketserver.py", line 177, in run_servers testfunc(proto, addr) File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/test/test_socketserver.py", line 196, in dgram_examine buf = data = receive(s, 100) File "/home/pybot/buildarea-sid/trunk.klose-debian-sparc/build/Lib/test/test_socketserver.py", line 44, in receive raise RuntimeError, "timed out on %r" % (sock,) RuntimeError: timed out on make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat Feb 2 18:16:13 2008 From: python-checkins at python.org (mark.dickinson) Date: Sat, 2 Feb 2008 18:16:13 +0100 (CET) Subject: [Python-checkins] r60530 - in python/trunk/Lib: rational.py test/test_rational.py Message-ID: <20080202171613.842CA1E4018@bag.python.org> Author: mark.dickinson Date: Sat Feb 2 18:16:13 2008 New Revision: 60530 Modified: python/trunk/Lib/rational.py python/trunk/Lib/test/test_rational.py Log: Make the Rational constructor accept '3.' and '.2' as well as '3.2'. Modified: python/trunk/Lib/rational.py ============================================================================== --- python/trunk/Lib/rational.py (original) +++ python/trunk/Lib/rational.py Sat Feb 2 18:16:13 2008 @@ -25,9 +25,18 @@ return a -_RATIONAL_FORMAT = re.compile( - r'^\s*(?P[-+]?)(?P\d+)' - r'(?:/(?P\d+)|\.(?P\d+))?\s*$') +_RATIONAL_FORMAT = re.compile(r""" + \A\s* # optional whitespace at the start, then + (?P[-+]?) # an optional sign, then + (?=\d|\.\d) # lookahead for digit or .digit + (?P\d*) # numerator (possibly empty) + (?: # followed by an optional + /(?P\d+) # / and denominator + | # or + \.(?P\d*) # decimal point and fractional part + )? + \s*\Z # and optional whitespace to finish +""", re.VERBOSE) class Rational(RationalAbc): Modified: python/trunk/Lib/test/test_rational.py ============================================================================== --- python/trunk/Lib/test/test_rational.py (original) +++ python/trunk/Lib/test/test_rational.py Sat Feb 2 18:16:13 2008 @@ -78,6 +78,8 @@ self.assertEquals((16, 5), _components(R(" 3.2 "))) self.assertEquals((-16, 5), _components(R(u" -3.2 "))) + self.assertEquals((-3, 1), _components(R(u" -3. "))) + self.assertEquals((3, 5), _components(R(u" .6 "))) self.assertRaisesMessage( @@ -113,6 +115,10 @@ # Don't accept combinations of decimals and rationals. ValueError, "Invalid literal for Rational: 3.2/7", R, "3.2/7") + self.assertRaisesMessage( + # Allow 3. and .3, but not . + ValueError, "Invalid literal for Rational: .", + R, ".") def testImmutable(self): r = R(7, 3) From python-checkins at python.org Sat Feb 2 19:52:52 2008 From: python-checkins at python.org (neal.norwitz) Date: Sat, 2 Feb 2008 19:52:52 +0100 (CET) Subject: [Python-checkins] r60531 - python/trunk/Misc/build.sh Message-ID: <20080202185252.042591E4018@bag.python.org> Author: neal.norwitz Date: Sat Feb 2 19:52:51 2008 New Revision: 60531 Modified: python/trunk/Misc/build.sh Log: Update the leaky tests (ie, ignore these tests if they report leaks). This version has been running for a while. Modified: python/trunk/Misc/build.sh ============================================================================== --- python/trunk/Misc/build.sh (original) +++ python/trunk/Misc/build.sh Sat Feb 2 19:52:51 2008 @@ -67,7 +67,7 @@ # Note: test_XXX (none currently) really leak, but are disabled # so we don't send spam. Any test which really leaks should only # be listed here if there are also test cases under Lib/test/leakers. -LEAKY_TESTS="test_(cmd_line|popen2|socket|urllib2_localnet)" +LEAKY_TESTS="test_(cmd_line|popen2|socket|sys|threadsignals|urllib2_localnet)" # Skip these tests altogether when looking for leaks. These tests # do not need to be stored above in LEAKY_TESTS too. From python-checkins at python.org Sat Feb 2 20:11:57 2008 From: python-checkins at python.org (skip.montanaro) Date: Sat, 2 Feb 2008 20:11:57 +0100 (CET) Subject: [Python-checkins] r60533 - python/trunk/Misc/build.sh Message-ID: <20080202191157.C2AF91E4018@bag.python.org> Author: skip.montanaro Date: Sat Feb 2 20:11:57 2008 New Revision: 60533 Modified: python/trunk/Misc/build.sh Log: Split the refleak mail body into two parts, the first being those failing tests which are deemed more important issues, the second those which are known to have difficult to solve problems and are generally expected to leak. Hopefully this doesn't break the script... Modified: python/trunk/Misc/build.sh ============================================================================== --- python/trunk/Misc/build.sh (original) +++ python/trunk/Misc/build.sh Sat Feb 2 20:11:57 2008 @@ -97,7 +97,17 @@ if [ "$FAILURE_CC" != "" ]; then dest="$dest -c $FAILURE_CC" fi - mutt -s "$FAILURE_SUBJECT $1 ($NUM_FAILURES)" $dest < $2 + if [ "x$3" != "x" ] ; then + (echo "More important issues:" + echo "----------------------" + egrep -v "$3" < $2 + echo "" + echo "Less important issues:" + echo "----------------------" + egrep "$3" < $2) + else + cat $2 + fi | mutt -s "$FAILURE_SUBJECT $1 ($NUM_FAILURES)" $dest fi } @@ -192,9 +202,10 @@ ## ensure that the reflog exists so the grep doesn't fail touch $REFLOG $PYTHON $REGRTEST_ARGS -R 4:3:$REFLOG -u network $LEAKY_SKIPS >& build/$F - NUM_FAILURES=`egrep -vc "($LEAKY_TESTS|sum=0)" $REFLOG` + LEAK_PAT="($LEAKY_TESTS|sum=0)" + NUM_FAILURES=`egrep -vc "$LEAK_PAT" $REFLOG` update_status "Testing refleaks ($NUM_FAILURES failures)" "$F" $start - mail_on_failure "refleak" $REFLOG + mail_on_failure "refleak" $REFLOG "$LEAK_PAT" ## now try to run all the tests F=make-testall.out From nnorwitz at gmail.com Sat Feb 2 23:22:48 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 2 Feb 2008 17:22:48 -0500 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20080202222248.GA4599@python.psfb.org> test_threadedtempfile leaked [-81, 0, 0] references, sum=-81 test_threadsignals leaked [0, -8, 0] references, sum=-8 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 From nnorwitz at gmail.com Sat Feb 2 23:41:13 2008 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 2 Feb 2008 17:41:13 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20080202224113.GA7777@python.psfb.org> test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aepack test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named macostools test_array test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 Exception in thread reader 0: Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.6/threading.py", line 486, in __bootstrap_inner self.run() File "/tmp/python-test/local/lib/python2.6/threading.py", line 446, in run self.__target(*self.__args, **self.__kwargs) File "/tmp/python-test/local/lib/python2.6/bsddb/test/test_thread.py", line 284, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/tmp/python-test/local/lib/python2.6/bsddb/dbutils.py", line 62, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30996, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') Exception in thread reader 1: Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.6/threading.py", line 486, in __bootstrap_inner self.run() File "/tmp/python-test/local/lib/python2.6/threading.py", line 446, in run self.__target(*self.__args, **self.__kwargs) File "/tmp/python-test/local/lib/python2.6/bsddb/test/test_thread.py", line 284, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/tmp/python-test/local/lib/python2.6/bsddb/dbutils.py", line 62, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30996, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') Exception in thread writer 0: Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.6/threading.py", line 486, in __bootstrap_inner self.run() File "/tmp/python-test/local/lib/python2.6/threading.py", line 446, in run self.__target(*self.__args, **self.__kwargs) File "/tmp/python-test/local/lib/python2.6/bsddb/test/test_thread.py", line 263, in writerThread self.assertEqual(data, self.makeData(key)) File "/tmp/python-test/local/lib/python2.6/unittest.py", line 343, in failUnlessEqual (msg or '%r != %r' % (first, second)) AssertionError: None != '0004-0004-0004-0004-0004' Exception in thread writer 1: Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.6/threading.py", line 486, in __bootstrap_inner self.run() File "/tmp/python-test/local/lib/python2.6/threading.py", line 446, in run self.__target(*self.__args, **self.__kwargs) File "/tmp/python-test/local/lib/python2.6/bsddb/test/test_thread.py", line 263, in writerThread self.assertEqual(data, self.makeData(key)) File "/tmp/python-test/local/lib/python2.6/unittest.py", line 343, in failUnlessEqual (msg or '%r != %r' % (first, second)) AssertionError: None != '1006-1006-1006-1006-1006' Exception in thread writer 2: Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.6/threading.py", line 486, in __bootstrap_inner self.run() File "/tmp/python-test/local/lib/python2.6/threading.py", line 446, in run self.__target(*self.__args, **self.__kwargs) File "/tmp/python-test/local/lib/python2.6/bsddb/test/test_thread.py", line 263, in writerThread self.assertEqual(data, self.makeData(key)) File "/tmp/python-test/local/lib/python2.6/unittest.py", line 343, in failUnlessEqual (msg or '%r != %r' % (first, second)) AssertionError: None != '2002-2002-2002-2002-2002' test_buffer test_bufio test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compiler testCompileLibrary still working, be patient... test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_float test_fnmatch test_fork1 test_format test_fpformat test_frozen test_ftplib test_funcattrs test_functools test_future test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hexoct test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_imageop test_imageop skipped -- No module named imgfile test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_index test_inspect test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_isinstance test_iter test_iterlen test_itertools test_largefile test_list test_locale test_logging test_long test_long_future test_longexp test_macostools test_macostools skipped -- No module named macostools test_macpath test_mailbox test_marshal test_math test_md5 test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_mutants test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os test_parser test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_platform test_plistlib test_poll test_popen [7761 refs] [7761 refs] [7761 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_pyclbr test_pyexpat test_queue test_quopri [8138 refs] [8138 refs] test_random test_rational test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site test_slice test_smtplib test_socket test_socket_ssl /tmp/python-test/local/lib/python2.6/test/test_socket_ssl.py:108: DeprecationWarning: socket.ssl() is deprecated. Use ssl.wrap_socket() instead. ssl_sock = socket.ssl(s) /tmp/python-test/local/lib/python2.6/test/test_socket_ssl.py:74: DeprecationWarning: socket.ssl() is deprecated. Use ssl.wrap_socket() instead. ss = socket.ssl(s) /tmp/python-test/local/lib/python2.6/test/test_socket_ssl.py:157: DeprecationWarning: socket.ssl() is deprecated. Use ssl.wrap_socket() instead. ss = socket.ssl(s) /tmp/python-test/local/lib/python2.6/test/test_socket_ssl.py:171: DeprecationWarning: socket.ssl() is deprecated. Use ssl.wrap_socket() instead. ss = socket.ssl(s) test test_socket_ssl failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.6/test/test_socket_ssl.py", line 45, in testBasic buf = f.read() File "/tmp/python-test/local/lib/python2.6/ssl.py", line 333, in read data = self._sslobj.read(recv_size) SSLError: [Errno 8] _ssl.c:1276: EOF occurred in violation of protocol test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- cannot import name startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [7756 refs] [7757 refs] [7756 refs] [7756 refs] [7756 refs] [7756 refs] [7756 refs] [7756 refs] [7756 refs] [7756 refs] [7757 refs] [9376 refs] [7974 refs] [7757 refs] [7756 refs] [7756 refs] [7756 refs] [7756 refs] [7756 refs] . [7756 refs] [7756 refs] this bit of output is from a test of stdout in a different process ... [7756 refs] [7756 refs] [7974 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry test_symtable test_syntax test_sys [7756 refs] [7756 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [7760 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [10884 refs] test_threading_local test_threadsignals test_time test_timeout test_tokenize test_trace test_traceback test_transformer test_tuple test_typechecks test_ucn test_unary test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllibnet test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib test_xmlrpc test_xpickle test_xrange test_zipfile /tmp/python-test/local/lib/python2.6/test/test_zipfile.py:472: DeprecationWarning: struct integer overflow masking is deprecated zipfp.close() /tmp/python-test/local/lib/python2.6/test/test_zipfile.py:399: DeprecationWarning: struct integer overflow masking is deprecated zipfp.close() test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zlib 315 tests OK. 1 test failed: test_socket_ssl 20 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_cd test_cl test_gl test_imageop test_imgfile test_ioctl test_macostools test_pep277 test_scriptpackages test_startfile test_sunaudiodev test_tcl test_unicode_file test_winreg test_winsound test_zipfile64 1 skip unexpected on linux2: test_ioctl [559676 refs] From python-checkins at python.org Sun Feb 3 00:59:22 2008 From: python-checkins at python.org (georg.brandl) Date: Sun, 3 Feb 2008 00:59:22 +0100 (CET) Subject: [Python-checkins] r60534 - python/trunk/Lib/test/test_queue.py Message-ID: <20080202235922.190B11E4018@bag.python.org> Author: georg.brandl Date: Sun Feb 3 00:59:21 2008 New Revision: 60534 Modified: python/trunk/Lib/test/test_queue.py Log: Fix a conversion mistake that caused test_queue to fail intermittently. Modified: python/trunk/Lib/test/test_queue.py ============================================================================== --- python/trunk/Lib/test/test_queue.py (original) +++ python/trunk/Lib/test/test_queue.py Sun Feb 3 00:59:21 2008 @@ -138,13 +138,13 @@ def worker(self, q): while True: - self.x = q.get() - if self.x is None: + x = q.get() + if x is None: q.task_done() return self.cumlock.acquire() try: - self.cum += self.x + self.cum += x finally: self.cumlock.release() q.task_done() @@ -157,7 +157,7 @@ q.put(i) q.join() self.assertEquals(self.cum, sum(range(100)), - "q.join() did not block until all tasks were done") + "q.join() did not block until all tasks were done") for i in (0,1): q.put(None) # instruct the threads to close q.join() # verify that you can join twice From python-checkins at python.org Sun Feb 3 01:04:51 2008 From: python-checkins at python.org (georg.brandl) Date: Sun, 3 Feb 2008 01:04:51 +0100 (CET) Subject: [Python-checkins] r60535 - python/trunk/Lib/test/test_socketserver.py Message-ID: <20080203000451.14B851E4018@bag.python.org> Author: georg.brandl Date: Sun Feb 3 01:04:50 2008 New Revision: 60535 Modified: python/trunk/Lib/test/test_socketserver.py Log: Wait for a delay before rea