id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux 19273,PostgreSQL 9.0 cache db backend doesn't work on py3,Anssi Kääriäinen,nobody,"PostgreSQL + 9.0 + cache db backend doesn't work on python 3. The reason for this is that base64 encoding a string returns bytes on py3, PostgreSQL 9.0 has hex output type conversion on by default for byte values, and the column we are inserting into is TEXT. So, psycopg2 gets a string ""abc"" and converts this to ""hex encoding"" ('\x616263'). However as the column is of type text this is inserted directly as string '\x616263' into the column. When we fetch it back we get a string containing '\x616263', not bytes containing ""abc"". This results in exception when trying to base64 decode the value. On PostgreSQL versions earlier than 9.0 the default byte encoding style was 'encoded', which means we insert the ""abc"" as string 'abc' and everything works. The solution is to insert the string ""abc"" into the DB, not bytes('abc'). Will post a patch soon...",Bug,closed,Core (Cache system),1.5-alpha-1,Release blocker,fixed,,,Accepted,1,0,0,0,0,0