{"action":"opened","number":19,"pull_request":{"url":"https://api.github.com/repos/jiangwen365/pypyodbc/pulls/19","id":33406807,"html_url":"https://github.com/jiangwen365/pypyodbc/pull/19","diff_url":"https://github.com/jiangwen365/pypyodbc/pull/19.diff","patch_url":"https://github.com/jiangwen365/pypyodbc/pull/19.patch","issue_url":"https://api.github.com/repos/jiangwen365/pypyodbc/issues/19","number":19,"state":"open","locked":false,"title":"Change length of state buffer from 22 to 24 bytes.","user":{"login":"kpsmith","id":1400055,"avatar_url":"https://avatars.githubusercontent.com/u/1400055?v=3","gravatar_id":"","url":"https://api.github.com/users/kpsmith","html_url":"https://github.com/kpsmith","followers_url":"https://api.github.com/users/kpsmith/followers","following_url":"https://api.github.com/users/kpsmith/following{/other_user}","gists_url":"https://api.github.com/users/kpsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/kpsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kpsmith/subscriptions","organizations_url":"https://api.github.com/users/kpsmith/orgs","repos_url":"https://api.github.com/users/kpsmith/repos","events_url":"https://api.github.com/users/kpsmith/events{/privacy}","received_events_url":"https://api.github.com/users/kpsmith/received_events","type":"User","site_admin":false},"body":"I had been receiving the following error on OSX using iODBC as a driver manager:\r\n```\r\nTraceback (most recent call last):\r\n  File \"/Users/ksmith/.pyenv/versions/2.7/lib/python2.7/runpy.py\", line 162, in _run_module_as_main\r\n    \"__main__\", fname, loader, pkg_name)\r\n  File \"/Users/ksmith/.pyenv/versions/2.7/lib/python2.7/runpy.py\", line 72, in _run_code\r\n    exec code in run_globals\r\n  File \"/Users/ksmith/src/main.py\", line 20, in <module>\r\n    main()\r\n  File \"/Users/ksmith/src/main.py\", line 15, in main\r\n    odbc_test = client.ConnectionTests()\r\n  File \"client/Tests.py\", line 16, in __init__\r\n    self.conn = pyodbc.connect(connection_string)\r\n  File \"/Users/ksmith/.pyenv/versions/2.7/lib/python2.7/site-packages/pypyodbc.py\", line 2438, in __init__\r\n    self.connect(connectString, autocommit, ansi, timeout, unicode_results, readonly)\r\n  File \"/Users/ksmith/.pyenv/versions/2.7/lib/python2.7/site-packages/pypyodbc.py\", line 2487, in connect\r\n    check_success(self, ret)\r\n  File \"/Users/ksmith/.pyenv/versions/2.7/lib/python2.7/site-packages/pypyodbc.py\", line 992, in check_success\r\n    ctrl_err(SQL_HANDLE_DBC, ODBC_obj.dbc_h, ret, ODBC_obj.ansi)\r\n  File \"/Users/ksmith/.pyenv/versions/2.7/lib/python2.7/site-packages/pypyodbc.py\", line 979, in ctrl_err\r\n    err_list.append((from_buffer_u(state), from_buffer_u(Message), NativeError.value))\r\n  File \"/Users/ksmith/.pyenv/versions/2.7/lib/python2.7/site-packages/pypyodbc.py\", line 483, in UCS_dec\r\n    uchar = buffer.raw[i:i + ucs_length].decode(odbc_decoding)\r\n  File \"/Users/ksmith/.pyenv/versions/2.7/lib/python2.7/encodings/utf_32.py\", line 11, in decode\r\n    return codecs.utf_32_decode(input, errors, True)\r\nUnicodeDecodeError: 'utf32' codec can't decode bytes in position 0-1: truncated data\r\n```\r\n\r\nChanging the length of the state buffer from 22 to 24 bytes has fixed the issue locally.\r\n\r\nWith iODBC using utf-32 encoding I would expect the size of this buffer to have to be a multiple of 4, but I'm no expert here so I could be missing something. Could someone with more experience on this project take a look and confirm whether this is the appropriate change?\r\n\r\nThanks.","created_at":"2015-04-15T23:33:40Z","updated_at":"2015-04-15T23:33:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jiangwen365/pypyodbc/pulls/19/commits","review_comments_url":"https://api.github.com/repos/jiangwen365/pypyodbc/pulls/19/comments","review_comment_url":"https://api.github.com/repos/jiangwen365/pypyodbc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jiangwen365/pypyodbc/issues/19/comments","statuses_url":"https://api.github.com/repos/jiangwen365/pypyodbc/statuses/5a650f32a679a2400f78b78478e2fd592286a380","head":{"label":"kpsmith:24-byte-state","ref":"24-byte-state","sha":"5a650f32a679a2400f78b78478e2fd592286a380","user":{"login":"kpsmith","id":1400055,"avatar_url":"https://avatars.githubusercontent.com/u/1400055?v=3","gravatar_id":"","url":"https://api.github.com/users/kpsmith","html_url":"https://github.com/kpsmith","followers_url":"https://api.github.com/users/kpsmith/followers","following_url":"https://api.github.com/users/kpsmith/following{/other_user}","gists_url":"https://api.github.com/users/kpsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/kpsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kpsmith/subscriptions","organizations_url":"https://api.github.com/users/kpsmith/orgs","repos_url":"https://api.github.com/users/kpsmith/repos","events_url":"https://api.github.com/users/kpsmith/events{/privacy}","received_events_url":"https://api.github.com/users/kpsmith/received_events","type":"User","site_admin":false},"repo":{"id":34023656,"name":"pypyodbc","full_name":"kpsmith/pypyodbc","owner":{"login":"kpsmith","id":1400055,"avatar_url":"https://avatars.githubusercontent.com/u/1400055?v=3","gravatar_id":"","url":"https://api.github.com/users/kpsmith","html_url":"https://github.com/kpsmith","followers_url":"https://api.github.com/users/kpsmith/followers","following_url":"https://api.github.com/users/kpsmith/following{/other_user}","gists_url":"https://api.github.com/users/kpsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/kpsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kpsmith/subscriptions","organizations_url":"https://api.github.com/users/kpsmith/orgs","repos_url":"https://api.github.com/users/kpsmith/repos","events_url":"https://api.github.com/users/kpsmith/events{/privacy}","received_events_url":"https://api.github.com/users/kpsmith/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kpsmith/pypyodbc","description":"A pure Python Cross Platform ODBC interface module","fork":true,"url":"https://api.github.com/repos/kpsmith/pypyodbc","forks_url":"https://api.github.com/repos/kpsmith/pypyodbc/forks","keys_url":"https://api.github.com/repos/kpsmith/pypyodbc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kpsmith/pypyodbc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kpsmith/pypyodbc/teams","hooks_url":"https://api.github.com/repos/kpsmith/pypyodbc/hooks","issue_events_url":"https://api.github.com/repos/kpsmith/pypyodbc/issues/events{/number}","events_url":"https://api.github.com/repos/kpsmith/pypyodbc/events","assignees_url":"https://api.github.com/repos/kpsmith/pypyodbc/assignees{/user}","branches_url":"https://api.github.com/repos/kpsmith/pypyodbc/branches{/branch}","tags_url":"https://api.github.com/repos/kpsmith/pypyodbc/tags","blobs_url":"https://api.github.com/repos/kpsmith/pypyodbc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kpsmith/pypyodbc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kpsmith/pypyodbc/git/refs{/sha}","trees_url":"https://api.github.com/repos/kpsmith/pypyodbc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kpsmith/pypyodbc/statuses/{sha}","languages_url":"https://api.github.com/repos/kpsmith/pypyodbc/languages","stargazers_url":"https://api.github.com/repos/kpsmith/pypyodbc/stargazers","contributors_url":"https://api.github.com/repos/kpsmith/pypyodbc/contributors","subscribers_url":"https://api.github.com/repos/kpsmith/pypyodbc/subscribers","subscription_url":"https://api.github.com/repos/kpsmith/pypyodbc/subscription","commits_url":"https://api.github.com/repos/kpsmith/pypyodbc/commits{/sha}","git_commits_url":"https://api.github.com/repos/kpsmith/pypyodbc/git/commits{/sha}","comments_url":"https://api.github.com/repos/kpsmith/pypyodbc/comments{/number}","issue_comment_url":"https://api.github.com/repos/kpsmith/pypyodbc/issues/comments{/number}","contents_url":"https://api.github.com/repos/kpsmith/pypyodbc/contents/{+path}","compare_url":"https://api.github.com/repos/kpsmith/pypyodbc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kpsmith/pypyodbc/merges","archive_url":"https://api.github.com/repos/kpsmith/pypyodbc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kpsmith/pypyodbc/downloads","issues_url":"https://api.github.com/repos/kpsmith/pypyodbc/issues{/number}","pulls_url":"https://api.github.com/repos/kpsmith/pypyodbc/pulls{/number}","milestones_url":"https://api.github.com/repos/kpsmith/pypyodbc/milestones{/number}","notifications_url":"https://api.github.com/repos/kpsmith/pypyodbc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kpsmith/pypyodbc/labels{/name}","releases_url":"https://api.github.com/repos/kpsmith/pypyodbc/releases{/id}","created_at":"2015-04-15T23:26:41Z","updated_at":"2015-04-15T23:26:41Z","pushed_at":"2015-04-15T23:27:53Z","git_url":"git://github.com/kpsmith/pypyodbc.git","ssh_url":"git@github.com:kpsmith/pypyodbc.git","clone_url":"https://github.com/kpsmith/pypyodbc.git","svn_url":"https://github.com/kpsmith/pypyodbc","homepage":null,"size":502,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jiangwen365:master","ref":"master","sha":"73c98e1756d481bbd0f8c7796ab4e81dd9724235","user":{"login":"jiangwen365","id":2059563,"avatar_url":"https://avatars.githubusercontent.com/u/2059563?v=3","gravatar_id":"","url":"https://api.github.com/users/jiangwen365","html_url":"https://github.com/jiangwen365","followers_url":"https://api.github.com/users/jiangwen365/followers","following_url":"https://api.github.com/users/jiangwen365/following{/other_user}","gists_url":"https://api.github.com/users/jiangwen365/gists{/gist_id}","starred_url":"https://api.github.com/users/jiangwen365/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiangwen365/subscriptions","organizations_url":"https://api.github.com/users/jiangwen365/orgs","repos_url":"https://api.github.com/users/jiangwen365/repos","events_url":"https://api.github.com/users/jiangwen365/events{/privacy}","received_events_url":"https://api.github.com/users/jiangwen365/received_events","type":"User","site_admin":false},"repo":{"id":8469342,"name":"pypyodbc","full_name":"jiangwen365/pypyodbc","owner":{"login":"jiangwen365","id":2059563,"avatar_url":"https://avatars.githubusercontent.com/u/2059563?v=3","gravatar_id":"","url":"https://api.github.com/users/jiangwen365","html_url":"https://github.com/jiangwen365","followers_url":"https://api.github.com/users/jiangwen365/followers","following_url":"https://api.github.com/users/jiangwen365/following{/other_user}","gists_url":"https://api.github.com/users/jiangwen365/gists{/gist_id}","starred_url":"https://api.github.com/users/jiangwen365/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiangwen365/subscriptions","organizations_url":"https://api.github.com/users/jiangwen365/orgs","repos_url":"https://api.github.com/users/jiangwen365/repos","events_url":"https://api.github.com/users/jiangwen365/events{/privacy}","received_events_url":"https://api.github.com/users/jiangwen365/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jiangwen365/pypyodbc","description":"A pure Python Cross Platform ODBC interface module","fork":false,"url":"https://api.github.com/repos/jiangwen365/pypyodbc","forks_url":"https://api.github.com/repos/jiangwen365/pypyodbc/forks","keys_url":"https://api.github.com/repos/jiangwen365/pypyodbc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jiangwen365/pypyodbc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jiangwen365/pypyodbc/teams","hooks_url":"https://api.github.com/repos/jiangwen365/pypyodbc/hooks","issue_events_url":"https://api.github.com/repos/jiangwen365/pypyodbc/issues/events{/number}","events_url":"https://api.github.com/repos/jiangwen365/pypyodbc/events","assignees_url":"https://api.github.com/repos/jiangwen365/pypyodbc/assignees{/user}","branches_url":"https://api.github.com/repos/jiangwen365/pypyodbc/branches{/branch}","tags_url":"https://api.github.com/repos/jiangwen365/pypyodbc/tags","blobs_url":"https://api.github.com/repos/jiangwen365/pypyodbc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jiangwen365/pypyodbc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jiangwen365/pypyodbc/git/refs{/sha}","trees_url":"https://api.github.com/repos/jiangwen365/pypyodbc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jiangwen365/pypyodbc/statuses/{sha}","languages_url":"https://api.github.com/repos/jiangwen365/pypyodbc/languages","stargazers_url":"https://api.github.com/repos/jiangwen365/pypyodbc/stargazers","contributors_url":"https://api.github.com/repos/jiangwen365/pypyodbc/contributors","subscribers_url":"https://api.github.com/repos/jiangwen365/pypyodbc/subscribers","subscription_url":"https://api.github.com/repos/jiangwen365/pypyodbc/subscription","commits_url":"https://api.github.com/repos/jiangwen365/pypyodbc/commits{/sha}","git_commits_url":"https://api.github.com/repos/jiangwen365/pypyodbc/git/commits{/sha}","comments_url":"https://api.github.com/repos/jiangwen365/pypyodbc/comments{/number}","issue_comment_url":"https://api.github.com/repos/jiangwen365/pypyodbc/issues/comments{/number}","contents_url":"https://api.github.com/repos/jiangwen365/pypyodbc/contents/{+path}","compare_url":"https://api.github.com/repos/jiangwen365/pypyodbc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jiangwen365/pypyodbc/merges","archive_url":"https://api.github.com/repos/jiangwen365/pypyodbc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jiangwen365/pypyodbc/downloads","issues_url":"https://api.github.com/repos/jiangwen365/pypyodbc/issues{/number}","pulls_url":"https://api.github.com/repos/jiangwen365/pypyodbc/pulls{/number}","milestones_url":"https://api.github.com/repos/jiangwen365/pypyodbc/milestones{/number}","notifications_url":"https://api.github.com/repos/jiangwen365/pypyodbc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jiangwen365/pypyodbc/labels{/name}","releases_url":"https://api.github.com/repos/jiangwen365/pypyodbc/releases{/id}","created_at":"2013-02-28T01:16:49Z","updated_at":"2015-04-14T04:25:19Z","pushed_at":"2014-02-15T12:52:30Z","git_url":"git://github.com/jiangwen365/pypyodbc.git","ssh_url":"git@github.com:jiangwen365/pypyodbc.git","clone_url":"https://github.com/jiangwen365/pypyodbc.git","svn_url":"https://github.com/jiangwen365/pypyodbc","homepage":null,"size":502,"stargazers_count":29,"watchers_count":29,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":14,"forks":25,"open_issues":14,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jiangwen365/pypyodbc/pulls/19"},"html":{"href":"https://github.com/jiangwen365/pypyodbc/pull/19"},"issue":{"href":"https://api.github.com/repos/jiangwen365/pypyodbc/issues/19"},"comments":{"href":"https://api.github.com/repos/jiangwen365/pypyodbc/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/jiangwen365/pypyodbc/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/jiangwen365/pypyodbc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jiangwen365/pypyodbc/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/jiangwen365/pypyodbc/statuses/5a650f32a679a2400f78b78478e2fd592286a380"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":1,"deletions":1,"changed_files":1}}