Fix redis key formatting to work with Python 3