py3: io.open takes a numeric buffering argument at index 2
authorGarming Sam <garming@catalyst.net.nz>
Thu, 21 Feb 2019 02:11:39 +0000 (15:11 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 12 Mar 2019 00:42:20 +0000 (00:42 +0000)
It's unsure why this doesn't fail generically, but it fails on my machine sometimes...

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/gp_parse/gp_csv.py

index 9e188db47b58b8a380080c935881216db30b48d1..e436c1b5bd237b781e92ec307d80c2f8809bfc68 100644 (file)
@@ -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)