)]}'
{"novaclient/utils.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"51ff1e098e66bac5317b51b954d22fb0e829e723","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                    data \u003d \u0027-\u0027"},{"line_number":100,"context_line":"                # \u0027\\r\u0027 would break the table, so remove it."},{"line_number":101,"context_line":"                if six.PY2 and isinstance(data, unicode):"},{"line_number":102,"context_line":"                    data \u003d str(encodeutils.safe_encode(data)"},{"line_number":103,"context_line":"                               ).replace(\"\\r\", \"\")"},{"line_number":104,"context_line":"                else:"},{"line_number":105,"context_line":"                    data \u003d str(data).replace(\"\\r\", \"\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"da85f559_413f7025","line":102,"updated":"2015-11-13 16:32:16.000000000","message":"Is there any reason we have to only do this if we\u0027re working with python 2?  As far as I can see, it would be fine to simply make this safe_encode() step the default.","commit_id":"bb16a3278584f17a3f8853b287d2c943a04ebc6a"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"d174ec2a68ec1d32b4c49c12fbe9bda470c81564","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                    data \u003d \u0027-\u0027"},{"line_number":100,"context_line":"                # \u0027\\r\u0027 would break the table, so remove it."},{"line_number":101,"context_line":"                if six.PY2 and isinstance(data, unicode):"},{"line_number":102,"context_line":"                    data \u003d str(encodeutils.safe_encode(data)"},{"line_number":103,"context_line":"                               ).replace(\"\\r\", \"\")"},{"line_number":104,"context_line":"                else:"},{"line_number":105,"context_line":"                    data \u003d str(data).replace(\"\\r\", \"\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"da85f559_f4eddb8e","line":102,"in_reply_to":"da85f559_413f7025","updated":"2015-11-16 02:00:15.000000000","message":"Thanks for your review. I have done this because in python2.6 gate job, it cannot transform  datetime type, I have to add checks for unicode, but for python3.4 gate job, \"unicode\" is not existed, and \"str\" is used instead. In order to pass both gate jobs and probably make it work on both 2.6, 2.7 and 3.4 python env, I have to do this.","commit_id":"bb16a3278584f17a3f8853b287d2c943a04ebc6a"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"dd43ea3b90c95f308aef62c533727678d10aa2bc","unresolved":false,"context_lines":[{"line_number":102,"context_line":"                    data \u003d str(encodeutils.safe_encode(data)"},{"line_number":103,"context_line":"                               ).replace(\"\\r\", \"\")"},{"line_number":104,"context_line":"                else:"},{"line_number":105,"context_line":"                    data \u003d str(data).replace(\"\\r\", \"\")"},{"line_number":106,"context_line":"                row.append(data)"},{"line_number":107,"context_line":"        pt.add_row(row)"},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"ba8a016a_2c14bef3","line":105,"updated":"2015-11-16 16:44:11.000000000","message":"I still don\u0027t see why this entire clause couldn\u0027t be converted to the single line:\n\n    data \u003d str(encodeutils.safe_encode(data)).replace(\u0027\\r\u0027, \u0027\u0027)","commit_id":"e55107d0acc0d237fd2067e3a5166c81a16d72dc"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"a7d42af74d917949576c935bcba6f781bd2ca818","unresolved":false,"context_lines":[{"line_number":102,"context_line":"                    data \u003d str(encodeutils.safe_encode(data)"},{"line_number":103,"context_line":"                               ).replace(\"\\r\", \"\")"},{"line_number":104,"context_line":"                else:"},{"line_number":105,"context_line":"                    data \u003d str(data).replace(\"\\r\", \"\")"},{"line_number":106,"context_line":"                row.append(data)"},{"line_number":107,"context_line":"        pt.add_row(row)"},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"ba8a016a_385f0274","line":105,"in_reply_to":"ba8a016a_2c14bef3","updated":"2015-11-17 01:14:49.000000000","message":"Hi, in python2.6 there is a \"datetime\" object which cannnot be transformed using encodeutils.safe_encode, so I have to make some conditions here. And in python3.4 the \"unicode\" is called \"str\" so it is totally different, so I have to again see wheter it is in python2 or python3, plus, python3 will not have this problem.","commit_id":"e55107d0acc0d237fd2067e3a5166c81a16d72dc"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"9a784df20418ee0ee305298925c45b4f8621d7d6","unresolved":false,"context_lines":[{"line_number":102,"context_line":"                    data \u003d str(encodeutils.safe_encode(data)"},{"line_number":103,"context_line":"                               ).replace(\"\\r\", \"\")"},{"line_number":104,"context_line":"                else:"},{"line_number":105,"context_line":"                    data \u003d str(data).replace(\"\\r\", \"\")"},{"line_number":106,"context_line":"                row.append(data)"},{"line_number":107,"context_line":"        pt.add_row(row)"},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"ba8a016a_e1867fda","line":105,"in_reply_to":"ba8a016a_385f0274","updated":"2015-11-17 16:55:59.000000000","message":"I don\u0027t understand your argument; applying \u0027str()\u0027 to a datetime object yields the same result in both versions of Python.  Sure, my example code above wouldn\u0027t handle that correctly, but the correct code is obvious:\n\n    data \u003d encodeutils.safe_encode(str(data)).replace(\u0027\\r\u0027, \u0027\u0027)\n\nThe result would be bytes, though, so you would then do the .decode() step illustrated on lines 114 and 115 below.\n\nAnd yes, Python 2 and Python 3 differ in what they call the unicode type, but that\u0027s why safe_encode() exists—to work around some of those differences.  See [1] for the implementation of safe_encode()…\n\n[1] https://github.com/openstack/oslo.utils/blob/master/oslo_utils/encodeutils.py#L60","commit_id":"e55107d0acc0d237fd2067e3a5166c81a16d72dc"}]}
