Commit 315416d5 authored by Jason Madden's avatar Jason Madden

Patch around bug in libuv 1.x that globally changes the default stdio FILE mode.

It might be possible to do this at binary loading time with some clever intradiction, or at build time but this is simplest.
[skip travis]
parent 733c4df7
......@@ -9,9 +9,14 @@
- Formatting run info no longer includes ``gevent.local.local``
objects that have no value in the greenlet. See :issue:`1275`.
- Fixed negative length in pywsgi's Input read functions for non chunked body.
Reported in :issue:`1274` by tzickel.
- Upgrabe libuv from 1.22.0 to 1.23.2.
- Upgrade libuv from 1.22.0 to 1.23.2.
- Fix opening files in text mode in CPython 2 on Windows by patching
libuv. See :issue:`1282` reported by wiggin15.
1.3.6 (2018-08-17)
==================
......
......@@ -19,3 +19,6 @@ Updating libuv
- rm -rf libuv/test
- rm -rf libuv/tools
- rm -f libuv/android-configure*
- Apply the patches to libuv:
- git apply libuv-win-binary.patch
diff --git a/deps/libuv/src/win/fs.c b/deps/libuv/src/win/fs.c
index 812c1a6d..f4d66628 100644
--- a/deps/libuv/src/win/fs.c
+++ b/deps/libuv/src/win/fs.c
@@ -135,7 +135,14 @@ const WCHAR UNC_PATH_PREFIX_LEN = 8;
static int uv__file_symlink_usermode_flag = SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;
void uv_fs_init(void) {
- _fmode = _O_BINARY;
+/* gevent: This breaks `open()` on CPython 2 by changing
+ * the default mode for file operations. Python 3 and PyPy
+ * ar unaffected. It was removed for the (unreleased) libuv 2.
+ * See https://github.com/gevent/gevent/issues/1282
+ */
+/*
+ * _fmode = _O_BINARY;
+ */
}
......@@ -135,7 +135,14 @@ const WCHAR UNC_PATH_PREFIX_LEN = 8;
static int uv__file_symlink_usermode_flag = SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;
void uv_fs_init(void) {
_fmode = _O_BINARY;
/* gevent: This breaks `open()` on CPython 2 by changing
* the default mode for file operations. Python 3 and PyPy
* ar unaffected. It was removed for the (unreleased) libuv 2.
* See https://github.com/gevent/gevent/issues/1282
*/
/*
* _fmode = _O_BINARY;
*/
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment