forked from pool/python-gevent
- The file objects (FileObjectPosix, FileObjectThread) now
consistently text and binary modes. If neither 'b' nor 't' is
given in the mode, they will read and write native strings.
If 't' is given, they will always work with unicode strings,
and 'b' will always work with byte strings. (FileObjectPosix
already worked this way.) See :issue:`1441`.
- The file objects accept encoding, errors and newline
arguments. On Python 2, these are only used if 't' is in the
mode.
- The default mode for FileObjectPosix changed from rb to
simply r, for consistency with the other file objects and the
standard open and io.open functions.
- Fix FileObjectPosix improperly being used from multiple
greenlets. Previously this was hidden by forcing buffering,
which raised RuntimeError.
- Fix using monkey-patched threading.Lock and threading.RLock
objects as spin locks by making them call sleep(0) if they
failed to acquire the lock in a non-blocking call. This lets
other callbacks run to release the lock, simulating
preemptive threading. Using spin locks is not recommended,
but may have been done in code written for threads,
especially on Python 3. See :issue:`1464`.
- Fix Semaphore (and monkey-patched threading locks) to be
fair. This eliminates the rare potential for starvation of
greenlets. As part of this change, the low-level method
rawlink of Semaphore, Event, and AsyncResult now always
remove the link object when calling it, so unlink can
sometimes be optimized out. See :issue:`1487`.
- Make gevent.pywsgi support Connection: keep-alive in
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-gevent?expand=0&rev=61
33 lines
1.5 KiB
Diff
33 lines
1.5 KiB
Diff
From: Antonio Larrosa <alarrosa@suse.com>
|
|
Subject: Fix failing tests
|
|
|
|
- ssl.OP_NO_COMPRESSION is set by default by ssl.
|
|
- thread_ident can be represented as a negative hex number now,
|
|
so replace the negative sign with the regex too, and not just the number.
|
|
--- a/src/greentest/2.7/test_ssl.py
|
|
+++ b/src/greentest/2.7/test_ssl.py
|
|
@@ -835,9 +835,10 @@ class ContextTests(unittest.TestCase):
|
|
def test_options(self):
|
|
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
|
|
# OP_ALL | OP_NO_SSLv2 | OP_NO_SSLv3 is the default value
|
|
- default = (ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3)
|
|
+ default = (ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3 |
|
|
+ OP_NO_COMPRESSION)
|
|
# SSLContext also enables these by default
|
|
- default |= (OP_NO_COMPRESSION | OP_CIPHER_SERVER_PREFERENCE |
|
|
+ default |= (OP_CIPHER_SERVER_PREFERENCE |
|
|
OP_SINGLE_DH_USE | OP_SINGLE_ECDH_USE |
|
|
OP_ENABLE_MIDDLEBOX_COMPAT)
|
|
self.assertEqual(default, ctx.options)
|
|
--- a/src/gevent/tests/test__util.py
|
|
+++ b/src/gevent/tests/test__util.py
|
|
@@ -134,7 +134,7 @@ class TestTree(greentest.TestCase):
|
|
|
|
def _normalize_tree_format(self, value):
|
|
import re
|
|
- hexobj = re.compile('0x[0123456789abcdef]+L?', re.I)
|
|
+ hexobj = re.compile('-?0x[0123456789abcdef]+L?', re.I)
|
|
value = hexobj.sub('X', value)
|
|
value = value.replace('epoll', 'select')
|
|
value = value.replace('select', 'default')
|