)]}'
{"oslo_config/types.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"e192afbd7cdedca1d51f987b81671006da89972d","unresolved":false,"context_lines":[{"line_number":554,"context_line":"    def wrapper(self, address):"},{"line_number":555,"context_line":"        # ipaddress is a py3 backport so must strictly use a text object"},{"line_number":556,"context_line":"        if not isinstance(address, six.text_type):"},{"line_number":557,"context_line":"            address \u003d address.decode(\u0027utf-8\u0027)"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"        return f(self, address)"},{"line_number":560,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_119d3766","line":557,"updated":"2016-04-26 13:36:41.000000000","message":"Do we support config files in any other encodings? Shouldn\u0027t this be handled at the point where the file is read? Or is this just for defaults embedded in source code?","commit_id":"f83837b9d67e34e832a8bec2fb3ba392d96dc6f5"},{"author":{"_account_id":10035,"name":"greghaynes","email":"greg@greghaynes.net","username":"greghaynes"},"change_message_id":"784f818543fc0135e5304a931815c4d32d3442d9","unresolved":false,"context_lines":[{"line_number":554,"context_line":"    def wrapper(self, address):"},{"line_number":555,"context_line":"        # ipaddress is a py3 backport so must strictly use a text object"},{"line_number":556,"context_line":"        if not isinstance(address, six.text_type):"},{"line_number":557,"context_line":"            address \u003d address.decode(\u0027utf-8\u0027)"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"        return f(self, address)"},{"line_number":560,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_9e0e6f8a","line":557,"in_reply_to":"1a122d0e_119d3766","updated":"2016-04-26 15:32:50.000000000","message":"Good point - It looks like we dont allow specifying a locale anywhere so we are going to rely on the default python locale. Therefore this should be locale.getpreferredencoding(), not UTF-8.","commit_id":"f83837b9d67e34e832a8bec2fb3ba392d96dc6f5"},{"author":{"_account_id":10035,"name":"greghaynes","email":"greg@greghaynes.net","username":"greghaynes"},"change_message_id":"7cea71e3ee8e9b4824026d77a919ceb09b30111b","unresolved":false,"context_lines":[{"line_number":554,"context_line":"    def wrapper(self, address):"},{"line_number":555,"context_line":"        # ipaddress is a py3 backport so must strictly use a text object"},{"line_number":556,"context_line":"        if not isinstance(address, six.text_type):"},{"line_number":557,"context_line":"            address \u003d address.decode(\u0027utf-8\u0027)"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"        return f(self, address)"},{"line_number":560,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_d7f6808f","line":557,"in_reply_to":"1a122d0e_616f1c2b","updated":"2016-05-02 16:15:45.000000000","message":"Ah, I missed the bytes coersion. So, address here will *always* be non-unicode due to that.\n\nUnless we have some kind of convention that our configtype internal values should always be non-unicode I think we should change line 592 to \"value \u003d value.decode(\u0027ascii\u0027) if not isinstance(value, unicode)\" and then remove the decode from here.\n\n\nReasoning:\nIn IPAddress.__call__, value will be non-unicode for every case except when a default value with type unicode is specified in python (a non-unicode default value will pass through and our ConfigParser seems to always give us non-unicode). In the case where we got unicode as a default value I think we want to let it pass through (rather than try to encode it in ascii, which is what str(value) will do, and then decode it from utf-8). For the other cases we shouldn\u0027t need to support decoding non-ascii chars for an IP address, so decode(\u0027ascii\u0027) is reasonable. Also, it sounds like supporting raw bytes isn\u0027t something we want (and I agree).","commit_id":"f83837b9d67e34e832a8bec2fb3ba392d96dc6f5"},{"author":{"_account_id":10035,"name":"greghaynes","email":"greg@greghaynes.net","username":"greghaynes"},"change_message_id":"ea194ff4308834fed7d43624479b033fd2bf2aa9","unresolved":false,"context_lines":[{"line_number":554,"context_line":"    def wrapper(self, address):"},{"line_number":555,"context_line":"        # ipaddress is a py3 backport so must strictly use a text object"},{"line_number":556,"context_line":"        if not isinstance(address, six.text_type):"},{"line_number":557,"context_line":"            address \u003d address.decode(\u0027utf-8\u0027)"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"        return f(self, address)"},{"line_number":560,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_e1a8a38e","line":557,"in_reply_to":"1a122d0e_8f847b0b","updated":"2016-04-26 19:19:47.000000000","message":"I am just basing that on the fact that the iniparser in oslo.cfg is using open with no arguments so it will be using  locale.getpreferredencoding() behind the scenes. I assume we would want this to do the same as the rest of the config file decoding...","commit_id":"f83837b9d67e34e832a8bec2fb3ba392d96dc6f5"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"fd8f30f43252c6e37dec5e1f923d79fb52d4d295","unresolved":false,"context_lines":[{"line_number":554,"context_line":"    def wrapper(self, address):"},{"line_number":555,"context_line":"        # ipaddress is a py3 backport so must strictly use a text object"},{"line_number":556,"context_line":"        if not isinstance(address, six.text_type):"},{"line_number":557,"context_line":"            address \u003d address.decode(\u0027utf-8\u0027)"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"        return f(self, address)"},{"line_number":560,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_8f847b0b","line":557,"in_reply_to":"1a122d0e_9e0e6f8a","updated":"2016-04-26 17:15:46.000000000","message":"I honestly don\u0027t know and you would be the person i would come to to ask :) \n\nDoes locale.getpreferredencoding() work? Ideally here we would probably do oslo_utils.encodeutils.safe_decode() but i don\u0027t know if we want to add that dependency.","commit_id":"f83837b9d67e34e832a8bec2fb3ba392d96dc6f5"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"c9397ebdf834123d37a64ad8897ab5d1b7efd32f","unresolved":false,"context_lines":[{"line_number":554,"context_line":"    def wrapper(self, address):"},{"line_number":555,"context_line":"        # ipaddress is a py3 backport so must strictly use a text object"},{"line_number":556,"context_line":"        if not isinstance(address, six.text_type):"},{"line_number":557,"context_line":"            address \u003d address.decode(\u0027utf-8\u0027)"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"        return f(self, address)"},{"line_number":560,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_e0ffc6ff","line":557,"in_reply_to":"1a122d0e_b27ef767","updated":"2016-04-28 15:13:33.000000000","message":"The reason for the decode is because the module is a py3 backport and if you pass in a str/bytes it tries to decode the ip as 4 bytes. Given that __call__ enforces str(value) (which maybe we should fix as well) it\u0027s safe to assume that people are always passing string IP addresses so decoding should be safe.\n\nI don\u0027t have the experience with encodings to pick utf-8 vs locale preferred.","commit_id":"f83837b9d67e34e832a8bec2fb3ba392d96dc6f5"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"ebff9a83213a0a91bf87ab1fa9b7acefac4b375b","unresolved":false,"context_lines":[{"line_number":554,"context_line":"    def wrapper(self, address):"},{"line_number":555,"context_line":"        # ipaddress is a py3 backport so must strictly use a text object"},{"line_number":556,"context_line":"        if not isinstance(address, six.text_type):"},{"line_number":557,"context_line":"            address \u003d address.decode(\u0027utf-8\u0027)"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"        return f(self, address)"},{"line_number":560,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_616f1c2b","line":557,"in_reply_to":"1a122d0e_da79cac9","updated":"2016-04-29 14:23:20.000000000","message":"Actual bytes, link an array of 4 (ipv4) bytes from 0-255 i would think never. I don\u0027t see how you would input that in any realistic way. I also don\u0027t think we support that from the old netaddr way either.\n\nPython 2 non-unicode we will receive almost certainly as we str() cast the value below in __call__ and this triggers the bytes handler.","commit_id":"f83837b9d67e34e832a8bec2fb3ba392d96dc6f5"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"8b25b0c1c123765050aec4023ab8a65997dfd238","unresolved":false,"context_lines":[{"line_number":554,"context_line":"    def wrapper(self, address):"},{"line_number":555,"context_line":"        # ipaddress is a py3 backport so must strictly use a text object"},{"line_number":556,"context_line":"        if not isinstance(address, six.text_type):"},{"line_number":557,"context_line":"            address \u003d address.decode(\u0027utf-8\u0027)"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"        return f(self, address)"},{"line_number":560,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_da79cac9","line":557,"in_reply_to":"1a122d0e_e0ffc6ff","updated":"2016-04-28 20:34:36.000000000","message":"Right, the question is under what circumstances are we likely to see a byte string?","commit_id":"f83837b9d67e34e832a8bec2fb3ba392d96dc6f5"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"ce12d7315c3baa777482922645f49cd1f331cabd","unresolved":false,"context_lines":[{"line_number":554,"context_line":"    def wrapper(self, address):"},{"line_number":555,"context_line":"        # ipaddress is a py3 backport so must strictly use a text object"},{"line_number":556,"context_line":"        if not isinstance(address, six.text_type):"},{"line_number":557,"context_line":"            address \u003d address.decode(\u0027utf-8\u0027)"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"        return f(self, address)"},{"line_number":560,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_b27ef767","line":557,"in_reply_to":"1a122d0e_e1a8a38e","updated":"2016-04-26 20:59:22.000000000","message":"Option values come from 2 places, embedded in code and in the INI file. We should fix the INI file reading if it\u0027s not dealing with the encoding, but that\u0027s a separate patch. I assumed the reason for having the decode here was because of values in code files that don\u0027t have an encoding declared, and in those cases I think utf-8 probably does work fine (it depends on the original source file, not the environment variable).","commit_id":"f83837b9d67e34e832a8bec2fb3ba392d96dc6f5"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"ebff9a83213a0a91bf87ab1fa9b7acefac4b375b","unresolved":false,"context_lines":[{"line_number":589,"context_line":"            raise TypeError(\"%s is not a valid IP version.\" % version)"},{"line_number":590,"context_line":""},{"line_number":591,"context_line":"    def __call__(self, value):"},{"line_number":592,"context_line":"        value \u003d str(value)"},{"line_number":593,"context_line":"        if not value:"},{"line_number":594,"context_line":"            raise ValueError(\"IP address cannot be an empty string\")"},{"line_number":595,"context_line":"        self.version_checker(value)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_81bd18b3","line":592,"updated":"2016-04-29 14:23:20.000000000","message":"we str cast here.","commit_id":"f83837b9d67e34e832a8bec2fb3ba392d96dc6f5"}]}
