)]}'
{"nova/virt/libvirt/driver.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"785d7b05b90f66f3e379931f77468a689eae99bf","unresolved":false,"context_lines":[{"line_number":687,"context_line":"        # Because dest might be of type unicode, here we might return value of"},{"line_number":688,"context_line":"        # unicode type which is not acceptable by libvirt, so let\u0027s convert it"},{"line_number":689,"context_line":"        # explicitly back to string"},{"line_number":690,"context_line":"        return uri and str(uri)"},{"line_number":691,"context_line":""},{"line_number":692,"context_line":"    def instance_exists(self, instance):"},{"line_number":693,"context_line":"        \"\"\"Efficient override of base instance_exists method.\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a74a57a_73f6f78f","line":690,"range":{"start_line":690,"start_character":23,"end_line":690,"end_character":31},"updated":"2016-11-29 10:28:34.000000000","message":"AFAIR, str(mystring) returns an unicode for Python3 so that doesn\u0027t fix your problem once Nova will begin supporting Py3 (possibly at the end of this cycle, given it\u0027s an OpenStack TC goal).\n\nAlso, given Python2 supports ASCII encoding by default, you would like to encode your string first by UTF-8 because if not, you would get an Unicode exception.\n\nEvidence here : \nhttp://paste.openstack.org/show/590771/\n\nAs you can see above, that\u0027s funky because the behaviour is very different. So, if we say that we would return an UTF-8 encoded bytestring for Python2, we should have a different usage for Python3, nope?\n\nTo be honest, my biggest question should rather be : what is the string type (and how encoded) that the libvirt API is supporting, at least the python binding ?","commit_id":"999ee13f70cd04b8994ef2e18475192d7f19d531"},{"author":{"_account_id":12299,"name":"Paweł Koniszewski","email":"pawel.koniszewski@gmail.com","username":"pawel.koniszewski"},"change_message_id":"2d557877c3837f222d71c2203bb36d27f6884ab7","unresolved":false,"context_lines":[{"line_number":687,"context_line":"        # Because dest might be of type unicode, here we might return value of"},{"line_number":688,"context_line":"        # unicode type which is not acceptable by libvirt, so let\u0027s convert it"},{"line_number":689,"context_line":"        # explicitly back to string"},{"line_number":690,"context_line":"        return uri and str(uri)"},{"line_number":691,"context_line":""},{"line_number":692,"context_line":"    def instance_exists(self, instance):"},{"line_number":693,"context_line":"        \"\"\"Efficient override of base instance_exists method.\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a74a57a_f8b3ade7","line":690,"range":{"start_line":690,"start_character":23,"end_line":690,"end_character":31},"in_reply_to":"5a74a57a_73f6f78f","updated":"2016-11-29 16:15:58.000000000","message":"Changed the comment a bit to reflect why this piece of code is OK. It might look like it is not compatible between Python 2.7 and Python 3.x, but due to different validation based on Python version this piece of code is compatible. This is because when Python 2.7 is in use libvirt python binding validates whether uri is a string, but when Python 3.x is in use libvirt python binding validates whether uri is a unicode:\n\nhttps://github.com/libvirt/libvirt-python/blob/a03d782b3e19cb9b4681783ec1f6c88615128627/libvirt-utils.h#L142-L146","commit_id":"999ee13f70cd04b8994ef2e18475192d7f19d531"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"605813237333125449f2ba3c86068c8f5e80bc06","unresolved":false,"context_lines":[{"line_number":687,"context_line":"        # Because dest might be of type unicode, here we might return value of"},{"line_number":688,"context_line":"        # unicode type which is not acceptable by libvirt, so let\u0027s convert it"},{"line_number":689,"context_line":"        # explicitly back to string"},{"line_number":690,"context_line":"        return uri and str(uri)"},{"line_number":691,"context_line":""},{"line_number":692,"context_line":"    def instance_exists(self, instance):"},{"line_number":693,"context_line":"        \"\"\"Efficient override of base instance_exists method.\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a74a57a_c8a27b9a","line":690,"range":{"start_line":690,"start_character":23,"end_line":690,"end_character":31},"in_reply_to":"5a74a57a_f8b3ade7","updated":"2016-11-30 09:21:25.000000000","message":"Yeah, that\u0027s a bit terrible that libvirt accepts two different types between python versions, but okay...","commit_id":"999ee13f70cd04b8994ef2e18475192d7f19d531"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"7d0cb1b1340fb0c94d3e05d9fd81527a220ab059","unresolved":false,"context_lines":[{"line_number":700,"context_line":"        # binding when Python 2.7 is in use, so let\u0027s convert it explicitly"},{"line_number":701,"context_line":"        # back to string. When Python 3.x is in use, libvirt python binding"},{"line_number":702,"context_line":"        # accepts unicode type so it is completely fine to do a no-op str(uri)"},{"line_number":703,"context_line":"        # conversion which will return value of type unicode."},{"line_number":704,"context_line":"        return uri and str(uri)"},{"line_number":705,"context_line":""},{"line_number":706,"context_line":"    def instance_exists(self, instance):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a74a57a_88b5e37f","line":703,"updated":"2016-11-30 09:30:52.000000000","message":"Like I said in PS1, that looks terrible to depend on something external, but okay...","commit_id":"90f5a727e98a59c648c0dc4222050857d59edab2"}]}
