Author: Matti Picus <matti.pi...@gmail.com>
Branch: py3.6
Changeset: r98292:4ede1313d652
Date: 2019-12-15 12:06 +0200
http://bitbucket.org/pypy/pypy/changeset/4ede1313d652/

Log:    merge default into branch

diff --git a/lib_pypy/_cffi_ssl/_stdssl/__init__.py 
b/lib_pypy/_cffi_ssl/_stdssl/__init__.py
--- a/lib_pypy/_cffi_ssl/_stdssl/__init__.py
+++ b/lib_pypy/_cffi_ssl/_stdssl/__init__.py
@@ -85,7 +85,9 @@
 OP_NO_SSLv3 = lib.SSL_OP_NO_SSLv3
 OP_NO_TLSv1_3 = lib.SSL_OP_NO_TLSv1_3
 if OPENSSL_VERSION_INFO > (1, 1, 0, 0, 0):
-    OP_ENABLE_MIDDLEBOX_COMPAT = lib.SSL_OP_ENABLE_MIDDLEBOX_COMPAT
+    # OP_ENABLE_MIDDLEBOX_COMPAT = lib.SSL_OP_ENABLE_MIDDLEBOX_COMPAT
+    # XXX should be conditionally compiled into lib
+    OP_ENABLE_MIDDLEBOX_COMPAT = 0x00100000
 
 
 
@@ -1269,10 +1271,12 @@
         return stats
 
     def set_default_verify_paths(self):
-        if not os.environ.get('SSL_CERT_FILE') and not 
os.environ.get('SSL_CERT_DIR'):
-            locations = get_default_verify_paths()
-            self.load_verify_locations(locations[1], locations[3])
-            return
+        if (not os.environ.get('SSL_CERT_FILE') and 
+            not os.environ.get('SSL_CERT_DIR') and
+            not sys.platform == 'win32'):
+                locations = get_default_verify_paths()
+                self.load_verify_locations(locations[1], locations[3])
+                return
         if not lib.SSL_CTX_set_default_verify_paths(self.ctx):
             raise ssl_error("")
 
@@ -1411,6 +1415,25 @@
 
         return 0;
 
+    @property
+    def post_handshake_auth(self):
+        if HAS_TLSv1_3:
+            return bool(self._post_handshake_auth)
+        return None
+
+    @post_handshake_auth.setter
+    def post_handshake_auth(self, arg):
+        if arg is None:
+            raise AttributeError("cannot delete attribute")
+
+        pha = bool(arg)
+        self._post_handshake_auth = pha;
+
+        # bpo-37428: newPySSLSocket() sets SSL_VERIFY_POST_HANDSHAKE flag for
+        # server sockets and SSL_set_post_handshake_auth() for client
+
+        return 0;
+
 
 
 # cryptography constraint: OPENSSL_NO_TLSEXT will never be set!
diff --git a/pypy/doc/contributing.rst b/pypy/doc/contributing.rst
--- a/pypy/doc/contributing.rst
+++ b/pypy/doc/contributing.rst
@@ -311,16 +311,13 @@
 directory or even the top level subdirectory ``pypy``.  It takes
 hours and uses huge amounts of RAM and is not recommended.
 
-To run CPython regression tests you can point to the ``lib-python``
-directory::
-
-    py.test lib-python/2.7/test/test_datetime.py
-
-This will usually take a long time because this will run
-the PyPy Python interpreter on top of CPython.  On the plus
-side, it's usually still faster than doing a full translation
-and running the regression test with the translated PyPy Python
-interpreter.
+To run CPython regression tests, you should start with a translated PyPy and
+run the tests as you would with CPython (see below).  You can, however, also
+attempt to run the tests before translation, but be aware that it is done with
+a hack that doesn't work in all cases and it is usually extremely slow:
+``py.test lib-python/2.7/test/test_datetime.py``.  Usually, a better idea is to
+extract a minimal failing test of at most a few lines, and put it into one of
+our own tests in ``pypy/*/test/``.
 
 .. _py.test testing tool: http://pytest.org
 .. _py.test usage and invocations: http://pytest.org/latest/usage.html#usage
@@ -350,6 +347,11 @@
 
     cpython2 pytest.py -A pypy/module/cpyext/test --python=path/to/pypy3
 
+To run a test from the standard CPython regression test suite, use the regular
+Python way, i.e. (replace "pypy" with the exact binary name, if needed)::
+
+    pypy -m test.test_datetime
+
 
 Tooling & Utilities
 ^^^^^^^^^^^^^^^^^^^
diff --git a/pypy/doc/release-v7.3.0.rst b/pypy/doc/release-v7.3.0.rst
--- a/pypy/doc/release-v7.3.0.rst
+++ b/pypy/doc/release-v7.3.0.rst
@@ -133,6 +133,11 @@
 * Better support and report MSVC versions used to compile on windows
 * Allow any kind of buffer in socket.setsockopt(), like CPython (`issue 3114`_)
 * Fix importing a module with unicode in ``sys.path`` (`issue 3112`_)
+* Support OpenSSL 1.1 and TLSv1_3
+* Remove the (deprecated since 5.7) asmgcc rootfinder from the GC
+* Overflow in RPython when converting ``2<<32`` into a ``Signed`` on 32-bit
+  platforms rather than automatically using a ``SignedLongLong``, require an
+  explicit ``r_int64()`` call instead
 
 C-API (cpyext) and c-extensions
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -179,13 +184,16 @@
 * Add missing ``os.getgrouplist`` (part of `issue 2375`_)
 * Back-port the tentative fix from cpython: "Import deadlock detection causes
   deadlock" (part of `issue 3111`_)
+* Fix handling of ``sys.exc_info()`` in generators
+* Return ``W_IntObject`` when converting from ``float`` to ``int`` when
+  possible, which speeds up many code paths.
 
 Python 3.6 C-API
 ~~~~~~~~~~~~~~~~
 
 * Add ``PyObject_GenericGetDict``, ``PyObject_GenericSetDict``, ``_Py_strhex``,
   ``_Py_strhex_bytes``, ``PyUnicodeNew``, ``_PyFinalizing``,
-  ``PySlice_Unpack``, ``PySlice_AdjustIndices``
+  ``PySlice_Unpack``, ``PySlice_AdjustIndices``, ``PyOS_FSPath``
 * Implement ``pystrhex.h`` (`issue 2687`_)
 * Make ``PyUnicodeObject`` slightly more compact
 * Fix memory leak when releasing a ``PyUnicodeObject``
diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -3,13 +3,5 @@
 ============================
 
 .. this is a revision shortly after release-pypy-7.3.0
-.. startrev: dbbbae99135f 
+.. startrev: 994c42529580 
 
-.. branch: backport-decode_timeval_ns-py3.7
-
-Backport ``rtime.decode_timeval_ns`` from py3.7 to rpython
-
-.. branch: kill-asmgcc
-
-Completely remove the deprecated translation option ``--gcrootfinder=asmgcc``
-because it no longer works with a recent enough ``gcc``.
diff --git a/pypy/doc/whatsnew-pypy2-7.3.0.rst 
b/pypy/doc/whatsnew-pypy2-7.3.0.rst
--- a/pypy/doc/whatsnew-pypy2-7.3.0.rst
+++ b/pypy/doc/whatsnew-pypy2-7.3.0.rst
@@ -31,3 +31,11 @@
 anonymous struct/unions, cmake fragments for distribution, optimizations for
 PODs, and faster wrapper calls.
 
+.. branch: backport-decode_timeval_ns-py3.7
+
+Backport ``rtime.decode_timeval_ns`` from py3.7 to rpython
+
+.. branch: kill-asmgcc
+
+Completely remove the deprecated translation option ``--gcrootfinder=asmgcc``
+because it no longer works with a recent enough ``gcc``.
diff --git a/pypy/doc/whatsnew-pypy3-7.3.0.rst 
b/pypy/doc/whatsnew-pypy3-7.3.0.rst
--- a/pypy/doc/whatsnew-pypy3-7.3.0.rst
+++ b/pypy/doc/whatsnew-pypy3-7.3.0.rst
@@ -17,3 +17,8 @@
 .. branch: code_page-utf8
 
 Add encoding, decoding of codepages on windows
+
+.. branch: py3.6-exc-info-2
+
+Fix handling of sys.exc_info() in generators
+
diff --git a/pypy/doc/whatsnew-pypy3-head.rst b/pypy/doc/whatsnew-pypy3-head.rst
--- a/pypy/doc/whatsnew-pypy3-head.rst
+++ b/pypy/doc/whatsnew-pypy3-head.rst
@@ -3,8 +3,5 @@
 ==========================
 
 .. this is the revision after release-pypy3.6-v7.3.0
-.. startrev: 78b4d0a7cf2e
+.. startrev: a56889d5df88
 
-.. branch: py3.6-exc-info-2
-
-Fix handling of sys.exc_info() in generators
diff --git a/rpython/jit/backend/test/runner_test.py 
b/rpython/jit/backend/test/runner_test.py
--- a/rpython/jit/backend/test/runner_test.py
+++ b/rpython/jit/backend/test/runner_test.py
@@ -4725,6 +4725,7 @@
 
     def test_raw_load_int(self):
         from rpython.rlib import rawstorage
+        from rpython.rlib.rarithmetic import r_longlong
         for T in [rffi.UCHAR, rffi.SIGNEDCHAR,
                   rffi.USHORT, rffi.SHORT,
                   rffi.UINT, rffi.INT,
@@ -4738,7 +4739,7 @@
             p = rawstorage.alloc_raw_storage(31)
             for i in range(31):
                 p[i] = '\xDD'
-            value = rffi.cast(T, -0x4243444546474849)
+            value = rffi.cast(T, r_longlong(-0x4243444546474849))
             rawstorage.raw_storage_setitem(p, 16, value)
             got = self.cpu.bh_raw_load_i(rffi.cast(lltype.Signed, p), 16,
                                          arraydescr)
diff --git a/rpython/jit/backend/x86/test/test_runner.py 
b/rpython/jit/backend/x86/test/test_runner.py
--- a/rpython/jit/backend/x86/test/test_runner.py
+++ b/rpython/jit/backend/x86/test/test_runner.py
@@ -285,12 +285,15 @@
         cases = [8, 16, 24]
         if WORD == 8:
             cases.append(32)
+            bigvalue = 0xAAAAAAAAAAAA
+        else:
+            bigvalue = 0xAAAAAAA
         for i in cases:
-            box = InputArgInt(0xAAAAAAAAAAAA)
+            box = InputArgInt(bigvalue)
             res = self.execute_operation(rop.INT_AND,
                                          [box, ConstInt(2 ** i - 1)],
                                          'int')
-            assert res == 0xAAAAAAAAAAAA & (2 ** i - 1)
+            assert res == bigvalue & (2 ** i - 1)
 
     def test_nullity_with_guard(self):
         allops = [rop.INT_IS_TRUE]
diff --git a/rpython/jit/backend/x86/test/test_rx86.py 
b/rpython/jit/backend/x86/test/test_rx86.py
--- a/rpython/jit/backend/x86/test/test_rx86.py
+++ b/rpython/jit/backend/x86/test/test_rx86.py
@@ -1,4 +1,5 @@
 import py, struct
+from rpython.rlib.rarithmetic import r_longlong
 from rpython.jit.backend.x86.rx86 import *
 globals().update(R.__dict__)
 
@@ -210,8 +211,8 @@
     s.MOV_ri(ebx, -0x80000003)
     s.MOV_ri(r13, -0x80000002)
     s.MOV_ri(ecx, 42)
-    s.MOV_ri(r12, 0x80000042)
-    s.MOV_ri(r12, 0x100000007)
+    s.MOV_ri(r12, r_longlong(0x80000042))
+    s.MOV_ri(r12, r_longlong(0x100000007))
     assert s.getvalue() == ('\x48\xC7\xC1\xFE\xFF\xFF\xFF' +
                             '\x49\xC7\xC7\xFD\xFF\xFF\xFF' +
                             '\x48\xBB\xFD\xFF\xFF\x7F\xFF\xFF\xFF\xFF' +
diff --git a/rpython/jit/backend/x86/test/test_rx86_64_auto_encoding.py 
b/rpython/jit/backend/x86/test/test_rx86_64_auto_encoding.py
--- a/rpython/jit/backend/x86/test/test_rx86_64_auto_encoding.py
+++ b/rpython/jit/backend/x86/test/test_rx86_64_auto_encoding.py
@@ -1,7 +1,11 @@
+import sys, py
 import random
 from rpython.jit.backend.x86 import rx86
 from rpython.jit.backend.x86.test import test_rx86_32_auto_encoding
 
+if sys.maxint <= 2**32:
+    py.test.skip("skipping this test on x86-32")
+
 
 class TestRx86_64(test_rx86_32_auto_encoding.TestRx86_32):
     WORD = 8
diff --git a/rpython/rlib/rstruct/test/test_pack.py 
b/rpython/rlib/rstruct/test/test_pack.py
--- a/rpython/rlib/rstruct/test/test_pack.py
+++ b/rpython/rlib/rstruct/test/test_pack.py
@@ -1,5 +1,5 @@
 import pytest
-from rpython.rlib.rarithmetic import r_ulonglong
+from rpython.rlib.rarithmetic import r_uint, r_longlong, r_ulonglong
 from rpython.rlib.rstruct import standardfmttable, nativefmttable
 from rpython.rlib.rstruct.error import StructOverflowError
 from rpython.rlib import buffer
@@ -129,9 +129,9 @@
         self.check("i", 0x41424344)
         self.check("i", -3)
         self.check("i", -2147483648)
-        self.check("I", 0x81424344)
-        self.check("q", 0x4142434445464748)
-        self.check("q", -0x41B2B3B4B5B6B7B8)
+        self.check("I", r_uint(0x81424344))
+        self.check("q", r_longlong(0x4142434445464748))
+        self.check("q", r_longlong(-0x41B2B3B4B5B6B7B8))
         self.check("Q", r_ulonglong(0x8142434445464748))
 
     def test_pack_ieee(self):
diff --git a/rpython/rlib/streamio.py b/rpython/rlib/streamio.py
--- a/rpython/rlib/streamio.py
+++ b/rpython/rlib/streamio.py
@@ -317,7 +317,8 @@
         os.lseek(self.fd, offset, whence)
 
     def tell(self):
-        return os.lseek(self.fd, 0, 1)
+        result = os.lseek(self.fd, 0, 1)
+        return r_longlong(result)
 
     def read(self, n):
         assert isinstance(n, int)
diff --git a/rpython/rtyper/lltypesystem/ll2ctypes.py 
b/rpython/rtyper/lltypesystem/ll2ctypes.py
--- a/rpython/rtyper/lltypesystem/ll2ctypes.py
+++ b/rpython/rtyper/lltypesystem/ll2ctypes.py
@@ -1455,7 +1455,7 @@
     def __new__(cls, void_p):
         if isinstance(void_p, (int, long)):
             void_p = ctypes.c_void_p(void_p)
-        self = long.__new__(cls, void_p.value)
+        self = long.__new__(cls, intmask(void_p.value))
         self.void_p = void_p
         self.intval = intmask(void_p.value)
         return self
diff --git a/rpython/rtyper/lltypesystem/lltype.py 
b/rpython/rtyper/lltypesystem/lltype.py
--- a/rpython/rtyper/lltypesystem/lltype.py
+++ b/rpython/rtyper/lltypesystem/lltype.py
@@ -815,7 +815,11 @@
             if -maxint-1 <= val <= maxint:
                 return Signed
             elif longlongmask(val) == val:
-                return SignedLongLong
+                raise OverflowError("integer %r is out of bounds for Signed "
+                                    "(it would fit SignedLongLong, but we "
+                                    "won't implicitly return SignedLongLong "
+                                    "for typeOf(%r) where type(%r) is long)"
+                                    % (val, val, val))
             else:
                 raise OverflowError("integer %r is out of bounds" % (val,))
         if tp is bool:
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to