The three Linux distributions available for WSL at present are Ubuntu 16.04, openSUSE 42.3, and SUSE Linux Enterprise Server 12. Having tested on all three, the issue is only present on WSL when running openSUSE (i.e. there doesn't seem to be any issues on Ubuntu and SLES).
On openSUSE only:
$ ls /usr/share/zoneinfo
Msft
Msft is in all, but it is the only thing in openSUSE.
here is where Django tries to verify the timezone and would raise a ValueError
if /usr/share/zoneinfo
exists, but doesn't contain anything for the specified timezone.
Upon further investigation, I stumbled across this, specifically:
Apparently, /usr/share/zoneinfo
is missing from a (minimal) openSUSE installation...
I assume this is why none of the other timezones are there (Microsoft seemingly still adds theirs regardless, hence why /usr/share/zoneinfo/Msft
and hence /usr/share/zoneinfo
would still exist).
Installing the timezone
package (zypper install timezone
), as the aforementioned link suggests, will add them, which would allow Django to not fail on other time zones. I would suggest using that as a fix for the reporter and anyone else with a similar issue.
If there is any desire to make any changes to Django itself for this issue, then I'd suggest changing the validation attempts to further determine if that folder can be relied on.