Subject: bug#79437: 30.2; world-clock silently and incorrectly parses invalid time zone

From: Eli Zaretskii <[email-masked]>
Date: Sat, 13 Sep 2025 09:31:30 +0300

> From: "Jorge P. de Morais Neto" <[email-masked]>
> Date: Fri, 12 Sep 2025 13:04:32 -0300
> 
> >From `emacs -Q':
> 
> 1. Invoke M-x world-clock to load the required Elisp libraries
> 2. Customize `zoneinfo-style-world-list' to "(("Europe/Pisa" "Pisa"))".
>    Set for session.
> 3. Invoke M-x world-clock again.
> 4. It says "Pisa sexta 12 setembro 15:50 Europe" (current time is 15:50
>    UTC).
> 
> I asked a friend in Pisa the local time and he reported the error.  I
> then realized world-clock said "Europe" instead of "Europe/Pisa".  I
> suspected "Europe/Pisa" is an invalid timezone name, so I looked into
> Gnome settings widget, and indeed Italy's only timezone is
> "Europe/Rome".  I then fixed `zoneinfo-style-world-list'.
> 
> Emacs /silently/ parsed "Europe/Pisa" as "Europe", inducing the user
> into error.  Yes, a previous user error caused the situation, but modern
> UX should detect and report predictable user errors, and typing an
> invalid timezone name is pretty predictable.

AFAIU, it isn't Emacs that silently interprets "Europe/Pisa" as
"Europe", it's your libc time-related functions.  I believe specifying
a non-existent file in timezone invokes undefined behavior, but maybe
Paul has more specific information about that.