{"record":{"id":"f7252532f07b0565","repo":"pytest-dev/pytest","slug":"xxx-win32","errorCode":null,"errorMessage":"XXX win32","messagePattern":"XXX win32","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"src/_pytest/_py/path.py","lineNumber":222,"sourceCode":"    if TYPE_CHECKING:\n\n        @property\n        def size(self) -> int: ...\n\n        @property\n        def mtime(self) -> float: ...\n\n    def __getattr__(self, name: str) -> Any:\n        return getattr(self._osstatresult, \"st_\" + name)\n\n    def __init__(self, path, osstatresult):\n        self.path = path\n        self._osstatresult = osstatresult\n\n    @property\n    def owner(self):\n        if iswin32:\n            raise NotImplementedError(\"XXX win32\")\n        import pwd\n\n        entry = error.checked_call(pwd.getpwuid, self.uid)  # type:ignore[attr-defined,unused-ignore]\n        return entry[0]\n\n    @property\n    def group(self):\n        \"\"\"Return group name of file.\"\"\"\n        if iswin32:\n            raise NotImplementedError(\"XXX win32\")\n        import grp\n\n        entry = error.checked_call(grp.getgrgid, self.gid)  # type:ignore[attr-defined,unused-ignore]\n        return entry[0]\n\n    def isdir(self):\n        return S_ISDIR(self._osstatresult.st_mode)\n","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/pytest-dev/pytest/blob/0d6fbdeffa57c796123f62f81f7dd370d9b7ecdc/src/_pytest/_py/path.py#L204-L240","documentation":"The Stat.owner property returns the owning username by calling pwd.getpwuid on the file's uid. On Windows there is no pwd module and no Unix uid concept, so the property raises NotImplementedError('XXX win32') at the top of the method. This is a known platform limitation of the legacy py.path.local API. The message is a placeholder indicating the feature was never implemented for Windows.","triggerScenarios":"Calling path.stat().owner on Windows (sys.platform == 'win32' or os._name == 'nt'). Triggered at Stat.owner (src/_pytest/_py/path.py:219-222). On POSIX this code path is never reached.","commonSituations":"Running a test suite that worked on Linux/macOS on a Windows CI runner; asserting ownership in cross-platform tests; legacy py.path.local code that assumed Unix.","solutions":["Use pathlib + os module cross-platform: on Windows, owner resolution needs pywin32 or ctypes calls (GetFileSecurity).","Skip the ownership assertion on Windows: `if sys.platform != 'win32': assert stat.owner == expected`.","Use pytest.skip on Windows for tests that exercise Unix ownership semantics."],"exampleFix":"# before\nassert path.stat().owner == 'beagle'\n# after\nimport sys, pytest\nif sys.platform == 'win32':\n    pytest.skip('owner not supported on Windows')\nassert path.stat().owner == 'beagle'","handlingStrategy":"validation","validationCode":"import sys\ndef can_resolve_owner() -> bool:\n    return sys.platform != 'win32' and getattr(sys, 'platform', '') != 'win32'\n# usage\nif can_resolve_owner():\n    assert path.stat().owner == expected_owner\nelse:\n    # Windows: owner not supported by py.path.local\n    pass","typeGuard":"import sys\ndef supports_unix_owner() -> bool:\n    return sys.platform != 'win32'","tryCatchPattern":null,"preventionTips":["Guard owner assertions with sys.platform != 'win32'.","Use pytest.skip on Windows for Unix-ownership tests.","Migrate to pathlib; resolve ownership via pywin32 on Windows."],"tags":["pytest","localpath","py-path","windows","platform","legacy"],"backgroundTag":null,"analyzedSha":"0d6fbdeffa57c796123f62f81f7dd370d9b7ecdc","analyzedAt":"2026-08-11T20:52:36.969Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}