Re: [yocto-patches] [wic][PATCH v2 0/4] oe/path: three fixes plus unit coverage
Paul Barker <[email protected]> Fri, 24 Jul 2026 16:04:55 +0100
| Newsgroups | org.yoctoproject.lists.yocto-patches |
|---|---|
| Message-ID | <[email protected]> |
--=-oLLjXIMNcOceIfus6sM1
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
On Fri, 2026-07-24 at 07:50 -0400, Trevor Woerner via
lists.yoctoproject.org wrote:
> This series continues the standalone unit-test work, this time over
> oe/path.py. It follows the same shape the suite settled on: each
> source fix is its own standalone commit, and the green test module
> lands last, so the suite passes at every commit.
>=20
> Three fixes come first, each independent of the others:
>=20
> - __realpath's isdir guard assigns a bare `false`, which is not a
> Python name; when os.path.isdir() raises, the handler meant to
> absorb the error raises NameError instead. Use the builtin False.
> - symlink(force=3DTrue) cleared the destination through remove(), which
> globs its argument; a destination containing glob metacharacters
> could fail to match itself or match unrelated files. Remove the
> literal destination instead.
> - canonicalize('') and canonicalize(None) returned the current
> working directory, because os.path.realpath('') does; a stray
> separator injected a spurious cwd entry too. Skip empty tokens.
>=20
> The final commit adds tests/unit/test_oe_path.py, covering oe/path's
> own logic (join, is_path_parent, symlink, make_relative_symlink,
> canonicalize, which_wild, realpath) and locking in the three fixes.
> Backing any fix out turns the matching test red. The suite is green
> and ruff-clean, and the series passes oe-core's wic oe-selftest with
> no regressions.
>=20
> These same three fixes and their equivalent selftest coverage have now
> landed in OE-core (meta/lib/oe/path.py and oeqa/selftest/liboe.py),
> where oe/path.py originates. wic vendors a copy of that module; this
> series keeps the vendored copy from diverging by carrying the identical
> fixes, with the coverage expressed as wic's own pytest suite.
>=20
> Trevor Woerner (4):
> oe/path: fix bare `false` NameError in __realpath's isdir guard
> oe/path: don't glob-expand the destination in symlink(force=3DTrue)
> oe/path: canonicalize('') should return '' rather than the cwd
> tests/unit/test_oe_path: cover oe/path's own path logic
LGTM, assuming these are direct copies of what was added to OE-core.
Best regards,
--=20
Paul Barker
--=-oLLjXIMNcOceIfus6sM1
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
iIcEABYKAC8WIQSzjPXf5Y1BDWhU2iCrY1Tsnbr0bgUCamN/FxEccGF1bEBwYmFy
a2VyLmRldgAKCRCrY1Tsnbr0bktmAP9zkAd9k6sqDVN16ShnjIZh8Lb4e1nGGziM
4Z6u6+q50wEA37V1kZIgVpgygKnAoaq9bd3IQ+dpxW3U9ww8tm6RQwM=
=og9e
-----END PGP SIGNATURE-----
--=-oLLjXIMNcOceIfus6sM1--