Parameter needs to be a str

Started in b23a5fdb67224cd88c6a4ca935f448de3bde7892, this finally
matches rjollos' code at http://trac-hacks.org/changeset/12956