summaryrefslogtreecommitdiff
path: root/numpy/core/src/multiarray
diff options
context:
space:
mode:
authorEdward E <develinthedetail@gmail.com>2023-03-30 16:52:12 -0500
committerEdward E <develinthedetail@gmail.com>2023-03-31 02:01:28 -0500
commit40426744f9dedab3e03997bb916abdeaa69667b0 (patch)
treecc68de08251a8b11f41ee221f73f8d284a729589 /numpy/core/src/multiarray
parentb50568d9e758b489c2a3c409ef4e57b67820f090 (diff)
downloadnumpy-40426744f9dedab3e03997bb916abdeaa69667b0.tar.gz
BUG: Use 2GiB chunking code for fwrite() on mingw32/64
Addresses #2256
Diffstat (limited to 'numpy/core/src/multiarray')
-rw-r--r--numpy/core/src/multiarray/convert.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/numpy/core/src/multiarray/convert.c b/numpy/core/src/multiarray/convert.c
index 9e0c9fb60..565cce773 100644
--- a/numpy/core/src/multiarray/convert.c
+++ b/numpy/core/src/multiarray/convert.c
@@ -157,11 +157,15 @@ PyArray_ToFile(PyArrayObject *self, FILE *fp, char *sep, char *format)
size = PyArray_SIZE(self);
NPY_BEGIN_ALLOW_THREADS;
-#if defined (_MSC_VER) && defined(_WIN64)
- /* Workaround Win64 fwrite() bug. Issue gh-2556
+#if defined(_MSC_VER) && defined(_WIN64) || \
+ defined(__MINGW32__) || defined(__MINGW64__)
+ /* Workaround Win64 fwrite() bug. Issue gh-2256
* If you touch this code, please run this test which is so slow
- * it was removed from the test suite
+ * it was removed from the test suite. Note that the original
+ * failure mode involves an infinite loop during tofile()
*
+ * import tempfile, numpy as np
+ * from numpy.testing import (assert_)
* fourgbplus = 2**32 + 2**16
* testbytes = np.arange(8, dtype=np.int8)
* n = len(testbytes)