'Fetch data from URL. If options.useSubprocess is True, spawn
subprocess for fetching.
@see HTTPFetcher.staticFetch() for parameter description
@throws: anything staticFetch() throws
@throws: HTTPFetcherError in case of problem in subprocess invocation
@throws: cPickle.UnpicklingError when we get garbage from subprocess'

@staticmethod
def _doFetch(url, options, platformPath):

    if (not options.useSubprocess):
        return HTTPFetcher.staticFetch(url, options, platformPath)
    inArgs = FetcherInArgs(url, options, platformPath)
    trampoline = 'from    https_everywhere_checker    import    http_client;    http_client.subprocessFetch()'
    args = [sys.executable, '-c', trampoline]
    p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    (outData, errData) = p.communicate(cPickle.dumps(inArgs))
    exitCode = p.wait()
    if (exitCode != 0):
        raise HTTPFetcherError(('Subprocess    failed    with    exit    code    %d' % exitCode))
    unpickled = cPickle.loads(outData)
    if (not isinstance(unpickled, FetcherOutArgs)):
        raise HTTPFetcherError(('Unexpected    datatype    received    from    subprocess:    %s' % type(unpickled)))
    if unpickled.errorStr:
        assert (unpickled.shortError is not None)
        raise HTTPFetcherError(ErrorSanitizer().fetcher(unpickled.shortError, unpickled.errorStr))
    return unpickled
