From 988f08c36da61f758c9d0bf5cf09dca16c923c80 Mon Sep 17 00:00:00 2001 From: probonopd Date: Sat, 26 Apr 2025 00:26:20 +0200 Subject: [PATCH] Suppress expected timeout after BYE [ci skip] --- updater.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/updater.py b/updater.py index 311b886..2180fb8 100644 --- a/updater.py +++ b/updater.py @@ -327,7 +327,15 @@ if __name__ == "__main__": with open(local_path, 'rb') as f: ftp.storbinary(f'STOR {remote_path}', f, 8192, callback=progress_callback) print(f"\nUploaded {file} to {selected_ip}.") + except ftplib.all_errors as e: + print(f"FTP error: {e}") + + try: ftp.sendcmd("BYE") print(f"Disconnected from {selected_ip}.") except ftplib.all_errors as e: - print(f"FTP error: {e}") + if str(e).strip().lower() == "timed out": + # Suppress expected timeout after BYE + print(f"Disconnected from {selected_ip}.") + else: + print(f"FTP error after BYE: {e}")