Skip to content

Commit 499c260

Browse files
committed
Merge pull request #481 from keflavich/simbad_unicode
Simbad.simbad returns bytes objects.
2 parents c0fdb4e + 79b08cc commit 499c260

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

astroquery/alma/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def stage_data(self, uids):
228228
payload = {'dataset':['ALMA+'+clean_uid(uid) for uid in uids]}
229229
log.debug("First request payload: {0}".format(payload))
230230

231-
self._staging_log = {}
231+
self._staging_log = {'first_post_url':url}
232232

233233
# Request staging for the UIDs
234234
# This component cannot be cached, since the returned data can change

astroquery/simbad/core.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -892,17 +892,20 @@ def nb_errors(self):
892892
class SimbadVOTableResult(SimbadResult):
893893
"""VOTable-type Simbad result"""
894894
def __init__(self, txt, verbose=False, pedantic=False):
895-
SimbadResult.__init__(self, txt, verbose=verbose)
896895
self.__pedantic = pedantic
897896
self.__table = None
898-
if not self.verbose:
897+
if not verbose:
899898
commons.suppress_vo_warnings()
899+
super(SimbadVOTableResult, self).__init__(txt, verbose=verbose)
900900

901901

902902
@property
903903
def table(self):
904904
if self.__table is None:
905-
self.__table = votable.parse_single_table(BytesIO(self.data.encode('utf8')), pedantic=False).to_table()
905+
self.bytes = BytesIO(self.data.encode('utf8'))
906+
tbl = votable.parse_single_table(self.bytes, pedantic=False)
907+
self.__table = tbl.to_table()
908+
self.__table.convert_bytestring_to_unicode()
906909
return self.__table
907910

908911
bibcode_regex = re.compile(r'query\s+bibcode\s+(wildcard)?\s+([\w]*)')

0 commit comments

Comments
 (0)