One function

InTemporaryDirectory in pypa/auditwheel

The author described this change as fix: resolve path of InTemporaryDirectory name (#569). It counts as a record because the check below fails on the code as it stood at a67aa8726 and passes on a6f2bd70b, with nothing else changed between the two runs.

Fix saved2025-04-05
Sharing licenceMIT · LICENSE
Change size+6 4

What the code was meant to do, written into the code itself as a docstring

Create, return, and change directory to a temporary directory Examples --------

The change

1717
1818 def __init__(self) -> None:
1919 self._tmpdir = TemporaryDirectory()
20+ self._name = Path(self._tmpdir.name).resolve(strict=True)
2021
2122 @property
2223 def name(self) -> Path:
23- return Path(self._tmpdir.name)
24+ return self._name
2425
2526 def __enter__(self) -> Path:
2627 self._pwd = Path.cwd()
27- os.chdir(self._tmpdir.name)
28- return Path(self._tmpdir.__enter__())
28+ os.chdir(self._name)
29+ self._tmpdir.__enter__()
30+ return self._name
2931
3032 def __exit__(
3133 self,
3436 tb: TracebackType | None,
3537 ) -> None:
3638 os.chdir(self._pwd)
37- return self._tmpdir.__exit__(exc, value, tb)
39+ self._tmpdir.__exit__(exc, value, tb)

The check that tells the two apart

failpass·tests/unit/test_wheeltools.py::test_inwheel_tmpdir

Check file tests/unit/test_wheeltools.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before ita67aa872656c49b87867a9e89d8d0de832e108cd
Broken version dated2025-04-05
Moduleauditwheel.tmpdirs
Units changedInTemporaryDirectory
Fingerprintff52d8f130b93d63
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in pypa/auditwheel