Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

            def get_stdout_text_writer():
        # In python3, all the sys.stdout/sys.stderr streams are in text
        # mode.  This means they expect unicode, and will encode the
        # unicode automatically before actually writing to stdout/stderr.
        # In python2, that's not the case.  In order to provide a consistent
        # interface, we can create a wrapper around sys.stdout that will take
        # unicode, and automatically encode it to the preferred encoding.
        # That way consumers can just call get_stdout_text_writer() and write
        # unicode to the returned stream.  Note that get_stdout_text_writer
        # just returns sys.stdout in the PY3 section above because python3
        # handles this.
        return codecs.getwriter(locale.getpreferredencoding())(sys.stdout)
        


src/a/w/aws-cli-HEAD/awscli/formatter.py   aws-cli(Download)
            # encoding is not None.  In this case we'll default
            # to utf-8.
            return compat.get_stdout_text_writer()
        else:
            return sys.stdout

src/a/w/awscli-1.3.8/awscli/formatter.py   awscli(Download)
            # encoding is not None.  In this case we'll default
            # to utf-8.
            return compat.get_stdout_text_writer()
        else:
            return sys.stdout