[Distutils] Issue with method _darwin_compiler_fixup in distutils/unixcompiler.py

Sanath Kumar dayanandasaraswati at gmail.com
Sat Feb 1 07:42:15 CET 2014


Hello all,

When compiling MySQL-python module on Mac OSX Mavericks, I executed the
command "python setup.py build" and got an error when compiling the C
extension. In the output from build command, I see that it has tried
running the C compiler with the following command:

/ A p p l i c a t i o n s / X c o d e . a p p / C o n t e n t s / D e v e l
o p e r / T o o l c h a i n s / X c o d e D e f a u l t . x c t o o l c h a
i n / u s r / b i n / c l a n g   - f n o - s t r i c t - a l i a s i n g
- f n o - c o m m o n   - d y n a m i c   - a r c h   x 8 6 _ 6 4   - a r c
h   i 3 8 6   - g   - O s   - p i p e   - f n o - c o m m o n   - f n o - s
t r i c t - a l i a s i n g   - f w r a p v   - m n o - f u s e d - m a d d
  - D E N A B L E _ D T R A C E   - D M A C O S X   - D N D E B U G   - W a
l l   - W s t r i c t - p r o t o t y p e s   - W s h o r t e n - 6 4 - t o
- 3 2   - D N D E B U G   - g   - f w r a p v   - O s   - W a l l   - W s t
r i c t - p r o t o t y p e s   - D E N A B L E _ D T R A C E   - a r c h
x 8 6 _ 6 4   - a r c h   i 3 8 6   - p i p e
-Dversion_info=(1,2,4,'beta',4) -D__version__=1.2.4b4
-I/usr/local/Cellar/mysql/5.6.13/include
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -Os -g
-fno-strict-aliasing


This command is obviously malformed. I tracked down the root cause to be
the following line of code in _darwin_compiler_fixup method in
distutils/unixcompiler.py function:

       compiler_so = list(compiler_so)

Reading the code, this function expects the input parameter 'compiler_so'
to be a list, but the actual input in my case was a string. Therefore
instead of splitting the words of this sentence, it created a list with
each character in the sentence. Changing to the following fixes the problem:

      compiler_so = compiler_so.split()


This seems like a legit bug to me. Any thoughts?


Thanks,

Sanath
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20140131/f6f7f238/attachment-0001.html>


More information about the Distutils-SIG mailing list