[IPython-user] auto_edit problems

Dave davbrow at gmail.com
Tue Jan 31 15:42:44 CST 2006


On 1/31/06, Fernando Perez <Fernando.Perez at colorado.edu> wrote:
>
> Dave wrote:
> > I still get "Return to editor to correct syntax error? [Y/n]  n"
> messages
> > when I have syntax errors since upgrading to 0.7.0.  The 0.7.1 version
> seems
> > to do the same thing. I added
> >
> > autoedit_syntax 0
> >
> > to my startup file (ipythonrc.ini) but still get the message.
> >
> > I'm running on WIN XP.
> >
> > Would love to turn this off since it is not of much help when you have
> an
> > external editor already open for the file.
> >
> > Is there a simple edit I can do to a ipython module to disable this for
> now?
>
> Mmh, that's very strange: the setting is honored for me:
>
> In [8]: __IP.rc.autoedit_syntax=0
>
> In [9]: edit
> IPython will make a temporary file named: /tmp/ipython_edit_rnvW85.py
> Editing...------------------------------------------------------------
>    File "/tmp/ipython_edit_rnvW85.py", line 1
>      12qsda f
>           ^
> SyntaxError: invalid syntax
>
> WARNING: Failure executing file: </tmp/ipython_edit_rnvW85.py>
> done. Executing edited code...
> Out[9]: '12qsda f\n'
>
>
> Try typing %config to see your config settings, and check that it's really
> being picked up as '0'.  Also try resetting it at runtime as above, and
> see if
> it helps.  Basically we need to clarify whether the problem is with the
> ipython internals, or whether you are picking up a different config from
> somewhere.
>
> Cheers,
>
> f
>


 Hi Fernando,

Here's my %config output (excerpt below).  This is a handy magic I didn't
know about.   Actually I was able to find the problem using %config and your
suggestions. The  autoedit_syntax 0 was not being picked up because a
different ipythonrc.ini was being used than I expected.  I seem to have both
a .ipython directory and a _ipython directory.  I thought .ipython was where
the startup files were located.  But the %config shows ipythondir set to
'_ipython'. So it looks like the autoedit_syntax issue was just my
misunderstanding.  It seems to be turned off properly now. Thanks for your
help.

Is this startup files location specific to WIN systems?  On unix or OSX it
still looks in .ipython in user's dir, correct?  I'm assuming I need to
delete the whole .ipython dir on WIN XP.


-- David


In [1]: %config
Current configuration structure:
{'Version': 0,
 'alias': [],
 'args': [],
 'autocall': 1,
 'autoedit_syntax': 1,
 'autoindent': 1,
 'automagic': 1,
 'banner': 1,
 'c': '',
 'cache_size': 1000,
 'classic': 0,
 'color_info': 1,
 'colors': 'Linux',
 'confirm_exit': 1,
 'debug': 0,
 'deep_reload': 0,
 'editor': 'notepad',
 'embedded': False,
 'execfile': [],
 'execute': [''],
 'gthread': 0,
 'help': 0,
 'ignore': 0,
 'import_all': [],
 'import_mod': [],
 'import_some': [[]],
 'include': [],
 'ipythondir': 'C:\\Documents and Settings\\david\\_ipython',

.
.
.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/ipython-user/attachments/20060131/27505f0f/attachment.html 


More information about the IPython-user mailing list