bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnulib-tool.py: Simplify joining paths.


From: Bruno Haible
Subject: Re: gnulib-tool.py: Simplify joining paths.
Date: Sat, 15 Jun 2024 13:35:21 +0200

Hi Collin,

> I never really looked at the joinpath() function so I just realized it
> essentially does os.path.normpath(os.path.join(...)) unlike what it's
> doc string says.

"unlike what the doc string says"? What do you mean by that? The doc string
said "This function also replaces SUBDIR/../ with empty", which is something
that os.path.normpath does but os.path.join doesn't.

> The os.path.normpath() isn't really necessary.

Here I disagree. There are comparisons such as

  lookedup == joinpath(localdir, original)

which may have evaluated to True, whereas

  lookedup == os.path.join(localdir, original)

might evaluate to False, due to incomplete normalization.

> For example, A/./B not being simplified to A/B
> which shouldn't cause any issues building.

Here I disagree as well. Previously the code could assume everywhere
— including in comparisons and in stdout output — that file names are
normalized. Now this is no longer the case, with consequences:
  - Maybe the patch introduced bugs (not caught by the test suite).
  - Surely it will make maintenance harder, because everywhere we deal
    with a file name, we will have to ask ourselves "is it normalized
    or not?"

IMO this patch is a regression, not an improvement of any kind.

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]