{"action":"created","issue":{"url":"https://api.github.com/repos/google/protobuf/issues/4928","repository_url":"https://api.github.com/repos/google/protobuf","labels_url":"https://api.github.com/repos/google/protobuf/issues/4928/labels{/name}","comments_url":"https://api.github.com/repos/google/protobuf/issues/4928/comments","events_url":"https://api.github.com/repos/google/protobuf/issues/4928/events","html_url":"https://github.com/google/protobuf/issues/4928","id":341687500,"node_id":"MDU6SXNzdWUzNDE2ODc1MDA=","number":4928,"title":"Python3.7: MergeFrom() throws when trying to extend list of SInt32 with int ","user":{"login":"kunalspathak","id":12488060,"node_id":"MDQ6VXNlcjEyNDg4MDYw","avatar_url":"https://avatars0.githubusercontent.com/u/12488060?v=4","gravatar_id":"","url":"https://api.github.com/users/kunalspathak","html_url":"https://github.com/kunalspathak","followers_url":"https://api.github.com/users/kunalspathak/followers","following_url":"https://api.github.com/users/kunalspathak/following{/other_user}","gists_url":"https://api.github.com/users/kunalspathak/gists{/gist_id}","starred_url":"https://api.github.com/users/kunalspathak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kunalspathak/subscriptions","organizations_url":"https://api.github.com/users/kunalspathak/orgs","repos_url":"https://api.github.com/users/kunalspathak/repos","events_url":"https://api.github.com/users/kunalspathak/events{/privacy}","received_events_url":"https://api.github.com/users/kunalspathak/received_events","type":"User","site_admin":false},"labels":[{"id":124699531,"node_id":"MDU6TGFiZWwxMjQ2OTk1MzE=","url":"https://api.github.com/repos/google/protobuf/labels/bug","name":"bug","color":"fc2929","default":true},{"id":250677130,"node_id":"MDU6TGFiZWwyNTA2NzcxMzA=","url":"https://api.github.com/repos/google/protobuf/labels/python","name":"python","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":{"login":"anandolee","id":11618033,"node_id":"MDQ6VXNlcjExNjE4MDMz","avatar_url":"https://avatars0.githubusercontent.com/u/11618033?v=4","gravatar_id":"","url":"https://api.github.com/users/anandolee","html_url":"https://github.com/anandolee","followers_url":"https://api.github.com/users/anandolee/followers","following_url":"https://api.github.com/users/anandolee/following{/other_user}","gists_url":"https://api.github.com/users/anandolee/gists{/gist_id}","starred_url":"https://api.github.com/users/anandolee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anandolee/subscriptions","organizations_url":"https://api.github.com/users/anandolee/orgs","repos_url":"https://api.github.com/users/anandolee/repos","events_url":"https://api.github.com/users/anandolee/events{/privacy}","received_events_url":"https://api.github.com/users/anandolee/received_events","type":"User","site_admin":false},"assignees":[{"login":"anandolee","id":11618033,"node_id":"MDQ6VXNlcjExNjE4MDMz","avatar_url":"https://avatars0.githubusercontent.com/u/11618033?v=4","gravatar_id":"","url":"https://api.github.com/users/anandolee","html_url":"https://github.com/anandolee","followers_url":"https://api.github.com/users/anandolee/followers","following_url":"https://api.github.com/users/anandolee/following{/other_user}","gists_url":"https://api.github.com/users/anandolee/gists{/gist_id}","starred_url":"https://api.github.com/users/anandolee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anandolee/subscriptions","organizations_url":"https://api.github.com/users/anandolee/orgs","repos_url":"https://api.github.com/users/anandolee/repos","events_url":"https://api.github.com/users/anandolee/events{/privacy}","received_events_url":"https://api.github.com/users/anandolee/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-07-16T21:35:34Z","updated_at":"2018-07-19T19:40:28Z","closed_at":null,"author_association":"NONE","body":"**What version of protobuf and what language are you using?**\r\nVersion: v3.6.0\r\nLanguage: Python\r\n\r\n**What operating system (Linux, Windows, ...) and version?**\r\nWindows\r\n\r\n**What runtime / compiler are you using (e.g., python version or gcc version)**\r\npython 3.7\r\n\r\n**What did you do?**\r\nSteps to reproduce the behavior:\r\n\r\nI have a protobuf message \r\n```protobuf\r\nmessage List_sint32 {\r\n    repeated sint32 Value = 1;\r\n}\r\n```\r\nI generate the python code using `protoc.exe`. Here is how i use from Python\r\n\r\n```python\r\nmy_list = [1,2,3]\r\na = List_sint32 ()\r\na.Value.extend(my_list)\r\n```\r\n\r\n**What did you expect to see**\r\n\r\nWith `python 3.6` this passes and expect to pass on `python 3.7` as well.\r\n\r\n**What did you see instead?**\r\nSee below failure\r\n```cmd\r\nFile \"/a.py\", line 30, in _convert_to_pb_2\r\nprotobuf_object.Value.extend(python_object)\r\nFile \"/Users/prose/Library/Python/3.7/lib/python/site-packages/google/protobuf/internal/containers.py\", line 389, in extend\r\nnew_element.MergeFrom(message)\r\nFile \"/Users/prose/Library/Python/3.7/lib/python/site-packages/google/protobuf/internal/python_message.py\", line 1230, in MergeFrom\r\n'expected %s got %s.' % (cls.__name__, msg.__class__.__name__))\r\nTypeError: Parameter to MergeFrom() must be instance of same class: expected SInt32 got int.\r\n```\r\n\r\n\r\n\r\nMake sure you include information that can help us debug (full error message, exception listing, stack trace, logs).\r\n\r\n**Anything else we should know about your project / environment**\r\n"},"comment":{"url":"https://api.github.com/repos/google/protobuf/issues/comments/406391112","html_url":"https://github.com/google/protobuf/issues/4928#issuecomment-406391112","issue_url":"https://api.github.com/repos/google/protobuf/issues/4928","id":406391112,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNjM5MTExMg==","user":{"login":"anandolee","id":11618033,"node_id":"MDQ6VXNlcjExNjE4MDMz","avatar_url":"https://avatars0.githubusercontent.com/u/11618033?v=4","gravatar_id":"","url":"https://api.github.com/users/anandolee","html_url":"https://github.com/anandolee","followers_url":"https://api.github.com/users/anandolee/followers","following_url":"https://api.github.com/users/anandolee/following{/other_user}","gists_url":"https://api.github.com/users/anandolee/gists{/gist_id}","starred_url":"https://api.github.com/users/anandolee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anandolee/subscriptions","organizations_url":"https://api.github.com/users/anandolee/orgs","repos_url":"https://api.github.com/users/anandolee/repos","events_url":"https://api.github.com/users/anandolee/events{/privacy}","received_events_url":"https://api.github.com/users/anandolee/received_events","type":"User","site_admin":false},"created_at":"2018-07-19T19:40:28Z","updated_at":"2018-07-19T19:40:28Z","author_association":"CONTRIBUTOR","body":"\r\n\r\n```\r\nFile \"/a.py\", line 30, in _convert_to_pb_2\r\nprotobuf_object.Value.extend(python_object)\r\n```\r\nDo you know why it is not a.Value.extend(my_list) as in your example code?\r\n\r\n\r\n```\r\nFile \"/Users/prose/Library/Python/3.7/lib/python/site-packages/google/protobuf/internal/containers.py\", line 389, in extend new_element.MergeFrom(message)   \r\n```\r\nIt is complaining for repeated composite field, but 'repeated sint32 Value = 1;' is a repeated scalar field.\r\n\r\n\r\n```\r\nexpected SInt32\r\n```\r\nSeems like there's a message named SInt32, and 'repeated SInt32 Value = 1;\"  is used in .proto file somewhere instead of sint32. Can you double check that.\r\nOr protobuf with Python 3.7 wrongly recognize sint32 with message type of SInt32"}}
{"actor":{"display_login":"anandolee"}}