Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 437422 - dev-python/pythonmagick-0.9.8 - `import PythonMagick' fails
Summary: dev-python/pythonmagick-0.9.8 - `import PythonMagick' fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
: 438684 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-06 16:19 UTC by Chris Mayo
Modified: 2012-11-13 16:58 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Mayo 2012-10-06 16:19:01 UTC
pythonmagick-0.9.8 emerges fine with Python 3.3 but cannot be used:

    import PythonMagick
  File "/usr/lib64/python3.3/site-packages/PythonMagick/__init__.py", line 1
    from . from . import _PythonMagick
              ^
SyntaxError: invalid syntax


Looks like sed in ebuild:
# Support Python 3.
sed -e "s/import _PythonMagick/from . import _PythonMagick/" -i PythonMagick/__init__.py || die "sed failed"

is no longer needed with pythonmagick-0.9.8:
$ diff -u PythonMagick-0.9.7/PythonMagick/__init__.py PythonMagick-0.9.8/PythonMagick/__init__.py 
--- PythonMagick-0.9.7/PythonMagick/__init__.py	2011-08-11 13:59:31.000000000 +0100
+++ PythonMagick-0.9.8/PythonMagick/__init__.py	2012-01-25 20:03:38.000000000 +0000
@@ -1,4 +1,4 @@
-import _PythonMagick
+from . import _PythonMagick
 
 class Image(_PythonMagick.Image):
     pass



N.B. also needs automake-1.12 to emerge which is not yet stable.
Comment 1 Magnus Kessler 2012-10-16 07:55:41 UTC
The issue also arises with Python 2.7

I can confirm that removing the sed line from the ebuild fixes the syntax error on both 2.7 and 3.2

I can also confirm that pythonmagic-0.9.8 needs automake-1.12 to build successfully.
Comment 2 Ian Delaney (RETIRED) gentoo-dev 2012-11-12 19:09:07 UTC
Easy this one;

Available Python interpreters:
  [1]   python2.5
  [2]   python2.6
  [3]   python2.7
  [4]   python3.1
  [5]   python3.2 *
pythonmagick # python
Python 3.2.3 (default, Oct 27 2012, 05:59:41) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PythonMagick
>>> quit()
pythonmagick # 

ditto other python versions. Fixed in the tree
Comment 3 Ian Delaney (RETIRED) gentoo-dev 2012-11-13 16:58:47 UTC
*** Bug 438684 has been marked as a duplicate of this bug. ***