{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/6766","labels_url":"https://api.github.com/repos/numpy/numpy/issues/6766/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/6766/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/6766/events","html_url":"https://github.com/numpy/numpy/issues/6766","id":120420904,"number":6766,"title":"numpy.load: OSError: first argument must be an open file","user":{"login":"jor-","id":2393560,"avatar_url":"https://avatars.githubusercontent.com/u/2393560?v=3","gravatar_id":"","url":"https://api.github.com/users/jor-","html_url":"https://github.com/jor-","followers_url":"https://api.github.com/users/jor-/followers","following_url":"https://api.github.com/users/jor-/following{/other_user}","gists_url":"https://api.github.com/users/jor-/gists{/gist_id}","starred_url":"https://api.github.com/users/jor-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jor-/subscriptions","organizations_url":"https://api.github.com/users/jor-/orgs","repos_url":"https://api.github.com/users/jor-/repos","events_url":"https://api.github.com/users/jor-/events{/privacy}","received_events_url":"https://api.github.com/users/jor-/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/numpy/numpy/labels/component:%20numpy.lib","name":"component: numpy.lib","color":"ff0000"},{"url":"https://api.github.com/repos/numpy/numpy/labels/Defect","name":"Defect","color":"444444"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-12-04T15:14:52Z","updated_at":"2015-12-14T13:39:53Z","closed_at":null,"body":"Using Python 3.5 and Numpy 1.10.1 I got an error at `numpy.load` when called on an opened file object. \r\n```\r\nfile = 'xyz.npy'\r\nwith open(file, 'rb') as file_object:\r\n    return numpy.load(file_object)\r\n```\r\nThe error is thrown at: numpy/lib/format.py\", line 649, in read_array\r\n    array = numpy.fromfile(fp, dtype=dtype, count=count)\r\nOSError: first argument must be an open file\r\n\r\nI checked with pdb: The file was closed somewhere inside the `numpy.load` call.\r\n\r\nUnfortunately, the error does not always occur. I repeat loading the file many times in my script, the error occurs normally after several hundred loadings.\r\n\r\nDoes anyone have an explanation of why it is sometimes closed?\r\n"},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/164440896","html_url":"https://github.com/numpy/numpy/issues/6766#issuecomment-164440896","issue_url":"https://api.github.com/repos/numpy/numpy/issues/6766","id":164440896,"user":{"login":"seberg","id":61977,"avatar_url":"https://avatars.githubusercontent.com/u/61977?v=3","gravatar_id":"","url":"https://api.github.com/users/seberg","html_url":"https://github.com/seberg","followers_url":"https://api.github.com/users/seberg/followers","following_url":"https://api.github.com/users/seberg/following{/other_user}","gists_url":"https://api.github.com/users/seberg/gists{/gist_id}","starred_url":"https://api.github.com/users/seberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seberg/subscriptions","organizations_url":"https://api.github.com/users/seberg/orgs","repos_url":"https://api.github.com/users/seberg/repos","events_url":"https://api.github.com/users/seberg/events{/privacy}","received_events_url":"https://api.github.com/users/seberg/received_events","type":"User","site_admin":false},"created_at":"2015-12-14T13:39:53Z","updated_at":"2015-12-14T13:39:53Z","body":"I don't know, but frankly it sounds like the `fd` gets closed somehow, and I doubt that numpy has anything to do with it, maybe timeouts on the NFS because you are doing so much at the same time or something? Can you check `fd.errors` afterwards, not sure but I think that might tell you at least something?"}}