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

[3.7] bpo-29097: Forego fold detection on windows for low timestamp values (GH-2385) #8466

Merged
merged 1 commit into from
Jul 25, 2018

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jul 25, 2018

On Windows, passing a negative value to local results in an OSError because localtime_s on Windows does not support negative timestamps. Unfortunately this means that fold detection for timestamps between 0 and max_fold_seconds will result in this OSError since we subtract max_fold_seconds from the timestamp to detect a fold. However, since we know there haven't been any folds in the interval [0, max_fold_seconds) in any timezone, we can hackily just forego fold detection for this time range on Windows.
(cherry picked from commit 96d1e69)

Co-authored-by: Ammar Askar ammar_askar@hotmail.com

https://bugs.python.org/issue29097

…ythonGH-2385)

On Windows, passing a negative value to local results in an OSError because localtime_s on Windows does not support negative timestamps. Unfortunately this means that fold detection for timestamps between 0 and max_fold_seconds will result in this OSError since we subtract max_fold_seconds from the timestamp to detect a fold. However, since we know there haven't been any folds in the interval [0, max_fold_seconds) in any timezone, we can hackily just forego fold detection for this time range on Windows.
(cherry picked from commit 96d1e69)

Co-authored-by: Ammar Askar <ammar_askar@hotmail.com>
@miss-islington
Copy link
Contributor Author

@ammaraskar and @abalkin: Backport status check is done, and it's a failure ❌ .

@abalkin abalkin merged commit 9736493 into python:3.7 Jul 25, 2018
@miss-islington miss-islington deleted the backport-96d1e69-3.7 branch July 25, 2018 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants