Skip to content

Commit 7286ae9

Browse files
committed
SIMBAD: return strings in python3 instead of bytes
(plus a really minor edit to ALMA logging)
1 parent c0fdb4e commit 7286ae9

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

astroquery/alma/core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ def stage_data(self, uids):
226226
#'ALMA+uid___A002_X391d0b_X7b'
227227
#payload = [('dataset','ALMA+'+clean_uid(uid)) for uid in uids]
228228
payload = {'dataset':['ALMA+'+clean_uid(uid) for uid in uids]}
229+
self._staging_log['first_post_url'] = url
229230
log.debug("First request payload: {0}".format(payload))
230231

231232
self._staging_log = {}

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)