def write(self, string):
        if isinstance(string, unicode):
            string = string.encode(sys.__stdout__.encoding)
        sys.__stdout__.write(string)
A wrapper for self.stdout.write to avoid problems with unicode:
dataset/ETHPy150Open Miserlou/OpenWatch/openwatch/recordings/management/commands/organize_recordings.py/Command.write