From 2243e025b7c79fe1856aea1820f25bab9f7688c2 Mon Sep 17 00:00:00 2001 From: Manuel Barkhau Date: Thu, 13 May 2021 18:17:50 +0000 Subject: [PATCH] fix false positive lint issue --- src/bumpver/vcs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bumpver/vcs.py b/src/bumpver/vcs.py index 88c3fef..04aa5c0 100644 --- a/src/bumpver/vcs.py +++ b/src/bumpver/vcs.py @@ -151,7 +151,11 @@ class VCSAPI: self('commit', env=env, message=message) else: message_data = message.encode("utf-8") - tmp_file = tempfile.NamedTemporaryFile("wb", delete=False) + + # The tmp_file must exist for the duration of the commit command, + # but also must be flushed and closed before the command runs. + # pylint:disable=consider-using-with + tmp_file = tempfile.NamedTemporaryFile("wb", delete=False) try: assert " " not in tmp_file.name