{
  "schemaVersion": "ebb.rule.v1",
  "id": "python.symbol.pty.master-open",
  "ecosystem": "python",
  "purl": "pkg:generic/python",
  "affectedVersions": "vers:pypi/>=3.12",
  "event": "deprecated",
  "severity": "low",
  "title": "pty.master_open and slave_open are deprecated",
  "summary": "Python 3.12 gives the undocumented pty.master_open() and pty.slave_open() a DeprecationWarning, to be removed in Python 3.14.",
  "replacement": "pty.openpty()",
  "sources": [
    {
      "title": "What's New in Python 3.12",
      "url": "https://docs.python.org/3/whatsnew/3.12.html",
      "accessedAt": "2026-10-21"
    },
    {
      "title": "Python deprecations: pending removal in 3.14",
      "url": "https://docs.python.org/3/deprecations/pending-removal-in-3.14.html",
      "accessedAt": "2026-10-21"
    }
  ],
  "provenance": {
    "observedAt": "2026-10-21",
    "reviewedAt": "2026-10-21",
    "reviewer": "arminazimi"
  },
  "migration": {
    "constraints": [
      "Keep the behavior of the call unchanged; check the replacement's argument and return-type differences."
    ],
    "steps": [
      {
        "id": "replace-symbol",
        "title": "Use pty.openpty",
        "instructions": "Replace both calls with a single pty.openpty() that returns the master and slave file descriptors.",
        "targets": "usages"
      }
    ],
    "verification": [
      {
        "command": "python -W error::DeprecationWarning -m pytest",
        "purpose": "Run the tests with deprecation warnings as errors when pytest is used."
      }
    ]
  }
}
