fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] contrib.files comment and uncomment behaving differently


From: Jeff Forcier
Subject: Re: [Fab-user] contrib.files comment and uncomment behaving differently
Date: Mon, 8 Nov 2010 12:54:00 -0500

On Mon, Nov 8, 2010 at 10:34 AM, Dan Craig <address@hidden> wrote:
> In my
> use case, it's still awkward to do the replace(r"\/", "/"), but I may be
> unusual in passing a fully escaped string.

That would be my guess -- I'd bet most people using those functions
don't have regexes in the actual strings being commented/uncommented.
Though it's certainly understandable given how many config, etc files
have regexes in them.

> Perhaps the built-in escaping in
> sed() should only escape non-escaped slashes?  I'm not sure that wouldn't
> have some other side effect, but it might work.

Escaping/quoting in general has been a big pain with Fabric, since we
wrap so many shell related things. The deeper you go the more oddball
corner cases you find.

In this particular case I think I'd probably just opt for applying the
escaping uniformly and expecting the user to do any additional
escaping, instead of risking further potential craziness. At least,
until an overall re-examination of escaping, which is planned at some
point.

At any rate, I've documented this in ticket #250:

    http://code.fabfile.org/issues/show/250

Best,
Jeff

-- 
Jeff Forcier
Unix sysadmin; Python/Ruby engineer
http://bitprophet.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]