mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-21 03:55:27 +00:00
probably more useful debug info
This commit is contained in:
parent
ec92f0362d
commit
183ee10035
@ -107,6 +107,8 @@ def parse_options(argv, config=None):
|
||||
return config
|
||||
|
||||
def parse_or_exit_with_explanation(argv, stdout=sys.stdout):
|
||||
with open("argv-debug.txt", "wt") as f:
|
||||
print(repr(argv), file=f)
|
||||
config = Options()
|
||||
try:
|
||||
parse_options(argv, config=config)
|
||||
@ -119,8 +121,7 @@ def parse_or_exit_with_explanation(argv, stdout=sys.stdout):
|
||||
msg = e.args[0].decode(get_io_encoding())
|
||||
except Exception:
|
||||
msg = repr(e)
|
||||
for f in stdout, open("debug.txt", "wb"):
|
||||
print("%s: %s\n" % (sys.argv[0], quote_output(msg, quotemarks=False)), file=f)
|
||||
print("%s: %s\n" % (sys.argv[0], quote_output(msg, quotemarks=False)), file=stdout)
|
||||
sys.exit(1)
|
||||
return config
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user