@@ -57,7 +57,7 @@ def test_dataset():
57
57
Test the basic functionality of GMT_DATASET.
58
58
"""
59
59
with GMTTempFile (suffix = ".txt" ) as tmpfile :
60
- with Path (tmpfile .name ).open (mode = "w" ) as fp :
60
+ with Path (tmpfile .name ).open (mode = "w" , encoding = "utf-8" ) as fp :
61
61
print (">" , file = fp )
62
62
print ("1.0 2.0 3.0 TEXT1 TEXT23" , file = fp )
63
63
print ("4.0 5.0 6.0 TEXT4 TEXT567" , file = fp )
@@ -75,7 +75,7 @@ def test_dataset_empty():
75
75
Make sure that an empty DataFrame is returned if a file contains no data.
76
76
"""
77
77
with GMTTempFile (suffix = ".txt" ) as tmpfile :
78
- with Path (tmpfile .name ).open (mode = "w" ) as fp :
78
+ with Path (tmpfile .name ).open (mode = "w" , encoding = "utf-8" ) as fp :
79
79
print ("# This is a comment line." , file = fp )
80
80
81
81
df = dataframe_from_gmt (tmpfile .name )
@@ -89,7 +89,7 @@ def test_dataset_header():
89
89
Test parsing column names from dataset header.
90
90
"""
91
91
with GMTTempFile (suffix = ".txt" ) as tmpfile :
92
- with Path (tmpfile .name ).open (mode = "w" ) as fp :
92
+ with Path (tmpfile .name ).open (mode = "w" , encoding = "utf-8" ) as fp :
93
93
print ("# lon lat z text" , file = fp )
94
94
print ("1.0 2.0 3.0 TEXT1 TEXT23" , file = fp )
95
95
print ("4.0 5.0 6.0 TEXT4 TEXT567" , file = fp )
@@ -109,7 +109,7 @@ def test_dataset_header_greater_than_nheaders():
109
109
Test passing a header line number that is greater than the number of header lines.
110
110
"""
111
111
with GMTTempFile (suffix = ".txt" ) as tmpfile :
112
- with Path (tmpfile .name ).open (mode = "w" ) as fp :
112
+ with Path (tmpfile .name ).open (mode = "w" , encoding = "utf-8" ) as fp :
113
113
print ("# lon lat z text" , file = fp )
114
114
print ("1.0 2.0 3.0 TEXT1 TEXT23" , file = fp )
115
115
print ("4.0 5.0 6.0 TEXT4 TEXT567" , file = fp )
@@ -127,7 +127,7 @@ def test_dataset_header_too_many_names():
127
127
Test passing a header line with more column names than the number of columns.
128
128
"""
129
129
with GMTTempFile (suffix = ".txt" ) as tmpfile :
130
- with Path (tmpfile .name ).open (mode = "w" ) as fp :
130
+ with Path (tmpfile .name ).open (mode = "w" , encoding = "utf-8" ) as fp :
131
131
print ("# lon lat z text1 text2" , file = fp )
132
132
print ("1.0 2.0 3.0 TEXT1 TEXT23" , file = fp )
133
133
print ("4.0 5.0 6.0 TEXT4 TEXT567" , file = fp )
0 commit comments