Conditionally decoding input so that both Pythons are happy