[Svnmerge] svnmerge.py breaks in cron

Archie Cobbs archie at dellroad.org
Wed Oct 24 08:36:16 PDT 2007


On 10/24/07, Dustin J. Mitchell <dustin at zmanda.com> wrote:
>
> On 10/23/07, Eric Kolve <ekolve at gmail.com> wrote:
> > I tried running svnmerge.py trunk inside of a cron job and it failed
> with this:
> >
> > stty: standard input: Invalid argument
> >
> >
> > I traced it back to this block of code:
> >
> >     # Parse the output of stty -a
> >     out = os.popen("stty -a").read()
> >     m = re.search(r"columns (\d+);", out)
> >     if m:
> >         return int(m.group(1))
> >
> > I think the best thing might be to check if the TERM environment var
> > is set before attempting this.
>
> Good catch.  Patch attached -- any thoughts?



In C code the way to check for this is using the isatty(3) function... in
python there may be an equivalent wrapper function. This would be a (very
slightly) better way to check.


-- 
Archie L. Cobbs
CTO, Awarix, Inc.
http://www.awarix.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/svnmerge/attachments/20071024/449f136f/attachment.html>


More information about the Svnmerge mailing list