Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gettz('') result is incorrect per the docs #926

Closed
labrys opened this issue Jun 23, 2019 · 0 comments · Fixed by #1024
Closed

gettz('') result is incorrect per the docs #926

labrys opened this issue Jun 23, 2019 · 0 comments · Fixed by #1024

Comments

@labrys
Copy link
Contributor

labrys commented Jun 23, 2019

Per the docs:

If no argument or an empty string is passed to gettz, local time is returned:

On Linux it returns None instead of tzlocal().

Related: #925

@labrys labrys changed the title Result of gettz('') is incorrect per the docs gettz('') result is incorrect per the docs Jun 23, 2019
ffe4 added a commit to ffe4/dateutil that referenced this issue Apr 3, 2020
ffe4 added a commit to ffe4/dateutil that referenced this issue Apr 3, 2020
ffe4 added a commit to ffe4/dateutil that referenced this issue Apr 3, 2020
ffe4 added a commit to ffe4/dateutil that referenced this issue Apr 3, 2020
nocache checks the gettz(name) parameter with if not name and tries to get the local time from the TZ environment variable. When the environment variable does not exist, it only checked for name is None, skipping the logic that searches for the local time tzfile when passed an empty string.

Fixes dateutil#925, dateutil#926
ffe4 added a commit to ffe4/dateutil that referenced this issue Apr 5, 2020
nocache checks the gettz(name) parameter with if not name and tries to get the local time from the TZ environment variable. When the environment variable does not exist, it only checked for name is None, skipping the logic that searches for the local time tzfile when passed an empty string.

Fixes dateutil#925, dateutil#926
pganssle pushed a commit to ffe4/dateutil that referenced this issue Apr 24, 2020
The documented behavior of the function is to return a local time zone
when the argument is None or an empty string.

This was working if the TZ environment variable was set, but not working
otherwise.

Fixes dateutil#925, dateutil#926
pganssle pushed a commit to ffe4/dateutil that referenced this issue Apr 24, 2020
The documented behavior of the function is to return a local time zone
when the argument is None or an empty string.

This was working if the TZ environment variable was set, but not working
otherwise.

Fixes dateutil#925, dateutil#926
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants