Re: Dependencies should include "realpath"

Subject: Re: Dependencies should include "realpath"

Date: Tue, 20 Oct 2020 16:54:38 +0200

To: notmuch@notmuchmail.org

Cc:

From: Ralph Seichter


* Tomi Ollila:

>> rsti_dir = os.path.abspath('emacs')
>
> Good suggestion, anyway, the simplest change would be just:
>
> -  printf "rsti_dir = '%s'\n" $(realpath emacs)
> +  printf "rsti_dir = '%s'\n" $(cd emacs && pwd -P)

Looks like "pwd -P" is part of the Open Group base spec for pwd, so it
should be available on supported platforms.

> Then, just for the record, I think open(rsti_dir+'/'+file) is fine,
> and I don't see it failing on any imaginable system notmuch work
> (now?;)

As they say, you have the right to your opinion. ;-) I don't think it is
"fine" at all. While rsti_dir+'/'+file may work, depending on the
platform used, os.path.join(rsti_dir, file) *will* work.

Quoting Python's "os" description, first sentence: "This module provides
a portable way of using operating system dependent functionality." I see
no viable reason not to use "os".

> I am even personally changing some os.path.join(...) commands to use
> that concatenation instead, just to reduce complexity and line count
> elsewhere...

I am sorry to hear that. There is nothing complex about using os.path,
and as far as I am concerned, correctness and ease of maintenance beats
a reduced line count every single time.

-Ralph
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: