From 480b9746fc91e73c929a0b70b58472ed5cce6f1b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tom=C3=A1=C5=A1=20Virtus?= Date: Wed, 19 Feb 2020 15:14:30 +0100 Subject: [PATCH] Fix duplicate Syslinux entries (2) Commit f0e3c936 changed open mode to "r+", but this mode does not create missing files. Revert open mode back to "a+" and add seek to beginning of the file. --- grml2usb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grml2usb b/grml2usb index 5a94e10..6cf456a 100755 --- a/grml2usb +++ b/grml2usb @@ -1323,7 +1323,8 @@ def add_entry_if_not_present(filename, entry): @filename: name of the file @entry: data to write to the file """ - data = open(filename, "r+") + data = open(filename, "a+") + data.seek(0) for line in data: if line == entry: break -- 2.1.4