{"action":"created","issue":{"url":"https://api.github.com/repos/google/flatbuffers/issues/1741","labels_url":"https://api.github.com/repos/google/flatbuffers/issues/1741/labels{/name}","comments_url":"https://api.github.com/repos/google/flatbuffers/issues/1741/comments","events_url":"https://api.github.com/repos/google/flatbuffers/issues/1741/events","html_url":"https://github.com/google/flatbuffers/issues/1741","id":121104906,"number":1741,"title":"Compatibility issue with python2.7.2","user":{"login":"faizanrashid","id":4956201,"avatar_url":"https://avatars.githubusercontent.com/u/4956201?v=3","gravatar_id":"","url":"https://api.github.com/users/faizanrashid","html_url":"https://github.com/faizanrashid","followers_url":"https://api.github.com/users/faizanrashid/followers","following_url":"https://api.github.com/users/faizanrashid/following{/other_user}","gists_url":"https://api.github.com/users/faizanrashid/gists{/gist_id}","starred_url":"https://api.github.com/users/faizanrashid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faizanrashid/subscriptions","organizations_url":"https://api.github.com/users/faizanrashid/orgs","repos_url":"https://api.github.com/users/faizanrashid/repos","events_url":"https://api.github.com/users/faizanrashid/events{/privacy}","received_events_url":"https://api.github.com/users/faizanrashid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-08T21:39:14Z","updated_at":"2015-12-09T22:12:49Z","closed_at":null,"body":"Encoding in python2.7.5 worked perfectly fine but I believe there is a compatibility issue with python2.7.2.\r\nThe packer types don't support unpack_from memoryview. I believe the change would be in compat.py\r\n\r\nError from flatbuffers library:\r\n```\r\n2015-12-08 20:36:08,241 [ERROR]   File \"/usr/lib/python2.7/site-packages/flatbuffers/builder.py\", line 243, in EndObject\r\n2015-12-08 20:36:08,241 [ERROR]     return self.WriteVtable()\r\n2015-12-08 20:36:08,241 [ERROR]   File \"/usr/lib/python2.7/site-packages/flatbuffers/builder.py\", line 173, in WriteVtable\r\n2015-12-08 20:36:08,242 [ERROR]     vt2Len = encode.Get(packer.voffset, self.Bytes, vt2Start)\r\n2015-12-08 20:36:08,242 [ERROR]   File \"/usr/lib/python2.7/site-packages/flatbuffers/encode.py\", line 24, in Get\r\n2015-12-08 20:36:08,242 [ERROR]     return packer_type.unpack_from(memoryview_type(buf), head)[0]\r\n2015-12-08 20:36:08,242 [ERROR] TypeError: unpack_from() argument 1 must be string or read-only buffer, not memoryview\r\n```\r\n\r\nBelow shows what occurs operations are run when running on 2.7.2:\r\n```\r\nPython 2.7.2 (default, Mar 29 2012, 13:56:08)\r\n[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> from flatbuffers import packer\r\n>>> packer.voffset.unpack_from(memoryview(bytearray(\"abc\")), 0)\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\nTypeError: unpack_from() argument 1 must be string or read-only buffer, not memoryview\r\n```\r\n\r\nWhat i think should be run instead:\r\n```\r\n>>> packer.voffset.unpack_from(buffer(bytearray(\"abc\")), 0)\r\n(25185,)\r\n```"},"comment":{"url":"https://api.github.com/repos/google/flatbuffers/issues/comments/163414626","html_url":"https://github.com/google/flatbuffers/issues/1741#issuecomment-163414626","issue_url":"https://api.github.com/repos/google/flatbuffers/issues/1741","id":163414626,"user":{"login":"rw","id":21367,"avatar_url":"https://avatars.githubusercontent.com/u/21367?v=3","gravatar_id":"","url":"https://api.github.com/users/rw","html_url":"https://github.com/rw","followers_url":"https://api.github.com/users/rw/followers","following_url":"https://api.github.com/users/rw/following{/other_user}","gists_url":"https://api.github.com/users/rw/gists{/gist_id}","starred_url":"https://api.github.com/users/rw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rw/subscriptions","organizations_url":"https://api.github.com/users/rw/orgs","repos_url":"https://api.github.com/users/rw/repos","events_url":"https://api.github.com/users/rw/events{/privacy}","received_events_url":"https://api.github.com/users/rw/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T22:12:49Z","updated_at":"2015-12-09T22:12:49Z","body":"According to the changelog at https://hg.python.org/cpython/raw-file/15c95b7d81dc/Misc/NEWS (found via https://www.python.org/downloads/release/python-2710/) this may have been a result of this note in the release notes for 2.7.4rc1:\r\n\r\n```\r\n- Issue #10212: cStringIO and struct.unpack support new buffer objects.\r\n```\r\n\r\nI'm happy to take a further look at it, but @faizanrashid what would you like the behavior to be?"}}