From ef1421c703cb1db072adbd6010a19a073432c4901bee159e2f46541d61eaab59 Mon Sep 17 00:00:00 2001 From: Sascha Peilicke Date: Mon, 11 Jun 2012 12:30:00 +0000 Subject: [PATCH] - added a patch to fix a TypeError in LockBase.__init__ when the current thread has ident == None OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lockfile?expand=0&rev=8 --- python-lockfile-empty_ident.patch | 11 +++++++++++ python-lockfile.changes | 6 ++++++ python-lockfile.spec | 11 ++++++++--- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 python-lockfile-empty_ident.patch diff --git a/python-lockfile-empty_ident.patch b/python-lockfile-empty_ident.patch new file mode 100644 index 0000000..c10875c --- /dev/null +++ b/python-lockfile-empty_ident.patch @@ -0,0 +1,11 @@ +--- lockfile-0.9.1/lockfile/__init__.py.orig 2012-02-02 13:32:51.133789612 +0100 ++++ lockfile-0.9.1/lockfile/__init__.py 2012-02-02 13:33:13.024241010 +0100 +@@ -167,7 +167,7 @@ + t = threading.current_thread() + # Thread objects in Python 2.4 and earlier do not have ident + # attrs. Worm around that. +- ident = getattr(t, "ident", hash(t)) ++ ident = getattr(t, "ident", hash(t)) or hash(t) + self.tname = "-%x" % (ident & 0xffffffff) + else: + self.tname = "" diff --git a/python-lockfile.changes b/python-lockfile.changes index 2332205..4fb5021 100644 --- a/python-lockfile.changes +++ b/python-lockfile.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Feb 2 13:41:07 CET 2012 - iartarisi@suse.cz + +- added a patch to fix a TypeError in LockBase.__init__ when the current + thread has ident == None + ------------------------------------------------------------------- Sat Apr 16 00:09:30 UTC 2011 - alexandre@exatati.com.br diff --git a/python-lockfile.spec b/python-lockfile.spec index 263b998..5f8a3e9 100644 --- a/python-lockfile.spec +++ b/python-lockfile.spec @@ -1,7 +1,7 @@ # # spec file for package python-lockfile # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -23,12 +23,13 @@ Name: python-%{mod_name} Version: 0.9.1 -Release: 1 +Release: 0 Url: http://code.google.com/p/pylockfile/ Summary: Platform-independent file locking module -License: MIT License +License: MIT Group: Development/Languages/Python Source: %{mod_name}-%{version}.tar.bz2 +Patch0: %{name}-empty_ident.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: python-devel %if 0%{?suse_version} @@ -51,6 +52,10 @@ production-quality code. %prep %setup -q -n %{mod_name}-%{version} +# current thread has ident = None, which causes a TypeError +# http://code.google.com/p/pylockfile/issues/detail?id=8 +%patch0 -p1 -b .empty_ident + %build export CFLAGS="%{optflags}" python setup.py build