File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 3131def _get_metadata_xml_for_field (root_xml , field_name ):
3232 if "'" in field_name :
3333 field_name = sax .escape (field_name , {"'" : "'" })
34- xpath = ".//metadata-record[@class='column'][local-name='{}']" .format (field_name )
34+ xpath = u ".//metadata-record[@class='column'][local-name='{}']" .format (field_name )
3535 return root_xml .find (xpath )
3636
3737
Original file line number Diff line number Diff line change @@ -199,4 +199,9 @@ def _read_description(xmldata):
199199 if description is None :
200200 return None
201201
202- return u'{}' .format (ET .tostring (description , encoding = 'utf-8' )) # This is necessary for py3 support
202+ description_string = ET .tostring (description , encoding = 'utf-8' )
203+ # Format expects a unicode string so in Python 2 we have to do the explicit conversion
204+ if isinstance (description_string , bytes ):
205+ description_string = description_string .decode ('utf-8' )
206+
207+ return description_string
You can’t perform that action at this time.
0 commit comments