The username variable appears to not be used if you follow the function calls. But, your change is correct; this was an oversight related to python2/3 and the new version of Tornado conversions.