bpo-29097: Forego fold detection on windows for low timestamp values#2385
bpo-29097: Forego fold detection on windows for low timestamp values#2385abalkin merged 7 commits into
Conversation
|
@ammaraskar, thanks for your PR! By analyzing the history of the files in this pull request, we identified @tim-one, @abalkin and @pitrou to be potential reviewers. |
Sorry, something went wrong.
berkerpeksag
left a comment
There was a problem hiding this comment.
We also need a NEWS entry for this.
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
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.
11d1ddf to
f60dbb1
Compare
May 16, 2018 18:46
f60dbb1 to
008778f
Compare
May 16, 2018 18:47
|
#2530 revealed that the pure python version of fromtimestamp lacks a similar check, going to add it in. |
Sorry, something went wrong.
bae05d4 to
7c8847d
Compare
May 16, 2018 20:32
7c8847d to
636ec5d
Compare
May 16, 2018 21:11
|
I have made the requested changes; please review again |
Sorry, something went wrong.
|
Thanks for making the requested changes! @berkerpeksag: please review the changes made to this pull request. |
Sorry, something went wrong.
9be3a35 to
49a6937
Compare
July 6, 2018 01:02
49a6937 to
9202447
Compare
July 6, 2018 01:16
|
This could land in 3.7.1 or 3.7.2, yeah? |
Sorry, something went wrong.
|
Thanks @ammaraskar for the PR, and @abalkin for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Sorry, something went wrong.
…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>
|
Thanks @ammaraskar for the PR, and @abalkin for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6. |
Sorry, something went wrong.
|
Sorry, @ammaraskar and @abalkin, I could not cleanly backport this to |
Sorry, something went wrong.
…H-2385) (GH-8466) 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>
…alues (pythonGH-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>
…alues (GH-2385) (GH-8498) 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>
See the bug tracker for more details on why I think this is a clean way to resolve this issue https://bugs.python.org/issue29097
https://bugs.python.org/issue29097