def download_listing(dest):
    """Download the latest RETF listing from Wikipedia."""
    logger = logging.getLogger('retf')
    try:
        url = ('https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/'
               'Typos?action=raw')
        logger.debug("Downloading latest RETF listing from %s into %s.",
                     url, dest)
        response = urlreq.urlopen(url)
        data = response.read()
        logger.info("Downloading latest RETF listing from %s succeeded.", url)
    except urlerr.HTTPError as ex:
        raise DownloadRetfListingFailed(six.text_type(ex))
    except urlerr.URLError as ex:
        raise DownloadRetfListingFailed(six.text_type(ex))

    try:
        with open(dest, 'w+') as write:
            write.write(data)
        logger.info("Writing RETF listing to file %s succeeded.", dest)
    except __HOLE__ as ex:
        raise DownloadRetfListingFailed(six.text_type(ex))
dataset/ETHPy150Open openstack/openstack-doc-tools/cleanup/retf/retf.py/download_listing