Required encoding a str to bytes and writing bytes to a file
descriptor.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
Required encoding a str to bytes and writing bytes to a file
descriptor.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | tests/dummyssh (4 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Needs Revision | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg |
if sys.argv[1] != "user@dummy": | if sys.argv[1] != "user@dummy": | ||||
sys.exit(-1) | sys.exit(-1) | ||||
os.environ["SSH_CLIENT"] = "%s 1 2" % os.environ.get('LOCALIP', '127.0.0.1') | os.environ["SSH_CLIENT"] = "%s 1 2" % os.environ.get('LOCALIP', '127.0.0.1') | ||||
log = open("dummylog", "ab") | log = open("dummylog", "ab") | ||||
log.write(b"Got arguments") | log.write(b"Got arguments") | ||||
for i, arg in enumerate(sys.argv[1:]): | for i, arg in enumerate(sys.argv[1:]): | ||||
log.write(b" %d:%s" % (i + 1, arg)) | log.write(b" %d:%s" % (i + 1, arg.encode('latin1'))) | ||||
log.write("\n") | log.write(b"\n") | ||||
log.close() | log.close() | ||||
hgcmd = sys.argv[2] | hgcmd = sys.argv[2] | ||||
if os.name == 'nt': | if os.name == 'nt': | ||||
# hack to make simple unix single quote quoting work on windows | # hack to make simple unix single quote quoting work on windows | ||||
hgcmd = hgcmd.replace("'", '"') | hgcmd = hgcmd.replace("'", '"') | ||||
r = os.system(hgcmd) | r = os.system(hgcmd) | ||||
sys.exit(bool(r)) | sys.exit(bool(r)) |