summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS.d/next/Windows/2018-05-16-11-31-17.bpo-29097.9mqEuI.rst
diff options
context:
space:
mode:
authorAmmar Askar <ammar_askar@hotmail.com>2018-07-25 16:54:58 (GMT)
committerAlexander Belopolsky <abalkin@users.noreply.github.com>2018-07-25 16:54:58 (GMT)
commit96d1e69a12ed8ab80203277e1abdaf573457a964 (patch)
treee6cdbe9b8eec222ba25cf313c0ba4361f2dd68d9 /Misc/NEWS.d/next/Windows/2018-05-16-11-31-17.bpo-29097.9mqEuI.rst
parent74102c9a5f2327c4fc47feefa072854a53551d1f (diff)
downloadcpython-96d1e69a12ed8ab80203277e1abdaf573457a964.zip
cpython-96d1e69a12ed8ab80203277e1abdaf573457a964.tar.gz
cpython-96d1e69a12ed8ab80203277e1abdaf573457a964.tar.bz2
bpo-29097: Forego fold detection on windows for low timestamp values (GH-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.
Diffstat (limited to 'Misc/NEWS.d/next/Windows/2018-05-16-11-31-17.bpo-29097.9mqEuI.rst')
-rw-r--r--Misc/NEWS.d/next/Windows/2018-05-16-11-31-17.bpo-29097.9mqEuI.rst3
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Windows/2018-05-16-11-31-17.bpo-29097.9mqEuI.rst b/Misc/NEWS.d/next/Windows/2018-05-16-11-31-17.bpo-29097.9mqEuI.rst
new file mode 100644
index 0000000..a59efc7
--- /dev/null
+++ b/Misc/NEWS.d/next/Windows/2018-05-16-11-31-17.bpo-29097.9mqEuI.rst
@@ -0,0 +1,3 @@
+Fix bug where :meth:`datetime.fromtimestamp` erronously throws an
+:exc:`OSError` on Windows for values between 0 and 86400.
+Patch by Ammar Askar.