Fix upload

This commit is contained in:
Kumi 2023-01-09 17:51:26 +00:00
parent 04f35d301f
commit 4cedbfd5fc
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -18,11 +18,11 @@ if __name__ == "__main__":
try:
raw = newfile.read_text()
encrypted: str = GPG().encrypt(raw, config.server.theirkey, sign=config.server.ourkey)
upfl = BytesIO(encrypted.encode())
upfl = BytesIO(encrypted.data)
uppath = Path(config.server.inpath) / f"{directory.name}_{newfile.name}.pgp"
with config.server.get_sftp_client() as sftp:
sftp.putfo(upfl, uppath)
sftp.putfo(upfl, str(uppath))
if directory.sourcebackup:
newfile.rename(Path(directory.sourcebackup) / newfile.name)