webmynd/build-tools — Issue #29: Builds dont run in Python < 2.6.6
Author: ajessup
Created: 2011-11-20 03:35:10+00:00
State: open

Running the `wm-dev-build` command fails when the python interpreter is older than 2.6.6 (such as on Mac OS Snow Leopard which comes with Python 2.6.1). The error returned looks something like:

[ ERROR] generate() keywords must be strings while running copy_files((), {'to': 'development/android/assets/src', 'from': 'src'})

Build aborts and the extension is not generated.

Some digging revealed that the problem is in the file `PROJECT_DIR/.template/generate_dynamic/utils.py` file, specifically render_string() calls `tmpl.generate(**config).render('text')` with a dictionary of unicode elements. This is acceptable in later versions of python, but not in versions earlier than 2.6.6.

The solution is to recursively convert all elements of the `config` dictionary to strings first.

Since the source for `PROJECT_DIR/.template` directory doesn't appear in any public git repo, I'll try and submit a patch that outlines the fix.