Project

General

Profile

« Previous | Next » 

Revision 5150

tnrs.py: tnrs_request(): Use new encode() and TnrsOutputStream to escape TNRS-invalid characters

View differences:

lib/tnrs.py
142 142
    try:
143 143
        debug_log('Submit')
144 144
        request = submission_request_template.replace('[names]',
145
            r'\\n'.join(map(gwt_encode, names))) # double-escape \n
145
            gwt_encode('\n'.join(map(encode, names))))
146 146
        response, response_info = do_request(request)
147 147
        key, = parse_response('submission', submission_response_pattern, response,
148 148
            response, response_info)
......
174 174
        debug_log('Download')
175 175
        response = urllib2.urlopen(urllib2.Request(csv_url))
176 176
        debug_log('response info', str(response.info()))
177
        return response
177
        return TnrsOutputStream(response)
178 178
    finally:
179 179
        profiler.stop(name_ct)
180 180
        sys.stderr.write(profiler.msg()+'\n')

Also available in: Unified diff