{"issue":{"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"state":"open","user":{"avatar_url":"https://secure.gravatar.com/avatar/baf74ca1640047f08e0c998159d01fc5?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"baf74ca1640047f08e0c998159d01fc5","url":"https://api.github.com/users/gsever","login":"gsever","id":792252},"milestone":{"state":"open","open_issues":60,"url":"https://api.github.com/repos/ipython/ipython/milestones/6","due_on":null,"title":"0.12","description":"Stabilization of new apis after we get 0.11 out the door.","number":6,"creator":{"avatar_url":"https://secure.gravatar.com/avatar/95198572b00e5fbcd97fb5315215bf7a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"95198572b00e5fbcd97fb5315215bf7a","url":"https://api.github.com/users/fperez","login":"fperez","id":57394},"closed_issues":78,"created_at":"2011-04-10T01:57:33Z"},"assignee":null,"updated_at":"2011-11-11T00:42:28Z","labels":[{"name":"prio-low","color":"e69112","url":"https://api.github.com/repos/ipython/ipython/labels/prio-low"},{"name":"quickfix","color":"ededed","url":"https://api.github.com/repos/ipython/ipython/labels/quickfix"},{"name":"status-active","color":"eded11","url":"https://api.github.com/repos/ipython/ipython/labels/status-active"},{"name":"type-bug","color":"d9596c","url":"https://api.github.com/repos/ipython/ipython/labels/type-bug"}],"comments":5,"closed_at":null,"url":"https://api.github.com/repos/ipython/ipython/issues/988","body":"Accessing s1['dn'] should work fine within IPython like in the regular Python shell. \r\n\r\n    I1 from scipy import io\r\n    I2 s1 = io.idl.readsav('test.sav')\r\n\r\n    I3 s1?\r\n    Type:       AttrDict\r\n    Base Class: <class 'scipy.io.idl.AttrDict'>\r\n    String Form:\r\n    {'dn': array([  1.02282184e+07,   1.05383408e+07,   1.08758739e+07,\r\n               1.12449965e+07,   1. <...>  (('r', 'R'), '>f8'), (('v', 'V'), '>f8')]), 'tfit': array([  4.82394886e+02,   4.18176107e-01])}\r\n    Namespace:  Interactive\r\n    Length:     11\r\n    File:       /usr/lib64/python2.7/site-packages/scipy/io/idl.py\r\n    Definition: s1(self, name)\r\n\r\n\r\n    I4 s1['dn']\r\n    ---------------------------------------------------------------------------\r\n    KeyError                                  Traceback (most recent call last)\r\n    /home/gsever/Desktop/python-repo/ipython/IPython/core/prefilter.pyc in prefilter_lines(self, lines, continue_prompt)\r\n        358                              for lnum, line in enumerate(llines) ])\r\n        359         else:\r\n    --> 360             out = self.prefilter_line(llines[0], continue_prompt)\r\n        361 \r\n        362         return out\r\n\r\n    /home/gsever/Desktop/python-repo/ipython/IPython/core/prefilter.pyc in prefilter_line(self, line, continue_prompt)\r\n        333             return normal_handler.handle(line_info)\r\n        334 \r\n    --> 335         prefiltered = self.prefilter_line_info(line_info)\r\n        336         # print \"prefiltered line: %r\" % prefiltered\r\n\r\n        337         return prefiltered\r\n\r\n    /home/gsever/Desktop/python-repo/ipython/IPython/core/prefilter.pyc in prefilter_line_info(self, line_info)\r\n        273         # print \"prefilter_line_info: \", line_info\r\n\r\n        274         handler = self.find_handler(line_info)\r\n    --> 275         return handler.handle(line_info)\r\n        276 \r\n        277     def find_handler(self, line_info):\r\n\r\n    /home/gsever/Desktop/python-repo/ipython/IPython/core/prefilter.pyc in handle(self, line_info)\r\n        813 \r\n        814         force_auto = isinstance(obj, IPyAutocall)\r\n    --> 815         auto_rewrite = getattr(obj, 'rewrite', True)\r\n        816 \r\n        817         if esc == ESC_QUOTE:\r\n\r\n    /usr/lib64/python2.7/site-packages/scipy/io/idl.pyc in __getitem__(self, name)\r\n        657 \r\n        658     def __getitem__(self, name):\r\n    --> 659         return super(AttrDict, self).__getitem__(name.lower())\r\n        660 \r\n        661     def __setitem__(self, key, value):\r\n\r\n    KeyError: 'rewrite'\r\n\r\n\r\nUntil this is fixed in IPy, the workaround is to use s1.get('dn')\r\nUsing Python 2.7, IPython 0.12.dev, scipy.0.11.0.dev-7e1bb79\r\n","html_url":"https://github.com/ipython/ipython/issues/988","title":"Error using idlsave","number":988,"id":2199689,"created_at":"2011-11-10T16:25:46Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/95198572b00e5fbcd97fb5315215bf7a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"95198572b00e5fbcd97fb5315215bf7a","url":"https://api.github.com/users/fperez","login":"fperez","id":57394},"updated_at":"2011-11-11T00:42:28Z","url":"https://api.github.com/repos/ipython/ipython/issues/comments/2703504","body":"I reread the whole thing more carefully and I agree; the approach @minrk suggested with the try/except sounds good to me.  No need for  a PR, go ahead and push it if you want, unless you think there's more we should look into.","id":2703504,"created_at":"2011-11-11T00:42:28Z"}}