1#!/usr/bin/env python 2 3import sys 4 5getattr(sys.stdout, "buffer", sys.stdout).write(b"a line with bad encoding: \xc2.") 6sys.stdout.flush() 7