{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/5602","labels_url":"https://api.github.com/repos/numpy/numpy/issues/5602/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/5602/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/5602/events","html_url":"https://github.com/numpy/numpy/issues/5602","id":58823190,"number":5602,"title":"read_array_header_1_0 returns None","user":{"login":"nicain","id":113055,"avatar_url":"https://avatars.githubusercontent.com/u/113055?v=3","gravatar_id":"","url":"https://api.github.com/users/nicain","html_url":"https://github.com/nicain","followers_url":"https://api.github.com/users/nicain/followers","following_url":"https://api.github.com/users/nicain/following{/other_user}","gists_url":"https://api.github.com/users/nicain/gists{/gist_id}","starred_url":"https://api.github.com/users/nicain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicain/subscriptions","organizations_url":"https://api.github.com/users/nicain/orgs","repos_url":"https://api.github.com/users/nicain/repos","events_url":"https://api.github.com/users/nicain/events{/privacy}","received_events_url":"https://api.github.com/users/nicain/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-24T23:22:35Z","updated_at":"2015-02-25T00:54:38Z","closed_at":null,"body":"When trying to read from a .npy file, the np.lib.format-read_array_header_1_0 function returns None instead of the intended triple of shape, fortran, dtype. \r\n\r\nSeems to me that numpy/lib/format.py line 379 needs a \"return\" to get the tuple back from the call.\r\n\r\nCode snippet to reproduce the error:\r\n\r\n# Create some junk data:\r\nimport numpy as np\r\nfilename = 'mp.npy'\r\ndata = np.random.random((10,100)).astype(np.float32)\r\nnp.save(filename, data)\r\n\r\n# The error is caused by:\r\nwith open(filename, 'rb') as fhandle:\r\n    major, minor = np.lib.format.read_magic(fhandle)\r\n    shape, fortran, dtype = np.lib.format.read_array_header_1_0(fhandle)\r\n"},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/75884424","html_url":"https://github.com/numpy/numpy/issues/5602#issuecomment-75884424","issue_url":"https://api.github.com/repos/numpy/numpy/issues/5602","id":75884424,"user":{"login":"njsmith","id":609896,"avatar_url":"https://avatars.githubusercontent.com/u/609896?v=3","gravatar_id":"","url":"https://api.github.com/users/njsmith","html_url":"https://github.com/njsmith","followers_url":"https://api.github.com/users/njsmith/followers","following_url":"https://api.github.com/users/njsmith/following{/other_user}","gists_url":"https://api.github.com/users/njsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/njsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njsmith/subscriptions","organizations_url":"https://api.github.com/users/njsmith/orgs","repos_url":"https://api.github.com/users/njsmith/repos","events_url":"https://api.github.com/users/njsmith/events{/privacy}","received_events_url":"https://api.github.com/users/njsmith/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T00:54:38Z","updated_at":"2015-02-25T00:54:38Z","body":"Also note that when you submit a pull request, then the tests get run\nautomatically (in a bunch of different configurations) and the results\nlisted on the pull request web page. So you'll still probably want to run\nthe tests yourself to catch silly bugs, but you don't have to be too\nparanoid, because you will have that backup check.\n\nOn Tue, Feb 24, 2015 at 4:20 PM, Charles Harris <notifications@github.com>\nwrote:\n\n> Take a look at https://github.com/numpy/numpy/blob/master/CONTRIBUTING.md\n> and follow the links. You can run tests from your local repo with python\n> runtests.py, start with python runtests.py --help. Feel free to ask for\n> help.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/numpy/numpy/issues/5602#issuecomment-75880407>.\n>\n\n\n\n-- \nNathaniel J. Smith -- http://vorpus.org\n"}}