Open anarcat opened 10 years ago
workaround:
diff --git a/main.py b/main.py
index 45a0e8a..e244da5 100755
--- a/main.py
+++ b/main.py
@@ -126,7 +126,7 @@ def subpath(s):
usage('error: unknown command "%s"' % subcmd_name)
already_fixed = atoi(os.environ.get('BUP_FORCE_TTY'))
-if subcmd_name in ['mux', 'ftp', 'help']:
+if subcmd_name in ['mux', 'ftp', 'help', 'cron']:
already_fixed = True
fix_stdout = not already_fixed and os.isatty(1)
fix_stderr = not already_fixed and os.isatty(2)
the way that bup handles stdout/stderr is a little exotic. it seems to reopen file descriptors under certain circumstances.
this makes it difficult to make subcommands that want to process logging or handle those file descriptors differently. for example, i worked on a wrapper for index/save that redirects stdout to /dev/null (if not verbose) and stderr to a file for logging.
this yields various errors in the logs:
now this may be a bug in python itself: http://bugs.python.org/issue11380
but it's unclear to me while those file descriptors are being messed with.