<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - llvm-lit fails to run on /test if Python >= 2.7.5"
   href="http://llvm.org/bugs/show_bug.cgi?id=21417">21417</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llvm-lit fails to run on /test if Python >= 2.7.5
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>pablo.barrio@arm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This bug has been introduced in revision r220900. See possible solution at the
end of the report.

Using Python version 2.7.5+ or higher (I checked with 2.7.5+ and 2.7.8), trying
to run llvm-lit with directory /test fails with the following error message:

llvm-lit: TestingConfig.py:108: fatal: unable to parse config file
'test/lit.cfg', traceback: Traceback (most recent call last):
  File "utils/lit/lit/TestingConfig.py", line 95, in load_from_path
    exec(compile(data, path, 'exec'), cfg_globals, None)
  File "test/lit.cfg", line 104, in <module>
    llvm_ocaml_lib = os.path.join(getattr(config, 'llvm_lib_dir', None),
'ocaml')
  File "/usr/lib/python2.7/posixpath.py", line 77, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'


This is because in test/lit.cfg:

   llvm_ocaml_lib = os.path.join(getattr(config, 'llvm_lib_dir', None),
'ocaml')

None is specified as default for getattr(). I could not reproduce the bug with
Python version 2.7.3. I replaced None by the empty string ('') in my boxes.
This fixed the errors for all Python versions. Another (possibly better) option
would be to error-check the output of getattr() before passing it to
os.path.join().</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>