backport code for issue #43
python3 compatibility code for i3status tmp config generation