python3: division and encode/decode fixes

2 jobs for master in 41 seconds (queued for 1 second)