[IPython-user] tab completion does not escape ()

Fernando Perez fperez.net@gmail....
Sun Aug 17 03:24:41 CDT 2008


On Sun, Aug 17, 2008 at 1:14 AM, Ville M. Vainio <vivainio@gmail.com> wrote:
> On Sun, Aug 17, 2008 at 7:22 AM, Fernando Perez <fperez.net@gmail.com> wrote:
>
>> Other than the fact that parens in filenames are evil :), this is an
>> ipython bug.  Could you please file a report about it on the tracker?
>
> It's a feature, at least on win32. It's easy to escape those (just add
> to 'protectables') but do we really want that? I recently removed
> escaping for []{}. Why should the parens be escaped?

Because they are shell metacharacters:

tlon[~/test]> cat fff\(1\).txt
Simple file...
tlon[~/test]> ip --nobanner

In [1]: cat fff(1).txt
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `cat fff(1).txt'

In [2]: cat fff\(1\).txt  # manually escaped
Simple file...


So () do need to be escaped.  I also tested [] and {} and don't see a
problem with those, though tcsh seems to escape the opening ones at
least, but it seems we're fine without escapes there.

f


More information about the IPython-user mailing list