Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2102 from RuiPereira/fixlog

Fix logging on interactive shell.

Add a missing string format code in `init_logs()` and move `init_logstart()` after `init_magics()`, to fix dependency issues.

Fixes the case where a log file is given in `ipython_config.py`, eg:

```python
# Start logging to the given file in append mode.

import os
from time import strftime
f = os.path.join(c.TerminalIPythonApp.ipython_dir, strftime('%Y-%m-%d')+".py")
c.TerminalInteractiveShell.logappend = f
```

which completely breaks in current `master` code.
  • Loading branch information...
commit 56d2be5274591c95c6c1c4b0e10266ee758f3b28 2 parents d6009ff + b1a64c8
@fperez fperez authored
Showing with 2 additions and 6 deletions.
  1. +2 −6 IPython/core/interactiveshell.py
View
8 IPython/core/interactiveshell.py
@@ -469,11 +469,6 @@ def __init__(self, config=None, ipython_dir=None, profile_dir=None,
self.init_alias()
self.init_builtins()
- # pre_config_initialization
-
- # The next section should contain everything that was in ipmaker.
- self.init_logstart()
-
# The following was in post_config_initialization
self.init_inspector()
# init_readline() must come before init_io(), because init_io uses
@@ -502,6 +497,7 @@ def __init__(self, config=None, ipython_dir=None, profile_dir=None,
self.init_displayhook()
self.init_reload_doctest()
self.init_magics()
+ self.init_logstart()
self.init_pdb()
self.init_extension_manager()
self.init_plugin_manager()
@@ -617,7 +613,7 @@ def init_logstart(self):
if self.logappend:
self.magic('logstart %s append' % self.logappend)
elif self.logfile:
- self.magic('logstart %' % self.logfile)
+ self.magic('logstart %s' % self.logfile)
elif self.logstart:
self.magic('logstart')
Please sign in to comment.
Something went wrong with that request. Please try again.