Use as_text to fix syntax error discovered in Python 3.2 (raspberry pi)