dev-cafe / autocmake

CMake plugin composer.
http://autocmake.org
BSD 3-Clause "New" or "Revised" License
42 stars 18 forks source link

fix python failure on my Linux cluster #154

Closed miroi closed 8 years ago

miroi commented 8 years ago

On Linux login 2.6.32-504.23.4.el6.x86_64 #1 SMP Tue Jun 9 11:55:03 CDT 2015 x86_64 x86_64 x86_64 GNU/Linux

Python 2.6.6

to fix

====================================================================== FAILURES ======================================================================
______________________________________________________________ test_python_libs_custom _______________________________________________________________

    def test_python_libs_custom():
        python_executable = sys.executable
        print python_executable
>       configure_build_and_exe('python_libs_custom', 'python setup --cxx=g++ --python={}'.format(python_executable))
E       ValueError: zero length field name in format

test.py:176: ValueError
bast commented 8 years ago

Hi Miro the problem here is not the print. The question is why python_executable is empty. So you need to debug on that end.

miroi commented 8 years ago

Hi,

control printout showns nonzero _pythonexecutable, problem seems to be with .format(python_executable)).

The fix I am proposing is working on this cluster.

>       configure_build_and_exe('python_libs_custom', 'python setup --cxx=g++ --python={}'.format(python_executable))
E       ValueError: zero length field name in format

test.py:177: ValueError
---------------------------------------------------------------- Captured stdout call ------------------------------------------------------
/usr/bin/python <---- Control printout
/usr/bin/python
=================================================== 17 tests deselected by '-kpython_libs_custom' ==========================================
bast commented 8 years ago

What Python version do you have?

miroi commented 8 years ago

Python 2.6.6

bast commented 8 years ago

And you are right the problem is not empty python_executable. I was too quick on that one. And I think we decided to require Python >= 2.7: http://autocmake.readthedocs.org/en/latest/general/requirements.html

I think this is a problem with Python < 2.7: http://stackoverflow.com/questions/5446964/valueerror-zero-length-field-name-in-format-error-in-python-3-0-3-1-3-2