This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author metolone
Recipients metolone
Date 2012-08-31.07:32:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1346398348.83.0.242228991466.issue15828@psf.upfronthosting.co.za>
In-reply-to
Content
I built a C extension using SWIG for both Python 3.2 and Python 3.3.  The Python file supplying class proxies uses imp.load_module and fails with the following traceback on 3.3.0rc1, but works on 3.2.3:

   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File ".\Widget.py", line 26, in <module>
       _Widget = swig_import_helper()
     File ".\Widget.py", line 22, in swig_import_helper
       _mod = imp.load_module('_Widget', fp, pathname, description)
     File "D:\dev\python33\lib\imp.py", line 171, in load_module
       raise ImportError(msg, name=name)
   ImportError: Don't know how to import _Widget (type code 3

It looks like imp.py is new in Python 3.3, and imp.load_module no longer supports the C_EXTENSION type.  It looks like a regression.

To reproduce, I was able to run the following lines with the .pyd file in the current directory:

   import imp
   fp, pathname, description = imp.find_module('_Widget')
   imp.load_module('_Widget', fp, pathname, description)

Nit: Also note the missing final ')' in the ImportError message.
History
Date User Action Args
2012-08-31 07:32:28metolonesetrecipients: + metolone
2012-08-31 07:32:28metolonesetmessageid: <1346398348.83.0.242228991466.issue15828@psf.upfronthosting.co.za>
2012-08-31 07:32:28metolonelinkissue15828 messages
2012-08-31 07:32:26metolonecreate