Skip to content

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

Merged
abalkin merged 1 commit into
python:3.7from
miss-islington:backport-96d1e69-3.7
Jul 25, 2018
Merged

abalkin merged 1 commit into
python:3.7from
miss-islington:backport-96d1e69-3.7

Conversation

@miss-islington

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

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

5 participants