handle tempfile.TemporaryFile buffering changes in Python 3
Python 3 renamed the argument from "bufsize" to "buffering" to match
the underlying open function which uses "buffering" in both versions.
Add helpers to handle this minor difference.
BUG=chromium:997354
TEST=`./run_tests` passes, and some more tests pass under Python 3
Change-Id: Idbe5fcc860198e6cc20d7b0a977f71a0872a015e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1789422
Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/upload_symbols.py b/scripts/upload_symbols.py
index d65edc7..ce52ea7 100644
--- a/scripts/upload_symbols.py
+++ b/scripts/upload_symbols.py
@@ -281,8 +281,8 @@
file_size = symbol.FileSize()
if file_limit and symbol.FileSize() > file_limit:
- with tempfile.NamedTemporaryFile(
- prefix='upload_symbols', bufsize=0,
+ with cros_build_lib.UnbufferedNamedTemporaryFile(
+ prefix='upload_symbols',
dir=tempdir, delete=False) as temp_sym_file:
temp_sym_file.writelines(