@@ -583,15 +583,16 @@ def get_spectra_async(self, coordinates=None, radius=2. * u.arcsec,
583583 # - run2d sometimes (#739)
584584 if isinstance (row ['run2d' ], bytes ):
585585 run2d = row ['run2d' ].decode ()
586+ elif isinstance (row ['run2d' ], (np .integer , int )):
587+ run2d = str (run2d )
586588 else :
587589 run2d = row ['run2d' ]
588590 if data_release > 15 and run2d not in ('26' , '103' , '104' ):
589- linkstr .replace ('/spectra/' , '/spectra/full/' )
591+ linkstr = linkstr .replace ('/spectra/' , '/spectra/full/' )
590592 link = linkstr .format (
591593 base = conf .sas_baseurl , dr = data_release ,
592594 run2d = run2d , plate = row ['plate' ],
593595 fiber = row ['fiberID' ], mjd = row ['mjd' ])
594-
595596 results .append (commons .FileContainer (link ,
596597 encoding = 'binary' ,
597598 remote_timeout = timeout ,
@@ -860,9 +861,12 @@ def _parse_result(self, response, verbose=False):
860861
861862 if 'error_message' in io .BytesIO (response .content ):
862863 raise RemoteServiceError (response .content )
864+ skip_header = 0
865+ if response .content .startswith ('#Table' ):
866+ skip_header = 1
863867 arr = np .atleast_1d (np .genfromtxt (io .BytesIO (response .content ),
864868 names = True , dtype = None ,
865- delimiter = ',' , skip_header = 1 ,
869+ delimiter = ',' , skip_header = skip_header ,
866870 comments = '#' ))
867871
868872 if len (arr ) == 0 :
0 commit comments