[packages/python-logilab-common] Fixed some crashes under Python 3

jajcus jajcus at pld-linux.org
Tue May 28 10:18:24 CEST 2013


commit 42c5fd718d6b0fa79e373dbc9dae83c64733283f
Author: Jacek Konieczny <j.konieczny at eggsoft.pl>
Date:   Tue May 28 10:15:51 2013 +0200

    Fixed some crashes under Python 3
    
    Fixes for:
    http://www.logilab.org/ticket/136037
    http://www.logilab.org/ticket/137244
    
    Release: 4

 python-logilab-common-136037.patch | 43 +++++++++++++++++++++++++++++
 python-logilab-common-137244.patch | 56 ++++++++++++++++++++++++++++++++++++++
 python-logilab-common.spec         |  8 +++++-
 3 files changed, 106 insertions(+), 1 deletion(-)
---
diff --git a/python-logilab-common.spec b/python-logilab-common.spec
index 0a028ba..1f39ae3 100644
--- a/python-logilab-common.spec
+++ b/python-logilab-common.spec
@@ -8,11 +8,13 @@ Summary:	Logilab common modules
 Summary(pl.UTF-8):	Wspólne moduły Logilab
 Name:		python-logilab-common
 Version:	0.59.1
-Release:	3
+Release:	4
 License:	LGPL v2.1+
 Group:		Development/Languages/Python
 Source0:	http://download.logilab.org/pub/common/%{module}-%{version}.tar.gz
 # Source0-md5:	614f0a5cd78242dad3317fd83d54ccc4
+Patch0:		%{name}-136037.patch
+Patch1:		%{name}-137244.patch
 URL:		http://www.logilab.org/project/logilab-common
 %if %{with python2}
 BuildRequires:	python-devel
@@ -57,6 +59,10 @@ projekty tworzone przez Logilab.
 
 %prep
 %setup -q -n %{module}-%{version}
+
+%patch0 -p1
+%patch1 -p1
+
 # drop python 2.5 egg deps
 rm */*/*py2.5.egg
 
diff --git a/python-logilab-common-136037.patch b/python-logilab-common-136037.patch
new file mode 100644
index 0000000..a367e5d
--- /dev/null
+++ b/python-logilab-common-136037.patch
@@ -0,0 +1,43 @@
+
+# HG changeset patch
+# User Sylvain Thénault <sylvain.thenault at logilab.fr>
+# Date 1367243985 -7200
+# Node ID 0cda985d7d272d15690b482f1a17ddb801b2b303
+# Parent  3caeb222b550dceaf6e1e9bf20138e872b9c9fab
+[modutils] fix typo causing name error in python3 / bad message in python2. Closes #136037
+
+diff -r 3caeb222b550 -r 0cda985d7d27 ChangeLog
+--- a/ChangeLog	Wed Apr 17 11:37:27 2013 +0200
++++ b/ChangeLog	Mon Apr 29 15:59:45 2013 +0200
+@@ -1,6 +1,11 @@
+ ChangeLog for logilab.common
+ ============================
+ 
++--
++    * modutils: fix typo causing name error in python3 / bad message in python2
++      (#136037)
++
++
+ 2013-04-16  --  0.59.1
+     * graph: added pruning of the recursive search tree for detecting cycles in
+       graphs (closes #2469)
+diff -r 3caeb222b550 -r 0cda985d7d27 modutils.py
+--- a/modutils.py	Wed Apr 17 11:37:27 2013 +0200
++++ b/modutils.py	Mon Apr 29 15:59:45 2013 +0200
+@@ -1,5 +1,5 @@
+ # -*- coding: utf-8 -*-
+-# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
++# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+ # contact http://www.logilab.fr/ -- mailto:contact at logilab.fr
+ #
+ # This file is part of logilab-common.
+@@ -570,7 +570,7 @@
+             if importer.find_module(modpath[0]):
+                 if not importer.find_module('/'.join(modpath)):
+                     raise ImportError('No module named %s in %s/%s' % (
+-                        '.'.join(modpath[1:]), file, modpath))
++                        '.'.join(modpath[1:]), filepath, modpath))
+                 return ZIPFILE, abspath(filepath) + '/' + '/'.join(modpath), filepath
+     raise ImportError('No module named %s' % '.'.join(modpath))
+ 
+
diff --git a/python-logilab-common-137244.patch b/python-logilab-common-137244.patch
new file mode 100644
index 0000000..bef3fe3
--- /dev/null
+++ b/python-logilab-common-137244.patch
@@ -0,0 +1,56 @@
+
+# HG changeset patch
+# User Sylvain Thénault <sylvain.thenault at logilab.fr>
+# Date 1367930788 -7200
+# Node ID 5a8fb4b4a7f567b65b8f935282316be0b1f9018e
+# Parent  4e579e9a97922a94624c2d04ae1af5268f0d487c
+[modutils] fix python3.3 crash on file_from_modpath. Closes #137244
+
+diff -r 4e579e9a9792 -r 5a8fb4b4a7f5 ChangeLog
+--- a/ChangeLog	Tue May 07 14:42:37 2013 +0200
++++ b/ChangeLog	Tue May 07 14:46:28 2013 +0200
+@@ -2,8 +2,13 @@
+ ============================
+ 
+ --
+-    * modutils: fix typo causing name error in python3 / bad message in python2
+-      (#136037)
++    * modutils:
++
++      * fix typo causing name error in python3 / bad message in python2
++        (#136037)
++
++      * fix python3.3 crash in file_from_modpath due to implementation
++        change of imp.find_module wrt builtin modules (#137244)
+ 
+ 
+ 2013-04-16  --  0.59.1
+diff -r 4e579e9a9792 -r 5a8fb4b4a7f5 modutils.py
+--- a/modutils.py	Tue May 07 14:42:37 2013 +0200
++++ b/modutils.py	Tue May 07 14:46:28 2013 +0200
+@@ -606,6 +606,15 @@
+         checkeggs = False
+     imported = []
+     while modpath:
++        # take care to changes in find_module implementation wrt builtin modules
++        #
++        # Python 2.6.6 (r266:84292, Sep 11 2012, 08:34:23)
++        # >>> imp.find_module('posix')
++        # (None, 'posix', ('', '', 6))
++        #
++        # Python 3.3.1 (default, Apr 26 2013, 12:08:46)
++        # >>> imp.find_module('posix')
++        # (None, None, ('', '', 6))
+         try:
+             _, mp_filename, mp_desc = find_module(modpath[0], path)
+         except ImportError:
+@@ -613,7 +622,7 @@
+                 return _search_zip(modpath, pic)[:2]
+             raise
+         else:
+-            if checkeggs:
++            if checkeggs and mp_filename:
+                 fullabspath = [abspath(x) for x in _path]
+                 try:
+                     pathindex = fullabspath.index(dirname(abspath(mp_filename)))
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-logilab-common.git/commitdiff/42c5fd718d6b0fa79e373dbc9dae83c64733283f



More information about the pld-cvs-commit mailing list