From 38ed189e1830e8467962eabbac28a1b17ba55244 Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Sat, 2 Dec 2023 16:47:09 +0100 Subject: [PATCH 1/4] d/changelog --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 93ecbbd..c9fd109 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -localslackirc (1.24-1) UNRELEASED; urgency=medium +localslackirc (1.24-1) unstable; urgency=low * New upstream release - -- Salvo 'LtWorf' Tomaselli Mon, 20 Nov 2023 20:06:54 +0100 + -- Salvo 'LtWorf' Tomaselli Sat, 02 Dec 2023 16:46:36 +0100 localslackirc (1.23-1) unstable; urgency=low From 4600ae9d5bb7df4d216161a917a5281f5306d925 Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Mon, 29 Jan 2024 16:03:31 +0100 Subject: [PATCH 2/4] Fix crash when sending a non-existing file Closes: #448 --- irc.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/irc.py b/irc.py index 5cf2887..9c27809 100644 --- a/irc.py +++ b/irc.py @@ -1,5 +1,5 @@ # localslackirc -# Copyright (C) 2018-2023 Salvo "LtWorf" Tomaselli +# Copyright (C) 2018-2024 Salvo "LtWorf" Tomaselli # # localslackirc is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -432,9 +432,12 @@ async def _sendfilehandler(self, cmd: bytes) -> None: await self._sendreply(Replies.ERR_UNKNOWNCOMMAND, 'Syntax: /sendfile #channel filename') return - with open(filename, 'rb') as f: - content = f.read() - await self.send_file(params[1], content=content, filename=filename) + try: + with open(filename, 'rb') as f: + content = f.read() + await self.send_file(params[1], content=content, filename=filename) + except Exception as e: + await self._sendreply(Replies.ERR_FILEERROR, f'Error: {e}') async def send_file(self, bchannel_name: bytes, content: bytes, filename: str) -> bool: From 735492b813b6fb3fecc3b99207b894d16b65c5ac Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Mon, 29 Jan 2024 16:09:36 +0100 Subject: [PATCH 3/4] Bump version --- CHANGELOG | 3 +++ debian/changelog | 6 ++++++ irc.py | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index c6c7b3d..e84f7bc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +1.25 + + 1.24 * Add /dropautoreact command * Add /listautoreact command diff --git a/debian/changelog b/debian/changelog index c9fd109..d87040f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +localslackirc (1.25-1) UNRELEASED; urgency=medium + + * New upstream release + + -- Salvo 'LtWorf' Tomaselli Mon, 29 Jan 2024 16:08:41 +0100 + localslackirc (1.24-1) unstable; urgency=low * New upstream release diff --git a/irc.py b/irc.py index 9c27809..43a2af1 100644 --- a/irc.py +++ b/irc.py @@ -40,7 +40,7 @@ from diff import seddiff -VERSION = '1.24' +VERSION = '1.25' class IrcDisconnectError(Exception): ... From 5e4a41f345131e9fdfc57d1aee8ea34433d549ce Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Mon, 29 Jan 2024 16:10:02 +0100 Subject: [PATCH 4/4] CHANGELOG --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index e84f7bc..3b0ac4a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,5 @@ 1.25 - +* Fix crash when sending a non existing file 1.24 * Add /dropautoreact command