# HG changeset patch # User Sylvain Thénault # Date 1287583107 -7200 # Node ID e89de028d00403e538fb75bd38b3cc9270d5784c # Parent ff9f7c5664645ecbea70830ef1b913da2868abe4# Parent 34be5986bca0adb8fbf4a8cc066f884402f38046 backport stable diff -r ff9f7c566464 -r e89de028d004 cwctl.py --- a/cwctl.py Wed Oct 20 15:57:35 2010 +0200 +++ b/cwctl.py Wed Oct 20 15:58:27 2010 +0200 @@ -35,6 +35,7 @@ def getpgid(): """win32 getpgid implementation""" + from os.path import exists, join, isfile, isdir, dirname, abspath from logilab.common.clcommands import CommandLine @@ -952,6 +953,9 @@ def run(args): """command line tool""" + import os + sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) + sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0) cwcfg.load_cwctl_plugins() try: CWCTL.run(args) diff -r ff9f7c566464 -r e89de028d004 selectors.py --- a/selectors.py Wed Oct 20 15:57:35 2010 +0200 +++ b/selectors.py Wed Oct 20 15:58:27 2010 +0200 @@ -450,7 +450,8 @@ req.vreg[self.registry].select(regid, req, **kwargs) return self.selectable_score except NoSelectableObject: - return 0 + continue + return 0 class adaptable(appobject_selectable): diff -r ff9f7c566464 -r e89de028d004 web/data/cubicweb.ajax.js --- a/web/data/cubicweb.ajax.js Wed Oct 20 15:57:35 2010 +0200 +++ b/web/data/cubicweb.ajax.js Wed Oct 20 15:58:27 2010 +0200 @@ -36,12 +36,10 @@ }, addCallback: function(callback) { - if (this._req.readyState == 4) { - if (this._result) { - var args = [this._result, this._req]; - jQuery.merge(args, cw.utils.sliceList(arguments, 1)); - callback.apply(null, args); - } + if ((this._req.readyState == 4) && this._result) { + var args = [this._result, this._req]; + jQuery.merge(args, cw.utils.sliceList(arguments, 1)); + callback.apply(null, args); } else { this._onSuccess.push([callback, cw.utils.sliceList(arguments, 1)]); @@ -50,10 +48,8 @@ }, addErrback: function(callback) { - if (this._req.readyState == 4) { - if (this._error) { - callback.apply(null, [this._error, this._req]); - } + if (this._req.readyState == 4 && this._error) { + callback.apply(null, [this._error, this._req]); } else { this._onFailure.push([callback, cw.utils.sliceList(arguments, 1)]);