Skip to content
This repository

%logstart in read-only directory forbid any further command #831

Closed
bernardpaulus opened this Issue October 01, 2011 · 2 comments

2 participants

bernardpaulus Thomas Kluyver
bernardpaulus

Hi!

I encountered a small problem in ipython. I searched the github issues, and duckduckgo'ed the web, but i couldn't find any description of my problem.

problem description

ipython version 0.10.2

On linux mint debian

how to reproduce the problem

  • Go to a read-only directory

    cd /usr/share/doc # for instance

  • start ipython without log

    ipython

  • attempt to start the log

    %logstart

    WARNING: Couldn't start log: [Errno 13] Permission denied: 'ipython_log.py'
    everything is normal until now but

  • attempt any command

    %logstop


AttributeError Traceback (most recent call last)

/usr/lib/python2.6/dist-packages/IPython/iplib.pyc in multiline_prefilter(self, line, continue_prompt)
2459 out = []
2460 for l in line.rstrip('\n').split('\n'):
-> 2461 out.append(self._prefilter(l, continue_prompt))
2462 return '\n'.join(out)
2463

/usr/lib/python2.6/dist-packages/IPython/iplib.pyc in _prefilter(self, line, continue_prompt)
2441 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg

2442
-> 2443 return prefilter.prefilter(line_info, self)
2444
2445

/usr/lib/python2.6/dist-packages/IPython/prefilter.pyc in prefilter(line_info, ip)
149 handler = check(line_info, ip)
150 if handler:
--> 151 return handler(line_info)
152
153 return ip.handle_normal(line_info)

/usr/lib/python2.6/dist-packages/IPython/iplib.pyc in handle_magic(self, line_info)
2537 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2538 make_quoted_expr(iFun + " " + theRest))
-> 2539 self.log(line_info.line,cmd,line_info.continue_prompt)
2540 #print 'in handle_magic, cmd=<%s>' % cmd # dbg

2541 return cmd

/usr/lib/python2.6/dist-packages/IPython/Logger.pyc in log(self, line_ori, line_mod, continuation)
231 self.log_write(line_ori)
232 else:
--> 233 self.log_write(line_mod)
234
235 def log_write(self,data,kind='input'):

/usr/lib/python2.6/dist-packages/IPython/Logger.pyc in log_write(self, data, kind)
238 #print 'data: %r' % data # dbg

239         if self.log_active and data:

--> 240 write = self.logfile.write
241 if kind=='input':
242 if self.timestamp:

AttributeError: 'NoneType' object has no attribute 'write'

how to circumvent the problem:

Just

kill -15 $IPYTHON_PID

and restart ipython. You can obtain the process id of ipython by using top, or ps


Well, it's the only "problem" I encountered until now with ipython, and ipython is pretty useful, so

Thanks to the devs!

bernard paulus

Thomas Kluyver
Collaborator

Thanks, Bernard. I think this is already fixed in IPython 0.11, but that hasn't found its way into Ubuntu (and hence Linux Mint) yet.

We could, though, do with a neater error message if you do %logstop when logging isn't active. I'll open a new issue for that.

Thomas Kluyver takluyver closed this October 01, 2011
Thomas Kluyver
Collaborator

(Made issue #832 for that)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.