Mercurial > hg
comparison mercurial/hbisect.py @ 23324:69f86b937035
cmdserver: protect pipe server streams against corruption caused by direct io
Because pipe-mode server uses stdio as IPC channel, other modules should not
touch stdio directly and use ui instead. However, this strategy is brittle
because several Python functions read and write stdio implicitly.
print 'hello' # should use ui.write()
# => ch = 'h', size = 1701604463 'ello', data = '\n'
This patch adds protection for such mistakes. Both stdio files and low-level
file descriptors are redirected to /dev/null while command server uses them.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 15 Nov 2014 13:50:43 +0900 |
parents | 1c46b18b0e1c |
children | 7cc77030c557 |
comparison
equal
deleted
inserted
replaced
23323:bc374458688b | 23324:69f86b937035 |
---|