After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779799 - gdatetime test fails with tzdata 2017a
gdatetime test fails with tzdata 2017a
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.50.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-03-09 10:26 UTC by Jan Alexander Steffens (heftig)
Modified: 2017-03-20 09:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests/gdatetime: Use a real rather than invented timezone (2.00 KB, patch)
2017-03-13 16:57 UTC, Iain Lane
committed Details | Review

Description Jan Alexander Steffens (heftig) 2017-03-09 10:26:02 UTC
GLib:ERROR:gdatetime.c:652:test_GDateTime_new_full: assertion failed ("BRT" == g_date_time_get_timezone_abbreviation (dt)): ("BRT" == "-03")

The tzdata release 2017a seems to have removed the BRT timezone:

$ diff <(curl ftp://ftp.iana.org/tz/tzdb-2016j/southamerica) <(curl ftp://ftp.iana.org/tz/tzdb-2017a/southamerica)

*snip*
 # Pernambuco (PE) (except Atlantic islands)
 Zone America/Recife	-2:19:36 -	LMT	1914
-			-3:00	Brazil	BR%sT	1990 Sep 17
-			-3:00	-	BRT	1999 Sep 30
-			-3:00	Brazil	BR%sT	2000 Oct 15
-			-3:00	-	BRT	2001 Sep 13
-			-3:00	Brazil	BR%sT	2002 Oct  1
-			-3:00	-	BRT
+			-3:00	Brazil	-03/-02	1990 Sep 17
+			-3:00	-	-03	1999 Sep 30
+			-3:00	Brazil	-03/-02	2000 Oct 15
+			-3:00	-	-03	2001 Sep 13
+			-3:00	Brazil	-03/-02	2002 Oct  1
+			-3:00	-	-03
 #
*snip*


glib 2.50.3, tzdata 2017a
Comment 1 Jan Alexander Steffens (heftig) 2017-03-09 11:00:24 UTC
ftp://ftp.iana.org/tz/tzdb-2017a/NEWS says that this is a deliberate change:

> Switch to numeric time zone abbreviations for South America, as
> part of the ongoing project of removing invented abbreviations.
Comment 2 Iain Lane 2017-03-13 16:57:18 UTC
Created attachment 347854 [details] [review]
tests/gdatetime: Use a real rather than invented timezone

The tzdata maintainers had previously invented abbreviations for
timezones. As of their 2017a release, the one we were testing ("BRT")
has been dropped.

Switch to testing PST, which is a real timezone abbreviation.

--

I guess we should test a different timezone, preferably one which exists in the world outside of tzdata. Here's one - what do you think?

I can't test Windows, but I got the name from

  https://msdn.microsoft.com/en-us/library/ms912391(v=winembedded.11).aspx

so I hope it's right.
Comment 3 Philip Withnall 2017-03-13 23:39:28 UTC
Review of attachment 347854 [details] [review]:

::: glib/tests/gdatetime.c
@@ +641,2 @@
 #endif
+  dt = g_date_time_new (tz, 2010, 11, 24, 8, 4, 0);

Why change the month here?
Comment 4 Iain Lane 2017-03-14 09:12:33 UTC
(In reply to Philip Withnall from comment #3)
> Review of attachment 347854 [details] [review] [review]:
> 
> ::: glib/tests/gdatetime.c
> @@ +641,2 @@
>  #endif
> +  dt = g_date_time_new (tz, 2010, 11, 24, 8, 4, 0);
> 
> Why change the month here?

Just so it's PST and not PDT, because I am more confident that will work on Windows.
Comment 5 Philip Withnall 2017-03-14 10:34:19 UTC
Chun-wei Fan, would you mind reviewing this for whether it’s correct and working on Windows?
Comment 6 Fan, Chun-wei 2017-03-15 08:02:54 UTC
Hi Philip,

This seems right and does indeed work on Windows.

p.s. The test on line 963 (TEST_PRINTF ("%Z", "Pacific Standard Time");) does depend on the location/time zone where the program is being run, so I had to change it to "Taipei Standard Time" for it to work, since that is where I am.  Might need to look at how to make this timezone-independent on Windows, but this is a different issue.

With blessings, and cheers!
Comment 7 Philip Withnall 2017-03-15 11:05:32 UTC
Review of attachment 347854 [details] [review]:

Looks good to commit then. Thanks for fixing this.
Comment 8 Philip Withnall 2017-03-15 11:06:34 UTC
(In reply to Fan, Chun-wei from comment #6)
> This seems right and does indeed work on Windows.

Great, thanks for testing.

> p.s. The test on line 963 (TEST_PRINTF ("%Z", "Pacific Standard Time");)
> does depend on the location/time zone where the program is being run, so I
> had to change it to "Taipei Standard Time" for it to work, since that is
> where I am.  Might need to look at how to make this timezone-independent on
> Windows, but this is a different issue.

There’s a setlocale() call at the top of the function to set the locale to ja_JP.eucjp, which should make it independent of the locale in the environment. I guess that doesn’t work on Windows, and we need a follow-up bug report for that.
Comment 9 Philip Withnall 2017-03-15 11:08:04 UTC
Attachment 347854 [details] pushed as ec02a18 - tests/gdatetime: Use a real rather than invented timezone
Comment 10 Michael Biebl 2017-03-19 21:09:12 UTC
Can this please also be pulled into the glib-2-50 branch
Comment 11 Iain Lane 2017-03-20 09:47:51 UTC
(In reply to Michael Biebl from comment #10)
> Can this please also be pulled into the glib-2-50 branch

Looks like this was done as 3abb760e57888e23e2b8371293895d425608416c