Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 431388 - dev-python/ipython-0.13 -AttributeError: 'StoreMagics' object has no attribute 'db'
Summary: dev-python/ipython-0.13 -AttributeError: 'StoreMagics' object has no attribut...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL: https://github.com/ipython/ipython/is...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-08-14 14:28 UTC by Peter Alexander
Modified: 2013-05-08 00:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ipython-0.13-storemagic.patch (ipython-0.13-storemagic.patch,2.81 KB, patch)
2012-08-14 14:30 UTC, Peter Alexander
Details | Diff
ipython-0.13.ebuild-storemagic.patch (ipython-0.13.ebuild-storemagic.patch,331 bytes, patch)
2012-08-14 14:31 UTC, Peter Alexander
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Alexander 2012-08-14 14:28:25 UTC
The 'store' magic command is broken via upstream (https://github.com/ipython/ipython/issues/2099).

Upstream fixed via commit (https://github.com/ipython/ipython/commit/92309bb477e9ef2c1f912691285c985c8c35fdb5)

Provided in the comments are two attachments.. the actual patch and a patch for package-atom dev-python/ipython-0.13
Comment 1 Peter Alexander 2012-08-14 14:30:08 UTC
Created attachment 321322 [details, diff]
ipython-0.13-storemagic.patch
Comment 2 Peter Alexander 2012-08-14 14:31:10 UTC
Created attachment 321324 [details, diff]
ipython-0.13.ebuild-storemagic.patch
Comment 3 Peter Alexander 2012-08-14 14:35:41 UTC
Full Traceback:

In [2]: store
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-fb577a33a172> in <module>()
----> 1 get_ipython().magic(u'store ')

/usr/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
   2159         magic_name, _, magic_arg_s = arg_s.partition(' ')
   2160         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2161         return self.run_line_magic(magic_name, magic_arg_s)
   2162 
   2163     #-------------------------------------------------------------------------

/usr/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
   2085                 args.append(sys._getframe(stack_depth).f_locals)
   2086             with self.builtin_trap:
-> 2087                 result = fn(*args)
   2088             return result
   2089 

/usr/lib/python2.7/site-packages/IPython/extensions/storemagic.pyc in store(self, parameter_s)

/usr/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
    189     # but it's overkill for just that one bit of state.
    190     def magic_deco(arg):
--> 191         call = lambda f, *a, **k: f(*a, **k)
    192 
    193         if callable(arg):

/usr/lib/python2.7/site-packages/IPython/extensions/storemagic.pyc in store(self, parameter_s)
    141         # run without arguments -> list variables & values
    142         elif not args:
--> 143             vars = self.db.keys('autorestore/*')
    144             vars.sort()
    145             if vars:

AttributeError: 'StoreMagics' object has no attribute 'db'
Comment 4 Peter Alexander 2012-08-14 14:42:32 UTC
Unfortunately, upon further review, the patch fixes the error (no traceback) but store is still broken.

I'll look at other upstream commits to find a complete solution.
Comment 5 Jan Matějka (RETIRED) gentoo-dev 2013-05-07 17:35:30 UTC
I can reproduce this with 0.13 but not with 0.13.1

However I'm not sure how to restore it. If restoration is done with load, then loading doesn't work for me on 0.13.1.
Comment 6 Jan Matějka (RETIRED) gentoo-dev 2013-05-08 00:07:04 UTC
fixed in 0.13.1-r1

In [1]: a=1

In [2]: store
Stored variables and their in-db values:

In [3]: store a
Stored 'a' (int)

In [4]: quit
yac@elliot ~ $ ipython
Python 3.2.4 (default, May  7 2013, 17:09:13)
Type "copyright", "credits" or "license" for more information.

IPython 0.13.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: %store -r a

In [2]: a
Out[2]: 1