{"record":{"id":"c51b522ac51ebbed","repo":"tensorflow/models","slug":"download-extraction-failed-for-url-s-to-path-s","errorCode":null,"errorMessage":"Download/extraction failed for url %s to path %s","messagePattern":"Download/extraction failed for url (.+?) to path (.+?)","errorType":"exception","errorClass":"OSError","httpStatus":null,"severity":"error","filePath":"official/legacy/transformer/data_download.py","lineNumber":215,"sourceCode":"    logging.info(\"Already downloaded and extracted %s.\", url)\n    return input_file, target_file\n\n  # Download archive file if it doesn't already exist.\n  compressed_file = download_from_url(path, url)\n\n  # Extract compressed files\n  logging.info(\"Extracting %s.\", compressed_file)\n  with tarfile.open(compressed_file, \"r:gz\") as corpus_tar:\n    corpus_tar.extractall(path)\n\n  # Return file paths of the requested files.\n  input_file = find_file(path, input_filename)\n  target_file = find_file(path, target_filename)\n\n  if input_file and target_file:\n    return input_file, target_file\n\n  raise OSError(\"Download/extraction failed for url %s to path %s\" %\n                (url, path))\n\n\ndef txt_line_iterator(path):\n  \"\"\"Iterate through lines of file.\"\"\"\n  with tf.io.gfile.GFile(path) as f:\n    for line in f:\n      yield line.strip()\n\n\ndef compile_files(raw_dir, raw_files, tag):\n  \"\"\"Compile raw files into a single file for each language.\n\n  Args:\n    raw_dir: Directory containing downloaded raw files.\n    raw_files: Dict containing filenames of input and target data.\n      {\"inputs\": list of files containing data in input language\n       \"targets\": list of files containing corresponding data in target language","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/legacy/transformer/data_download.py#L197-L233","documentation":"Error \"Download/extraction failed for url %s to path %s\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/legacy/transformer/data_download.py:215 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}