summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Th?nault <sylvain.thenault@logilab.fr>2011-10-28 12:30:14 +0200
committerSylvain Th?nault <sylvain.thenault@logilab.fr>2011-10-28 12:30:14 +0200
commit4946ca1b4a445b38257a57996b72a368c0b3b4bd (patch)
tree485a0637b2ef51309d75683f49fa525b7612d6dd
parentdca0bc8ab45d0fba854e3e0cb103ee47aa1baef0 (diff)
parent8c2d6f0c4e74144acfd4f26578d38ea319f468ae (diff)
downloadlogilab-common-4946ca1b4a445b38257a57996b72a368c0b3b4bd.tar.gz
backport stable
-rw-r--r--ChangeLog29
-rw-r--r--__pkginfo__.py2
-rw-r--r--compat.py3
-rw-r--r--daemon.py1
-rw-r--r--debian/changelog12
-rw-r--r--decorators.py3
6 files changed, 40 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 0a14f40..f1860b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,13 +1,28 @@
ChangeLog for logilab.common
============================
- --
-* only install unittest2 when python version < 2.7 (closes: #76068)
-* daemon: make pidfile world-readable (closes #75968)
-* daemon: remove unused(?) DaemonMixin class
-* update compat module for callable() and method_type()
-* decorators: fix monkeypatch py3k compat (closes #75290)
-* decorators: provide a @cachedproperty decorator
+2011-10-28 -- 0.57.1
+ * daemon: change $HOME after dropping privileges (closes #81297)
+
+ * compat: method_type for py3k use instance of the class to have a
+ real instance method (closes: #79268)
+
+
+
+2011-10-12 -- 0.57.0
+ * only install unittest2 when python version < 2.7 (closes: #76068)
+
+ * daemon: make pidfile world-readable (closes #75968)
+
+ * daemon: remove unused(?) DaemonMixin class
+
+ * update compat module for callable() and method_type()
+
+ * decorators: fix monkeypatch py3k compat (closes #75290)
+
+ * decorators: provide a @cachedproperty decorator
+
+
2011-09-08 -- 0.56.2
* daemon: call initgroups/setgid before setuid (closes #74173)
diff --git a/__pkginfo__.py b/__pkginfo__.py
index 41761dc..83a43cf 100644
--- a/__pkginfo__.py
+++ b/__pkginfo__.py
@@ -24,7 +24,7 @@ modname = 'common'
subpackage_of = 'logilab'
subpackage_master = True
-numversion = (0, 56, 2)
+numversion = (0, 57, 1)
version = '.'.join([str(num) for num in numversion])
license = 'LGPL' # 2.1 or later
diff --git a/compat.py b/compat.py
index 47ef25c..8983ece 100644
--- a/compat.py
+++ b/compat.py
@@ -63,7 +63,8 @@ except AttributeError:
# See also http://bugs.python.org/issue11776
if sys.version_info[0] == 3:
def method_type(callable, instance, klass):
- return types.MethodType(callable, klass)
+ # api change. klass is no more considered
+ return types.MethodType(callable, instance)
else:
# alias types otherwise
method_type = types.MethodType
diff --git a/daemon.py b/daemon.py
index bf7d57c..c8342a8 100644
--- a/daemon.py
+++ b/daemon.py
@@ -46,6 +46,7 @@ def setugid(user):
raise OSError(err, os.strerror(err), 'initgroups')
os.setgid(passwd.pw_gid)
os.setuid(passwd.pw_uid)
+ os.putenv('HOME', passwd.pw_dir)
def daemonize(pidfile=None, uid=None, umask=077):
diff --git a/debian/changelog b/debian/changelog
index 82d6b88..16ceaac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+logilab-common (0.57.1-1) unstable; urgency=low
+
+ * new upstream release
+
+ -- Sylvain Thénault <sylvain.thenault@logilab.fr> Fri, 28 Oct 2011 11:59:28 +0200
+
+logilab-common (0.57.0-1) unstable; urgency=low
+
+ * new upstream release
+
+ -- Aurélien Campéas <aurelien.campeas@logilab.fr> Wed, 12 Oct 2011 15:43:00 +0200
+
logilab-common (0.56.2-2) unstable; urgency=low
* depends on python >= 2.5
diff --git a/decorators.py b/decorators.py
index 2bce3e8..43c3652 100644
--- a/decorators.py
+++ b/decorators.py
@@ -18,6 +18,7 @@
""" A few useful function/method decorators. """
__docformat__ = "restructuredtext en"
+import sys
from time import clock, time
from logilab.common.compat import callable, method_type
@@ -272,7 +273,7 @@ def monkeypatch(klass, methodname=None):
raise AttributeError('%s has no __name__ attribute: '
'you should provide an explicit `methodname`'
% func)
- if callable(func):
+ if callable(func) and sys.version_info < (3, 0):
setattr(klass, name, method_type(func, None, klass))
else:
# likely a property