{"action":"created","comment":{"url":"https://api.github.com/repos/numpy/numpy/pulls/comments/25913223","id":25913223,"diff_hunk":"@@ -677,7 +682,22 @@ def _loose_call(self, value):\n \n     def _strict_call(self, value):\n         try:\n-            return self.func(value)\n+\n+            # We check if we can convert the value using the current function\n+            new_value = self.func(value)\n+\n+            # In addition to having to check whether func can convert the\n+            # value, we also have to make sure that we don't get overflow \n+            # errors for integers.\n+            if self.func is int:\n+                try:\n+                    np.array([value], dtype=self.type)\n+                except OverflowError:\n+                    raise ValueError(\"\")","path":"numpy/lib/_iotools.py","position":null,"original_position":34,"commit_id":"b82fd54805053719105373e9a326018f33a04281","original_commit_id":"7129c5263cb9d357bdb9c6cd2c4feceeab53ca07","user":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"body":"Ah yes, sorry - fixed","created_at":"2015-03-05T23:36:11Z","updated_at":"2015-03-05T23:36:11Z","html_url":"https://github.com/numpy/numpy/pull/5635#discussion_r25913223","pull_request_url":"https://api.github.com/repos/numpy/numpy/pulls/5635","_links":{"self":{"href":"https://api.github.com/repos/numpy/numpy/pulls/comments/25913223"},"html":{"href":"https://github.com/numpy/numpy/pull/5635#discussion_r25913223"},"pull_request":{"href":"https://api.github.com/repos/numpy/numpy/pulls/5635"}}},"pull_request":{"url":"https://api.github.com/repos/numpy/numpy/pulls/5635","id":30603796,"html_url":"https://github.com/numpy/numpy/pull/5635","diff_url":"https://github.com/numpy/numpy/pull/5635.diff","patch_url":"https://github.com/numpy/numpy/pull/5635.patch","issue_url":"https://api.github.com/repos/numpy/numpy/issues/5635","number":5635,"state":"open","locked":false,"title":"genfromtxt does not work in some cases on 32-bit systems with dtype=None","user":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"body":"If a text file contains an integer that is larger than 2**31 or so, ``genfromtxt`` crashes on 32-bit systems if ``dtype`` is set to ``None`` to allow auto-detection:\r\n\r\n```\r\nIn [1]: import numpy as np\r\n\r\nIn [2]: np.genfromtxt('test.txt', dtype=None)\r\n---------------------------------------------------------------------------\r\nOverflowError                             Traceback (most recent call last)\r\n<ipython-input-2-4e10a89c9647> in <module>()\r\n----> 1 np.genfromtxt('test.txt', dtype=None)\r\n\r\n/home/user/miniconda/envs/astroquery/lib/python2.7/site-packages/numpy/lib/npyio.pyc in genfromtxt(fname, dtype, comments, delimiter, skiprows, skip_header, skip_footer, converters, missing, missing_values, filling_values, usecols, names, excludelist, deletechars, replace_space, autostrip, case_sensitive, defaultfmt, unpack, usemask, loose, invalid_raise)\r\n   1739             mdtype = list(zip(names, [np.bool] * len(column_types)))\r\n-> 1740         output = np.array(data, dtype=ddtype)\r\n   1741         if usemask:\r\n   1742             outputmask = np.array(masks, dtype=mdtype)\r\n\r\nOverflowError: Python int too large to convert to C long\r\n```\r\n\r\nThe ``test.txt`` file above contains:\r\n\r\n```\r\n11222111331 22\r\n```","created_at":"2015-03-05T22:45:55Z","updated_at":"2015-03-05T23:36:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a32fd3b9ec3b05079b5281209afffcb163e62918","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/numpy/numpy/pulls/5635/commits","review_comments_url":"https://api.github.com/repos/numpy/numpy/pulls/5635/comments","review_comment_url":"https://api.github.com/repos/numpy/numpy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/5635/comments","statuses_url":"https://api.github.com/repos/numpy/numpy/statuses/b82fd54805053719105373e9a326018f33a04281","head":{"label":"astrofrog:genfromtxt-largeints","ref":"genfromtxt-largeints","sha":"b82fd54805053719105373e9a326018f33a04281","user":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"repo":{"id":6178236,"name":"numpy","full_name":"astrofrog/numpy","owner":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/astrofrog/numpy","description":"Numpy main repository","fork":true,"url":"https://api.github.com/repos/astrofrog/numpy","forks_url":"https://api.github.com/repos/astrofrog/numpy/forks","keys_url":"https://api.github.com/repos/astrofrog/numpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/astrofrog/numpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/astrofrog/numpy/teams","hooks_url":"https://api.github.com/repos/astrofrog/numpy/hooks","issue_events_url":"https://api.github.com/repos/astrofrog/numpy/issues/events{/number}","events_url":"https://api.github.com/repos/astrofrog/numpy/events","assignees_url":"https://api.github.com/repos/astrofrog/numpy/assignees{/user}","branches_url":"https://api.github.com/repos/astrofrog/numpy/branches{/branch}","tags_url":"https://api.github.com/repos/astrofrog/numpy/tags","blobs_url":"https://api.github.com/repos/astrofrog/numpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/astrofrog/numpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/astrofrog/numpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/astrofrog/numpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/astrofrog/numpy/statuses/{sha}","languages_url":"https://api.github.com/repos/astrofrog/numpy/languages","stargazers_url":"https://api.github.com/repos/astrofrog/numpy/stargazers","contributors_url":"https://api.github.com/repos/astrofrog/numpy/contributors","subscribers_url":"https://api.github.com/repos/astrofrog/numpy/subscribers","subscription_url":"https://api.github.com/repos/astrofrog/numpy/subscription","commits_url":"https://api.github.com/repos/astrofrog/numpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/astrofrog/numpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/astrofrog/numpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/astrofrog/numpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/astrofrog/numpy/contents/{+path}","compare_url":"https://api.github.com/repos/astrofrog/numpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/astrofrog/numpy/merges","archive_url":"https://api.github.com/repos/astrofrog/numpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/astrofrog/numpy/downloads","issues_url":"https://api.github.com/repos/astrofrog/numpy/issues{/number}","pulls_url":"https://api.github.com/repos/astrofrog/numpy/pulls{/number}","milestones_url":"https://api.github.com/repos/astrofrog/numpy/milestones{/number}","notifications_url":"https://api.github.com/repos/astrofrog/numpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/astrofrog/numpy/labels{/name}","releases_url":"https://api.github.com/repos/astrofrog/numpy/releases{/id}","created_at":"2012-10-11T18:01:38Z","updated_at":"2013-04-11T19:56:40Z","pushed_at":"2015-03-05T23:36:04Z","git_url":"git://github.com/astrofrog/numpy.git","ssh_url":"git@github.com:astrofrog/numpy.git","clone_url":"https://github.com/astrofrog/numpy.git","svn_url":"https://github.com/astrofrog/numpy","homepage":"http://www.numpy.org/","size":23179,"stargazers_count":0,"watchers_count":0,"language":"C","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":"numpy:master","ref":"master","sha":"4cba5310c7b8d1a3aab7202209d238f569a8f9ff","user":{"login":"numpy","id":288276,"avatar_url":"https://avatars.githubusercontent.com/u/288276?v=3","gravatar_id":"","url":"https://api.github.com/users/numpy","html_url":"https://github.com/numpy","followers_url":"https://api.github.com/users/numpy/followers","following_url":"https://api.github.com/users/numpy/following{/other_user}","gists_url":"https://api.github.com/users/numpy/gists{/gist_id}","starred_url":"https://api.github.com/users/numpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numpy/subscriptions","organizations_url":"https://api.github.com/users/numpy/orgs","repos_url":"https://api.github.com/users/numpy/repos","events_url":"https://api.github.com/users/numpy/events{/privacy}","received_events_url":"https://api.github.com/users/numpy/received_events","type":"Organization","site_admin":false},"repo":{"id":908607,"name":"numpy","full_name":"numpy/numpy","owner":{"login":"numpy","id":288276,"avatar_url":"https://avatars.githubusercontent.com/u/288276?v=3","gravatar_id":"","url":"https://api.github.com/users/numpy","html_url":"https://github.com/numpy","followers_url":"https://api.github.com/users/numpy/followers","following_url":"https://api.github.com/users/numpy/following{/other_user}","gists_url":"https://api.github.com/users/numpy/gists{/gist_id}","starred_url":"https://api.github.com/users/numpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numpy/subscriptions","organizations_url":"https://api.github.com/users/numpy/orgs","repos_url":"https://api.github.com/users/numpy/repos","events_url":"https://api.github.com/users/numpy/events{/privacy}","received_events_url":"https://api.github.com/users/numpy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/numpy/numpy","description":"Numpy main repository","fork":false,"url":"https://api.github.com/repos/numpy/numpy","forks_url":"https://api.github.com/repos/numpy/numpy/forks","keys_url":"https://api.github.com/repos/numpy/numpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/numpy/numpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/numpy/numpy/teams","hooks_url":"https://api.github.com/repos/numpy/numpy/hooks","issue_events_url":"https://api.github.com/repos/numpy/numpy/issues/events{/number}","events_url":"https://api.github.com/repos/numpy/numpy/events","assignees_url":"https://api.github.com/repos/numpy/numpy/assignees{/user}","branches_url":"https://api.github.com/repos/numpy/numpy/branches{/branch}","tags_url":"https://api.github.com/repos/numpy/numpy/tags","blobs_url":"https://api.github.com/repos/numpy/numpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/numpy/numpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/numpy/numpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/numpy/numpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/numpy/numpy/statuses/{sha}","languages_url":"https://api.github.com/repos/numpy/numpy/languages","stargazers_url":"https://api.github.com/repos/numpy/numpy/stargazers","contributors_url":"https://api.github.com/repos/numpy/numpy/contributors","subscribers_url":"https://api.github.com/repos/numpy/numpy/subscribers","subscription_url":"https://api.github.com/repos/numpy/numpy/subscription","commits_url":"https://api.github.com/repos/numpy/numpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/numpy/numpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/numpy/numpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/numpy/numpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/numpy/numpy/contents/{+path}","compare_url":"https://api.github.com/repos/numpy/numpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/numpy/numpy/merges","archive_url":"https://api.github.com/repos/numpy/numpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/numpy/numpy/downloads","issues_url":"https://api.github.com/repos/numpy/numpy/issues{/number}","pulls_url":"https://api.github.com/repos/numpy/numpy/pulls{/number}","milestones_url":"https://api.github.com/repos/numpy/numpy/milestones{/number}","notifications_url":"https://api.github.com/repos/numpy/numpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/numpy/numpy/labels{/name}","releases_url":"https://api.github.com/repos/numpy/numpy/releases{/id}","created_at":"2010-09-13T23:02:39Z","updated_at":"2015-03-05T20:51:13Z","pushed_at":"2015-03-04T21:49:57Z","git_url":"git://github.com/numpy/numpy.git","ssh_url":"git@github.com:numpy/numpy.git","clone_url":"https://github.com/numpy/numpy.git","svn_url":"https://github.com/numpy/numpy","homepage":"http://www.numpy.org/","size":61440,"stargazers_count":1798,"watchers_count":1798,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":900,"mirror_url":null,"open_issues_count":805,"forks":900,"open_issues":805,"watchers":1798,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/numpy/numpy/pulls/5635"},"html":{"href":"https://github.com/numpy/numpy/pull/5635"},"issue":{"href":"https://api.github.com/repos/numpy/numpy/issues/5635"},"comments":{"href":"https://api.github.com/repos/numpy/numpy/issues/5635/comments"},"review_comments":{"href":"https://api.github.com/repos/numpy/numpy/pulls/5635/comments"},"review_comment":{"href":"https://api.github.com/repos/numpy/numpy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/numpy/numpy/pulls/5635/commits"},"statuses":{"href":"https://api.github.com/repos/numpy/numpy/statuses/b82fd54805053719105373e9a326018f33a04281"}}}}