This was broken in 9.0 while improving plpython's conversion behavior for bytea and boolean. Per bug report from maizi.