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 smani
Recipients eric.araujo, smani, tarek
Date 2012-12-23.12:36:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I'm using Python3 as available in Fedora rawhide 

Attempting to build a project using python3/distutils, I noticed that 
find_library_file would not find any library at all. Some investigation 
showed that this was due to the fact that libraries were searched with 
the "" extension. Even more investigation showed that the 
library extension was read being overridden by the one defined in the 
/usr/lib64/python3.3/config-3.3m/Makefile shipped by python3-libs. See 
below for the detailed analysis. The python-versioned extension 
obviously makes no sense for regular shared objects which are not python 
binary modules, so this is clearly wrong. As a workaround I patched to comment out customize_compiler::235 (compiler.shared_lib_extension = 
so_ext, see below), recompiled python (all tests still pass), and things seem to work.

Detailed analysis:
def _find_library_file(self, library):
     return self.compiler.find_library_file(self.compiler.library_dirs, 

In function 
/usr/lib64/python3.3/distutils/ at find_library_file::266:
shared_f = self.library_filename(lib, lib_type='shared')

In function 
/usr/lib64/python3.3/distutils/ at library_filename::882:
ext = getattr(self, lib_type + "_lib_extension")

-> Where does shared_lib_extension get defined?
* At /usr/lib64/python3.3/distutils/
shared_lib_extension = None   -> default for abstract class
* At /usr/lib64/python3.3/distutils/
shared_lib_extension = ".so"  -> this is the correct value
* In function 
/usr/lib64/python3.3/distutils/ at customize_compiler::235
by /usr/lib64/python3.3/distutils/ at customize_compiler::235
         compiler.shared_lib_extension = so_ext
by /usr/lib64/python3.3/distutils/ at customize_compiler::194
(cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \
             get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
                             'CCSHARED', 'LDSHARED', 'SO', 'AR', 'ARFLAGS'))
by /usr/lib64/python3.3/distutils/ at get_config_vars::530
526 global _config_vars
527     if _config_vars is None:
528         func = globals().get("_init_" +  # -> = posix
529         if func:
530             func()  # -> _init_posix, populates _config_vars
by /usr/lib64/python3.3/distutils/ at _init_posix::439
435     g = {}
436     # load the installed Makefile:
437     try:
438         filename = get_makefile_filename()  # 
439         parse_makefile(filename, g)
476     global _config_vars
477     _config_vars = g  # -> _config_vars["SO"] = ""
by /usr/lib64/python3.3/config-3.3m/Makefile::122
Date User Action Args
2012-12-23 12:36:06smanisetrecipients: + smani, tarek, eric.araujo
2012-12-23 12:36:06smanisetmessageid: <>
2012-12-23 12:36:06smanilinkissue16754 messages
2012-12-23 12:36:05smanicreate