{"action":"closed","issue":{"url":"https://api.github.com/repos/scipy/scipy/issues/5516","repository_url":"https://api.github.com/repos/scipy/scipy","labels_url":"https://api.github.com/repos/scipy/scipy/issues/5516/labels{/name}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/5516/comments","events_url":"https://api.github.com/repos/scipy/scipy/issues/5516/events","html_url":"https://github.com/scipy/scipy/issues/5516","id":118229323,"number":5516,"title":"TypeError: buffer is too small for requested array when reading file with io.loadmat","user":{"login":"mmagnuski","id":8452354,"avatar_url":"https://avatars.githubusercontent.com/u/8452354?v=3","gravatar_id":"","url":"https://api.github.com/users/mmagnuski","html_url":"https://github.com/mmagnuski","followers_url":"https://api.github.com/users/mmagnuski/followers","following_url":"https://api.github.com/users/mmagnuski/following{/other_user}","gists_url":"https://api.github.com/users/mmagnuski/gists{/gist_id}","starred_url":"https://api.github.com/users/mmagnuski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmagnuski/subscriptions","organizations_url":"https://api.github.com/users/mmagnuski/orgs","repos_url":"https://api.github.com/users/mmagnuski/repos","events_url":"https://api.github.com/users/mmagnuski/events{/privacy}","received_events_url":"https://api.github.com/users/mmagnuski/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scipy/scipy/labels/scipy.io","name":"scipy.io","color":"207de5"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-22T00:18:58Z","updated_at":"2016-06-12T10:41:54Z","closed_at":"2016-06-12T10:41:54Z","body":"I was trying to load an eeglab `.set` file - (which is just a `.mat` file) using `io.loadmat`, \r\n```python\r\neeg = io.matlab.loadmat(os.path.join(pth, fls[3]))\r\n```\r\nhowever I get this error:\r\n```\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n<ipython-input-14-464c30aa9ce2> in <module>()\r\n----> 1 eeg = io.matlab.loadmat(os.path.join(pth, fls[3]))\r\n\r\nc:\\Miniconda3\\lib\\site-packages\\scipy\\io\\matlab\\mio.py in loadmat(file_name, mdict, appendmat, **kwargs)\r\n    133     variable_names = kwargs.pop('variable_names', None)\r\n    134     MR = mat_reader_factory(file_name, appendmat, **kwargs)\r\n--> 135     matfile_dict = MR.get_variables(variable_names)\r\n    136     if mdict is not None:\r\n    137         mdict.update(matfile_dict)\r\n\r\nc:\\Miniconda3\\lib\\site-packages\\scipy\\io\\matlab\\mio5.py in get_variables(self, variable_names)\r\n    290                 continue\r\n    291             try:\r\n--> 292                 res = self.read_var_array(hdr, process)\r\n    293             except MatReadError as err:\r\n    294                 warnings.warn(\r\n\r\nc:\\Miniconda3\\lib\\site-packages\\scipy\\io\\matlab\\mio5.py in read_var_array(self, header, process)\r\n    250            `process`.\r\n    251         '''\r\n--> 252         return self._matrix_reader.array_from_header(header, process)\r\n    253 \r\n    254     def get_variables(self, variable_names=None):\r\n\r\nscipy\\io\\matlab\\mio5_utils.pyx in scipy.io.matlab.mio5_utils.VarReader5.array_from_header (scipy\\io\\matlab\\mio5_utils.c:6724)()\r\n\r\nscipy\\io\\matlab\\mio5_utils.pyx in scipy.io.matlab.mio5_utils.VarReader5.array_from_header (scipy\\io\\matlab\\mio5_utils.c:6200)()\r\n\r\nscipy\\io\\matlab\\mio5_utils.pyx in scipy.io.matlab.mio5_utils.VarReader5.read_struct (scipy\\io\\matlab\\mio5_utils.c:9453)()\r\n\r\nscipy\\io\\matlab\\mio5_utils.pyx in scipy.io.matlab.mio5_utils.VarReader5.read_mi_matrix (scipy\\io\\matlab\\mio5_utils.c:5727)()\r\n\r\nscipy\\io\\matlab\\mio5_utils.pyx in scipy.io.matlab.mio5_utils.VarReader5.array_from_header (scipy\\io\\matlab\\mio5_utils.c:6098)()\r\n\r\nscipy\\io\\matlab\\mio5_utils.pyx in scipy.io.matlab.mio5_utils.VarReader5.read_char (scipy\\io\\matlab\\mio5_utils.c:8245)()\r\n\r\nTypeError: buffer is too small for requested array\r\n```\r\n\r\nI am using windows 7, python 3 and scipy 16.\r\nMy `conda info`:\r\n```\r\nCurrent conda install:\r\n\r\n             platform : win-64\r\n        conda version : 3.18.5\r\n  conda-build version : not installed\r\n       python version : 3.4.3.final.0\r\n     requests version : 2.8.1\r\n     root environment : C:\\Miniconda3  (writable)\r\n  default environment : C:\\Miniconda3\r\n     envs directories : C:\\Miniconda3\\envs\r\n        package cache : C:\\Miniconda3\\pkgs\r\n         channel URLs : https://repo.continuum.io/pkgs/free/win-64/\r\n                        https://repo.continuum.io/pkgs/free/noarch/\r\n                        https://repo.continuum.io/pkgs/pro/win-64/\r\n                        https://repo.continuum.io/pkgs/pro/noarch/\r\n          config file : None\r\n    is foreign system : False\r\n```\r\n\r\nIt is worth noting that the same file can be read using `MAT.jl` package in Julia.\r\n\r\nThe file can be downloaded from [here](https://www.dropbox.com/sh/ek2dbhskfiurklx/AACEIgA_ywA_SW4MsQt7NgMJa?dl=0)"}}
{"actor":{"display_login":"Eric89GXL"}}