change str to basestring for new cherrypy (3.2)