File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
tests/gis_tests/gdal_tests Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -82,8 +82,13 @@ def num_fields(self):
82
82
@property
83
83
def fields (self ):
84
84
"Return a list of fields in the Feature."
85
- return [capi .get_field_name (capi .get_field_defn (self ._layer ._ldefn , i ))
86
- for i in range (self .num_fields )]
85
+ return [
86
+ force_text (
87
+ capi .get_field_name (capi .get_field_defn (self ._layer ._ldefn , i )),
88
+ self .encoding ,
89
+ strings_only = True
90
+ ) for i in range (self .num_fields )
91
+ ]
87
92
88
93
@property
89
94
def geom (self ):
Original file line number Diff line number Diff line change @@ -195,6 +195,7 @@ def test04_features(self):
195
195
# Making sure we get the proper OGR Field instance, using
196
196
# a string value index for the feature.
197
197
self .assertIsInstance (feat [k ], v )
198
+ self .assertIsInstance (feat .fields [0 ], str )
198
199
199
200
# Testing Feature.__iter__
200
201
for fld in feat :
You can’t perform that action at this time.
0 commit comments