python test for bad byte stream