From 822e8645ebf7884ddd9563f29925cf25a4b2c2f7 Mon Sep 17 00:00:00 2001 From: Robert Hillis Date: Sun, 1 Aug 2021 04:08:39 -0400 Subject: [PATCH] Fix file path error in nfandroidtv (#53814) --- homeassistant/components/nfandroidtv/notify.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/components/nfandroidtv/notify.py b/homeassistant/components/nfandroidtv/notify.py index c2a42760aec..8cc1b0031f7 100644 --- a/homeassistant/components/nfandroidtv/notify.py +++ b/homeassistant/components/nfandroidtv/notify.py @@ -201,8 +201,7 @@ class NFAndroidTVNotificationService(BaseNotificationService): if local_path is not None: # Check whether path is whitelisted in configuration.yaml if self.is_allowed_path(local_path): - with open(local_path, "rb") as path_handle: - return path_handle + return open(local_path, "rb") # pylint: disable=consider-using-with _LOGGER.warning("'%s' is not secure to load data from!", local_path) else: _LOGGER.warning("Neither URL nor local path found in params!")