Bug 751146 - Ipython forgets configuration after upgrade, doesn't let me install new one.
Ipython forgets configuration after upgrade, doesn't let me install new one.
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: ipython (Show other bugs)
16
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Thomas Spura
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-03 12:39 EDT by Nils Philippsen
Modified: 2013-02-13 18:45 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-13 18:44:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Nils Philippsen 2011-11-03 12:39:45 EDT
Description of problem:
After upgrading to Fedora 16, ipython doesn't honor my old configuration anymore, nor makes it easy to migrate the old one. The %install_default_config magic macro doesn't work as well.

Version-Release number of selected component (if applicable):
ipython-0.11-3.fc16.noarch
ipython-doc-0.11-3.fc16.noarch
ipython-gui-0.11-3.fc16.noarch
ipython-tests-0.11-3.fc16.noarch

How reproducible:
Reproducible.

Steps to Reproduce:
A)
1. On Fedora 15 or earlier, use and configure ipython (to look more like classic python interactive shell, don't confirm on exit, ...)
2. Upgrade to F-16
3. Run ipython

B)
1. Start ipython
2. %install_default_config
  
Actual results:
A) ipython complains about old configuration but offers no valid help in migrating: The online documentation mentions how to install a default profile, and how to set up classic mode or "don't confirm on exit", but configuring it as described has no visible effect.

B)

In [6]: %install_default_config
Installing default config file in: /home/nils/.config/ipython/profile_default
---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
/home/nils/<ipython-input-6-35b2515cdc84> in <module>()
----> 1 get_ipython().magic(u"install_default_config")

/usr/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s, next_input)
   1892                 self._magic_locals = sys._getframe(1).f_locals
   1893             with self.builtin_trap:
-> 1894                 result = fn(magic_args)
   1895             # Ensure we're not keeping object references around:

   1896             self._magic_locals = {}

/usr/lib/python2.7/site-packages/IPython/core/magic.pyc in magic_install_default_config(self, s)
   3393         pd = self.shell.profile_dir
   3394         print "Installing default config file in: %s" % pd.location
-> 3395         pd.copy_config_file('ipython_config.py', overwrite=overwrite)
   3396 
   3397     # Pylab support: simple wrappers that activate pylab, load gui input


/usr/lib/python2.7/site-packages/IPython/core/profiledir.pyc in copy_config_file(self, config_file, path, overwrite)
    128             path = os.path.join(get_ipython_package_dir(), u'config', u'profile', u'default')
    129         src = os.path.join(path, config_file)
--> 130         shutil.copy(src, dst)
    131         return True
    132 

/usr/lib64/python2.7/shutil.pyc in copy(src, dst)
    114     if os.path.isdir(dst):
    115         dst = os.path.join(dst, os.path.basename(src))
--> 116     copyfile(src, dst)
    117     copymode(src, dst)
    118 

/usr/lib64/python2.7/shutil.pyc in copyfile(src, dst)
     79                 raise SpecialFileError("`%s` is a named pipe" % fn)
     80 
---> 81     with open(src, 'rb') as fsrc:
     82         with open(dst, 'wb') as fdst:
     83             copyfileobj(fsrc, fdst)

IOError: [Errno 2] No such file or directory: u'/usr/lib/python2.7/site-packages/IPython/config/profile/default/ipython_config.py'

Expected results:

A) Better help (e.g. how to implement commonly used options in the new scheme), ideally migrate old configuration options to the default profile.

B) No traceback, default configuration file installed.

Additional info:
Comment 1 Thomas Spura 2011-11-03 18:41:41 EDT
Thanks for filling this bug.

Unfortunately this is kind of expected by upstream...
* As I understood upstream, there won't be a migration tool for moving the 
  configuration (This was the main blocker for not shipping as an update in an 
  released version, so users are only hitting this, when upgrading.).
* upstream is furthermore working on more documentation for the new configuration
  and has your "how to configure the prompt" only in the outdated section [1]

You might find this usefull:
http://ipython.org/ipython-doc/dev/config/ipython.html

e.g. adding this to ~/.config/ipython/profile_default/ipython_config.py and you won't have an exit prompt:
"""
c = get_config()
c.InteractiveShell.confirm_exit = False
"""

Hope this is helpful.

[1] http://ipython.org/ipython-doc/dev/config/old.html


##############################################################################

In [1]: %install_default_config
Installing default config file in: /home/tom/.config/ipython/profile_default

So the macro seems to work, but it fails, when you have the old directory, see:
https://github.com/ipython/ipython/issues/467

But doesn't seem to be the case in your backtrace.

Or what config files do you still have around or new created?
Comment 2 Nils Philippsen 2011-11-07 05:00:39 EST
I get the above traceback if I move both .ipython and .config/ipython out of the way, then start ipython and execute %install_default_config.

BTW, I get my old configuration (resembling the classic interactive python) back with this configuration in .config/ipython/profile_default/ipython_config.py:

--- 8< ---
c = get_config()

c.InteractiveShell.confirm_exit = False

c.InteractiveShell.prompt_in1 = ">>> "
c.InteractiveShell.prompt_in2 = "... "
c.InteractiveShell.separate_in = ""

c.InteractiveShell.prompt_out = ""
--- >8 ---
Comment 3 Fedora End Of Life 2013-01-16 15:19:20 EST
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 4 Fedora End Of Life 2013-02-13 18:45:03 EST
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.