Open GRIB files in binary mode, relevant for Python 3

This commit is contained in:
Alessandro Amici 2019-04-08 10:33:39 +02:00 committed by GitHub
parent 75069268a3
commit 922a646619
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -388,7 +388,7 @@ class TestBufrMessage(unittest.TestCase):
"""Message can be serialized to file."""
with BufrFile(TESTBUFR) as bufr_file:
msg = BufrMessage(bufr_file)
with open(TEST_OUTPUT, "w") as test:
with open(TEST_OUTPUT, "wb") as test:
msg.write(test)
os.unlink(TEST_OUTPUT)
@ -439,7 +439,7 @@ class TestBufrMessage(unittest.TestCase):
bufr['unexpandedDescriptors'] = ivalues
bufrin.unpack()
bufrin.copy_data(bufr)
with open(TEST_OUTPUT, 'w') as test:
with open(TEST_OUTPUT, 'wb') as test:
bufr.write(test)
os.unlink(TEST_OUTPUT)