mirror of https://github.com/ecmwf/eccodes.git
Open GRIB files in binary mode, relevant for Python 3
This commit is contained in:
parent
75069268a3
commit
922a646619
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue