From: Garming Sam Date: Thu, 21 Feb 2019 02:11:39 +0000 (+1300) Subject: py3: io.open takes a numeric buffering argument at index 2 X-Git-Tag: talloc-2.2.0~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e231541b48fc97ca013079585ef556efda6cb95;p=thirdparty%2Fsamba.git py3: io.open takes a numeric buffering argument at index 2 It's unsure why this doesn't fail generically, but it fails on my machine sometimes... Signed-off-by: Garming Sam Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/gp_parse/gp_csv.py b/python/samba/gp_parse/gp_csv.py index 9e188db47b5..e436c1b5bd2 100644 --- a/python/samba/gp_parse/gp_csv.py +++ b/python/samba/gp_parse/gp_csv.py @@ -96,7 +96,7 @@ class GPAuditCsvParser(GPParser): def write_binary(self, filename): from io import open - with open(filename, 'w', self.encoding) as f: + with open(filename, 'w', encoding=self.encoding) as f: # In this case "binary" means "utf-8", so we let Python do that. writer = csv.writer(f, quoting=csv.QUOTE_MINIMAL) writer.writerow(self.header)