[Svnmerge] svnmerge.py breaks in cron

Dustin J. Mitchell dustin at zmanda.com
Wed Oct 24 12:08:21 PDT 2007


On 10/24/07, Giovanni Bajo <rasky at develer.com> wrote:
> sys.stdin.isatty() is clearer IMO. All in all, maybe only try/except is
> sufficient though...

Well, first, stdin isn't what we want -- stdout is.  Second,
sys.stdout is not necessarily fd 1, which is what stty will look at.
Third, svnmerge_test.py replaces stdout with a cStringIO object, which
doesn't have an isatty method.

As for just using try/except: os.popen doesn't trap stderr, so ideally
we'll avoid running stty in cases where we know it will fail, to avoid
dumping spurious messages to the user's terminal.

> os.putenv() changes also the environment for the whole svnmerge process
> (it would be better to modify it only for the child process, but that
> can be done only with subprocess.py). Is that really required? Don't we
> do already the same for controlling the output of "svn" itself?

Yes, sorry.  I'll remove that.

Dustin

-- 
Storage Software Engineer
http://www.zmanda.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stty-term.patch
Type: application/octet-stream
Size: 801 bytes
Desc: not available
Url : /pipermail/svnmerge/attachments/20071024/36d82d24/attachment.obj 


More information about the Svnmerge mailing list