Skip to content

Commit 8986b98

Browse files
committed
Open CSV tempfile in text mode.
Prevents TypeError in 'writerow()' on Py3k. Fixes googleapis#1071.
1 parent 6f1debf commit 8986b98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

system_tests/bigquery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def test_load_table_from_storage_then_dump_table(self):
265265
blob = bucket.blob(BLOB_NAME)
266266
self.to_delete.insert(0, blob)
267267

268-
with tempfile.TemporaryFile() as csv_file:
268+
with tempfile.TemporaryFile(mode='w+') as csv_file:
269269
writer = csv.writer(csv_file)
270270
writer.writerow(('Full Name', 'Age'))
271271
writer.writerows(ROWS)

0 commit comments

Comments
 (0)