{
 "action": "Replace the old line with the new one; the rest of the code can stay.",
 "alternatives": [],
 "applicability": {
  "exit_code": 0,
  "line": 2,
  "method": "literal_patch",
  "occurrences": 1,
  "output": "same",
  "patched_sha": "8f24bf51224d",
  "reason": "applied word for word, the patch parses, drops the old names, runs on 1.6.0 and prints what the verified example prints",
  "run_on": "1.6.0",
  "status": "applies"
 },
 "by_notes": true,
 "changelog_ref": {
  "quote": "Unvendor cloudpickle to more quickly benefit from maintenance releases\n  of cloudpickle",
  "url": "https://github.com/joblib/joblib/blob/HEAD/CHANGES.rst"
 },
 "confirmations": {
  "failed": 0,
  "worked": 3
 },
 "detect": [
  "cloudpickle"
 ],
 "ecosystem": "pypi",
 "equivalence": "same",
 "error_kind": "missing_import",
 "error_signature": {
  "message": "cannot import name 'cloudpickle' from 'joblib.externals' (/usr/local/lib/python3.11/site-packages/joblib/externals/__init__.py)",
  "norm": "missing_import:cloudpickle",
  "type": "ImportError"
 },
 "first_seen": "2026-10-26T06:36:45+00:00",
 "format": "replace",
 "format_version": 2,
 "id": "pypi/joblib/1.6.0/0002",
 "kind": "removed",
 "license": "https://creativecommons.org/licenses/by/4.0/",
 "package": "joblib",
 "proof": {
  "applicability": {
   "exit_code": 0,
   "line": 2,
   "method": "literal_patch",
   "occurrences": 1,
   "output": "same",
   "patched_sha": "8f24bf51224d",
   "reason": "applied word for word, the patch parses, drops the old names, runs on 1.6.0 and prints what the verified example prints",
   "run_on": "1.6.0",
   "status": "applies"
  },
  "auto_apply": true,
  "auto_apply_reason": "proof.equivalent is true and the patch applies word for word",
  "auto_apply_rule": "Automatic application is allowed only when proof.equivalent is true and proof.applicability.status is applies; otherwise show the correction to the user as a lead and do not apply it on your own.",
  "equivalence": "same",
  "equivalent": true,
  "fails_on": "1.6.0",
  "fixed_on": "1.6.0",
  "level": "differential",
  "method": {
   "fix_on": "1.6.0",
   "name": "stdout_match",
   "normalization": "lines stripped, blank lines dropped, runs of whitespace collapsed; memory addresses, timestamps and temporary paths masked",
   "original_on": "1.5.3",
   "scope": "the observable stdout of one example script; return values, files, other inputs and exception types are not compared, so a match is not a proof of equivalent behaviour"
  },
  "script_right": "import pickle\nimport cloudpickle\n\n\ndef main():\n    # 1. Define a lambda and a locally defined closure\n    f_lambda = lambda x, y: x**2 + y\n\n    def make_closure(multiplier, offset):\n        def inner(val):\n            return val * multiplier + offset\n\n        return inner\n\n    f_closure = make_closure(multiplier=10, offset=7)\n\n    # 2. Serialize both to bytes using joblib's bundled cloudpickle\n    lambda_bytes = cloudpickle.dumps(f_lambda)\n    closure_bytes = cloudpickle.dumps(f_closure)\n\n    # 3. Load them back using the standard library's pickle module\n    restored_lambda = pickle.loads(lambda_bytes)\n    restored_closure = pickle.loads(closure_bytes)\n\n    # 4. Print results of calling each restored function on sample inputs\n    print(\"Testing restored lambda:\")\n    print(\"restored_lambda(3, 5):\", restored_lambda(3, 5))\n    print(\"restored_lambda(4, -2):\", restored_lambda(4, -2))\n\n    print(\"\\nTesting restored closure:\")\n    print(\"restored_closure(2):\", restored_closure(2))\n    print(\"restored_closure(5):\", restored_closure(5))\n\n\nif __name__ == \"__main__\":\n    main()",
  "script_wrong": "import pickle\nfrom joblib.externals import cloudpickle\n\n\ndef main():\n    # 1. Define a lambda and a locally defined closure\n    f_lambda = lambda x, y: x**2 + y\n\n    def make_closure(multiplier, offset):\n        def inner(val):\n            return val * multiplier + offset\n\n        return inner\n\n    f_closure = make_closure(multiplier=10, offset=7)\n\n    # 2. Serialize both to bytes using joblib's bundled cloudpickle\n    lambda_bytes = cloudpickle.dumps(f_lambda)\n    closure_bytes = cloudpickle.dumps(f_closure)\n\n    # 3. Load them back using the standard library's pickle module\n    restored_lambda = pickle.loads(lambda_bytes)\n    restored_closure = pickle.loads(closure_bytes)\n\n    # 4. Print results of calling each restored function on sample inputs\n    print(\"Testing restored lambda:\")\n    print(\"restored_lambda(3, 5):\", restored_lambda(3, 5))\n    print(\"restored_lambda(4, -2):\", restored_lambda(4, -2))\n\n    print(\"\\nTesting restored closure:\")\n    print(\"restored_closure(2):\", restored_closure(2))\n    print(\"restored_closure(5):\", restored_closure(5))\n\n\nif __name__ == \"__main__\":\n    main()",
  "works_on": "1.5.3"
 },
 "right": "import cloudpickle",
 "seen_in_models": [
  "gemini-3.8-flash",
  "gpt-6.1-sol"
 ],
 "seq": 2,
 "slug": "joblib-externals-cloudpickle",
 "source": "pipeline",
 "symbol": "joblib.externals.cloudpickle",
 "updated": "2026-10-27T17:20:00+00:00",
 "url": "https://formachines.ai/errata/pypi/joblib/0002-joblib-externals-cloudpickle/",
 "variant_confirmations": 3,
 "variant_models": [
  "gemini-3.8-flash",
  "gpt-6.1-sol"
 ],
 "verified": "sandbox",
 "versions": {
  "changed_in": ">1.5.3,<=1.6.0",
  "fails_on": "1.6.0",
  "works_on": "1.5.3"
 },
 "wrong": "from joblib.externals import cloudpickle"
}