core: fix python-2.6 compatibility in decode()

Change-Id: Ia8074b2051e259d892f8ae771389e065bf072f7a
Signed-off-by: Alon Bar-Lev <alonbl@redhat.com>