Brian Thorne added the comment:

I've put together a patch adding the test requested. There is no problem on my 
Ubuntu machine with python 3.3.
There is a comment in the file saying Don't load the xx module more than once, 
I am unsure whether my patch (using a renamed c file) violates this?


One extremely minor nitpick that I'll mention is inconsistency with spaces in 
the module name. One can create a python file "my file.py" and can import it 
with __import__("my file"). I couldn't do the same for a C extension.

Building a C extension with distutils:

  module_name = 'ex ample'
  example_ext = Extension(module_name, [target_c])
  dist = Distribution({'name': module_name, 'ext_modules': [example_ext]})

Doesn't work due to the import mechanism looks for a PyInit function with the 
new module name (including a space):

  ImportError: dynamic module does not define init function (PyInit_ex ample)

I don't think this is worth making a ticket over.

----------
Added file: http://bugs.python.org/file26700/distutils_space_test.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue4508>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to