)]}'
{"cliff/app.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"5cf2e520d337a46c8baf0cdf4f9fb2d4e7e8d1cb","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        encoding \u003d (getattr(sys.stdout, \u0027encoding\u0027, None) or"},{"line_number":89,"context_line":"                    encoding or"},{"line_number":90,"context_line":"                    self.DEFAULT_OUTPUT_ENCODING)"},{"line_number":91,"context_line":"        self.stdin \u003d stdin or codecs.getreader(encoding)(sys.stdin)"},{"line_number":92,"context_line":"        self.stdout \u003d stdout or self._get_stream_with_encoding(sys.stdout,"},{"line_number":93,"context_line":"                                                               encoding)"},{"line_number":94,"context_line":"        self.stderr \u003d stderr or self._get_stream_with_encoding(sys.stderr,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aca2d91_e548d92f","line":91,"updated":"2015-05-06 22:06:47.000000000","message":"If stdin is not a pipe it may already have an encoding and we should preserve that.","commit_id":"684f98c5dce17de1c896cd7ed697afc9417b9095"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"f4a9891d5d8457de09d0e34051f1b73bfe88a4c3","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                    self.DEFAULT_OUTPUT_ENCODING)"},{"line_number":91,"context_line":"        self.stdin \u003d stdin or self._get_stream_with_encoding(sys.stdin,"},{"line_number":92,"context_line":"                                                             encoding,"},{"line_number":93,"context_line":"                                                             codecs.getreader)"},{"line_number":94,"context_line":"        self.stdout \u003d stdout or self._get_stream_with_encoding(sys.stdout,"},{"line_number":95,"context_line":"                                                               encoding)"},{"line_number":96,"context_line":"        self.stderr \u003d stderr or self._get_stream_with_encoding(sys.stderr,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5afe65bd_0721929f","line":93,"updated":"2015-06-03 01:29:29.000000000","message":"I find this three-line thing much much harder to read than the code you\u0027re replacing. Lets try to get it as short and pithy as it was.","commit_id":"8799d7a832192af2647c6904907aafdf3ec84d06"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a149cb52520d83254bf011c95fad9e941d6de334","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                    self.DEFAULT_OUTPUT_ENCODING)"},{"line_number":91,"context_line":"        self.stdin \u003d stdin or self._get_stream_with_encoding(sys.stdin,"},{"line_number":92,"context_line":"                                                             encoding,"},{"line_number":93,"context_line":"                                                             codecs.getreader)"},{"line_number":94,"context_line":"        self.stdout \u003d stdout or self._get_stream_with_encoding(sys.stdout,"},{"line_number":95,"context_line":"                                                               encoding)"},{"line_number":96,"context_line":"        self.stderr \u003d stderr or self._get_stream_with_encoding(sys.stderr,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5afe65bd_55f4c685","line":93,"in_reply_to":"5afe65bd_0721929f","updated":"2015-06-03 10:53:58.000000000","message":"I don\u0027t understand what do you request. We need to wrap the stream only in case it doesn\u0027t have implicit encoding, that\u0027s why the function _get_stream_with_encoding.","commit_id":"8799d7a832192af2647c6904907aafdf3ec84d06"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"f4a9891d5d8457de09d0e34051f1b73bfe88a4c3","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        self.stderr \u003d stderr or self._get_stream_with_encoding(sys.stderr,"},{"line_number":97,"context_line":"                                                               encoding)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @staticmethod"},{"line_number":100,"context_line":"    def _get_stream_with_encoding(stream, encoding,"},{"line_number":101,"context_line":"                                  stream_getter\u003dcodecs.getwriter):"},{"line_number":102,"context_line":"        if not hasattr(stream, \u0027encoding\u0027) or stream.encoding is None:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5afe65bd_3c326511","line":99,"updated":"2015-06-03 01:29:29.000000000","message":"Since this has no class state at all - lets just make it a top level function.","commit_id":"8799d7a832192af2647c6904907aafdf3ec84d06"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a149cb52520d83254bf011c95fad9e941d6de334","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        self.stderr \u003d stderr or self._get_stream_with_encoding(sys.stderr,"},{"line_number":97,"context_line":"                                                               encoding)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @staticmethod"},{"line_number":100,"context_line":"    def _get_stream_with_encoding(stream, encoding,"},{"line_number":101,"context_line":"                                  stream_getter\u003dcodecs.getwriter):"},{"line_number":102,"context_line":"        if not hasattr(stream, \u0027encoding\u0027) or stream.encoding is None:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5afe65bd_15c40e5d","line":99,"in_reply_to":"5afe65bd_3c326511","updated":"2015-06-03 10:53:58.000000000","message":"Done","commit_id":"8799d7a832192af2647c6904907aafdf3ec84d06"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"f4a9891d5d8457de09d0e34051f1b73bfe88a4c3","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    @staticmethod"},{"line_number":100,"context_line":"    def _get_stream_with_encoding(stream, encoding,"},{"line_number":101,"context_line":"                                  stream_getter\u003dcodecs.getwriter):"},{"line_number":102,"context_line":"        if not hasattr(stream, \u0027encoding\u0027) or stream.encoding is None:"},{"line_number":103,"context_line":"            return stream_getter(encoding)(stream)"},{"line_number":104,"context_line":"        return stream"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5afe65bd_fc44cd74","line":102,"updated":"2015-06-03 01:29:29.000000000","message":"This can be more understandable as:\n\n if getattr(stream, \u0027encoding\u0027, None) is None:\n     return stream_getter(encoding)(stream)","commit_id":"8799d7a832192af2647c6904907aafdf3ec84d06"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a149cb52520d83254bf011c95fad9e941d6de334","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    @staticmethod"},{"line_number":100,"context_line":"    def _get_stream_with_encoding(stream, encoding,"},{"line_number":101,"context_line":"                                  stream_getter\u003dcodecs.getwriter):"},{"line_number":102,"context_line":"        if not hasattr(stream, \u0027encoding\u0027) or stream.encoding is None:"},{"line_number":103,"context_line":"            return stream_getter(encoding)(stream)"},{"line_number":104,"context_line":"        return stream"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5afe65bd_f5a172aa","line":102,"in_reply_to":"5afe65bd_fc44cd74","updated":"2015-06-03 10:53:58.000000000","message":"Done","commit_id":"8799d7a832192af2647c6904907aafdf3ec84d06"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"b80c6cb4e1e918960bc2d97e41db9b84588dbe7a","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                    encoding or"},{"line_number":97,"context_line":"                    self.DEFAULT_OUTPUT_ENCODING)"},{"line_number":98,"context_line":"        self.stdin \u003d stdin or _get_stream_with_encoding(sys.stdin, encoding,"},{"line_number":99,"context_line":"                                                        codecs.getreader)"},{"line_number":100,"context_line":"        self.stdout \u003d stdout or _get_stream_with_encoding(sys.stdout, encoding)"},{"line_number":101,"context_line":"        self.stderr \u003d stderr or _get_stream_with_encoding(sys.stderr, encoding)"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ba3cc151_63d17cfb","line":99,"updated":"2015-06-29 00:11:59.000000000","message":"So looking at this more closely, I think this change is broken.\n\nThe old code does this:\n - determine an encoding\n - coerce all sys.* streams to that encoding.\n - uses supplied streams as-is\n\nThe new code does this:\n - determine an encoding\n - if a stream has no encoding, switch it to the determined encoding\n\nThis means that if someone passes in one stream in CJK, one in UTF8 and one in UTF16, we\u0027ll use those streams as they are, but not if the stream passed in has no encoding.\n\nThat doesn\u0027t make sense to me.\n\nIf we\u0027re going to use supplied streams, we should let the caller decide. Its only for sys.std* that dealing with the well known failure mode of servers with bad locale settings makes sense at all.IMO anyhow.","commit_id":"2a5f2b61f4d6f982f0fb7f5a7521c5f46ee0fbe8"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"e16543f784fad53bd2b3f269defaf94b9853d9db","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                    encoding or"},{"line_number":97,"context_line":"                    self.DEFAULT_OUTPUT_ENCODING)"},{"line_number":98,"context_line":"        self.stdin \u003d stdin or _get_stream_with_encoding(sys.stdin, encoding,"},{"line_number":99,"context_line":"                                                        codecs.getreader)"},{"line_number":100,"context_line":"        self.stdout \u003d stdout or _get_stream_with_encoding(sys.stdout, encoding)"},{"line_number":101,"context_line":"        self.stderr \u003d stderr or _get_stream_with_encoding(sys.stderr, encoding)"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"fa1b9901_141fbe5b","line":99,"in_reply_to":"ba3cc151_12a53f03","updated":"2015-08-20 23:01:47.000000000","message":"python 2 disables stdout coding based on stdout - python3 does not.\n\n $ python -c \u0027import sys;print(sys.stdout.encoding)\u0027 | cat -\n None\n $ python3 -c \u0027import sys;print(sys.stdout.encoding)\u0027 | cat -\n UTF-8\n\nsimilarly stdin\n$ python -c \u0027import sys;print(sys.stdin.encoding)\u0027 \u003c /dev/null | cat -\nNone\n$ python3 -c \u0027import sys;print(sys.stdin.encoding)\u0027 \u003c /dev/null | cat -\nUTF-8\n\ntext is always text, binary is always binary - we probably want to allow binary mode programs, but thats a separate changeset.\n\nSo yeah, I guess this really boils down to \u0027boy I wish python2 would die\u0027.","commit_id":"2a5f2b61f4d6f982f0fb7f5a7521c5f46ee0fbe8"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"f3ab02ec6df7c0f0ad9377fc4ff22c7e7d8f47eb","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                    encoding or"},{"line_number":97,"context_line":"                    self.DEFAULT_OUTPUT_ENCODING)"},{"line_number":98,"context_line":"        self.stdin \u003d stdin or _get_stream_with_encoding(sys.stdin, encoding,"},{"line_number":99,"context_line":"                                                        codecs.getreader)"},{"line_number":100,"context_line":"        self.stdout \u003d stdout or _get_stream_with_encoding(sys.stdout, encoding)"},{"line_number":101,"context_line":"        self.stderr \u003d stderr or _get_stream_with_encoding(sys.stderr, encoding)"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ba3cc151_12a53f03","line":99,"in_reply_to":"ba3cc151_63d17cfb","updated":"2015-06-29 14:48:39.000000000","message":"I think the difference it a little more subtle than you\u0027re describing it (at least how I\u0027m interpreting what you wrote).\n\nA stream passed in from the caller is never touched, and I agree that\u0027s what we want.\n\nThe difference is that the default streams are only modified if they do not already have an encoding. IIRC, that might come up if the output is being piped to another program because python doesn\u0027t set the default encoding unless the output is a tty. So if Python figures out an encoding for stdout based on the tty, we use that, and if not we use the same algorithm for guessing we were using before. That feels close to what we probably want, although not necessarily \"safe\" because we don\u0027t know what encoding the receiving process might be expecting. Is there a standard for conveying that information?","commit_id":"2a5f2b61f4d6f982f0fb7f5a7521c5f46ee0fbe8"}],"cliff/tests/test_app.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"04732150e9c46e9d2d0737b659800de9f4d72a69","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# -*- encoding: utf-8 -*-"},{"line_number":2,"context_line":"from argparse import ArgumentError"},{"line_number":3,"context_line":"import codecs"},{"line_number":4,"context_line":"import six"},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"import mock"},{"line_number":7,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9af37de9_76c83475","line":4,"updated":"2015-05-11 12:10:52.000000000","message":"vrrr","commit_id":"34c7ee19e6c850e7d8aabf8041fba91e8049deb4"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"f4a9891d5d8457de09d0e34051f1b73bfe88a4c3","unresolved":false,"context_lines":[{"line_number":234,"context_line":""},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"def _test_input_encoding(use_encoding):"},{"line_number":237,"context_line":"    data \u003d six.b(\u0027\\xc3\\xa9\u0027)"},{"line_number":238,"context_line":"    u_data \u003d data.decode(\u0027utf-8\u0027)"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    class MyApp(App):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5afe65bd_a764fee4","line":237,"updated":"2015-06-03 01:29:29.000000000","message":"No need to use six for this - b\u0027foo\u0027 is valid in 2.6,2.7,3.3 and above (and maybe 3.2 but I don\u0027t remember).","commit_id":"8799d7a832192af2647c6904907aafdf3ec84d06"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a149cb52520d83254bf011c95fad9e941d6de334","unresolved":false,"context_lines":[{"line_number":234,"context_line":""},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"def _test_input_encoding(use_encoding):"},{"line_number":237,"context_line":"    data \u003d six.b(\u0027\\xc3\\xa9\u0027)"},{"line_number":238,"context_line":"    u_data \u003d data.decode(\u0027utf-8\u0027)"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    class MyApp(App):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5afe65bd_75a462a5","line":237,"in_reply_to":"5afe65bd_a764fee4","updated":"2015-06-03 10:53:58.000000000","message":"Done","commit_id":"8799d7a832192af2647c6904907aafdf3ec84d06"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"f4a9891d5d8457de09d0e34051f1b73bfe88a4c3","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                version\u003d\u00270.1\u0027,"},{"line_number":245,"context_line":"                command_manager\u003dCommandManager(\u0027tests\u0027),"},{"line_number":246,"context_line":"            )"},{"line_number":247,"context_line":"    stdin \u003d six.BytesIO(data)"},{"line_number":248,"context_line":"    if use_encoding:"},{"line_number":249,"context_line":"        stdin \u003d codecs.getreader(\u0027utf-8\u0027)(stdin)"},{"line_number":250,"context_line":"        stdin.encoding \u003d \u0027utf-8\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"5afe65bd_a73d1ebd","line":247,"updated":"2015-06-03 01:29:29.000000000","message":"There\u0027s no need to use six for this: io.BytesIO is present in 2.6 and up, as io.BytesIO.","commit_id":"8799d7a832192af2647c6904907aafdf3ec84d06"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a149cb52520d83254bf011c95fad9e941d6de334","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                version\u003d\u00270.1\u0027,"},{"line_number":245,"context_line":"                command_manager\u003dCommandManager(\u0027tests\u0027),"},{"line_number":246,"context_line":"            )"},{"line_number":247,"context_line":"    stdin \u003d six.BytesIO(data)"},{"line_number":248,"context_line":"    if use_encoding:"},{"line_number":249,"context_line":"        stdin \u003d codecs.getreader(\u0027utf-8\u0027)(stdin)"},{"line_number":250,"context_line":"        stdin.encoding \u003d \u0027utf-8\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"5afe65bd_35aeea85","line":247,"in_reply_to":"5afe65bd_a73d1ebd","updated":"2015-06-03 10:53:58.000000000","message":"Done","commit_id":"8799d7a832192af2647c6904907aafdf3ec84d06"}]}
