Author: Armin Rigo <[email protected]> Branch: py3.5 Changeset: r88208:e8664fda6f93 Date: 2016-11-08 13:18 +0100 http://bitbucket.org/pypy/pypy/changeset/e8664fda6f93/
Log: hg merge 50aae6a02e7f^ diff --git a/lib_pypy/cffi.egg-info/PKG-INFO b/lib_pypy/cffi.egg-info/PKG-INFO --- a/lib_pypy/cffi.egg-info/PKG-INFO +++ b/lib_pypy/cffi.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: cffi -Version: 1.8.4 +Version: 1.9.0 Summary: Foreign Function Interface for Python calling C code. Home-page: http://cffi.readthedocs.org Author: Armin Rigo, Maciej Fijalkowski diff --git a/lib_pypy/cffi/__init__.py b/lib_pypy/cffi/__init__.py --- a/lib_pypy/cffi/__init__.py +++ b/lib_pypy/cffi/__init__.py @@ -4,8 +4,8 @@ from .api import FFI, CDefError, FFIError from .ffiplatform import VerificationError, VerificationMissing -__version__ = "1.8.4" -__version_info__ = (1, 8, 4) +__version__ = "1.9.0" +__version_info__ = (1, 9, 0) # The verifier module file names are based on the CRC32 of a string that # contains the following version number. It may be older than __version__ diff --git a/lib_pypy/cffi/_embedding.h b/lib_pypy/cffi/_embedding.h --- a/lib_pypy/cffi/_embedding.h +++ b/lib_pypy/cffi/_embedding.h @@ -233,7 +233,7 @@ f = PySys_GetObject((char *)"stderr"); if (f != NULL && f != Py_None) { PyFile_WriteString("\nFrom: " _CFFI_MODULE_NAME - "\ncompiled with cffi version: 1.8.4" + "\ncompiled with cffi version: 1.9.0" "\n_cffi_backend module: ", f); modules = PyImport_GetModuleDict(); mod = PyDict_GetItemString(modules, "_cffi_backend"); diff --git a/pypy/doc/release-pypy2.7-v5.6.0.rst b/pypy/doc/release-pypy2.7-v5.6.0.rst --- a/pypy/doc/release-pypy2.7-v5.6.0.rst +++ b/pypy/doc/release-pypy2.7-v5.6.0.rst @@ -16,6 +16,9 @@ We changed ``timeit`` to now report average +- standard deviation, which is better than the misleading minimum value reported in CPython. +We now support building PyPy with OpenSSL 1.1 in our built-in _sll module, as +well as maintaining support for previous versions. + XXX As always, this release fixed many issues and bugs raised by the @@ -72,7 +75,7 @@ * New features * Allow tests run with `-A` to find `libm.so` even if it is a script not a dynamically loadable file - * Backport fixes to rposix on windows from py2.5 + * Backport fixes to rposix on windows from py3.5 * Allow user-defined ``__getitem__`` on subclasses of ``str`` and ``unicode`` * Add ``inode`` to ``scandir()`` on posix systems * Support more attributes on ``super`` @@ -98,6 +101,8 @@ * Support translation on FreeBSD running on PowerPC * Implement ``__rmod__`` on ``str`` and ``unicode`` types * Issue warnings for stricter handling of ``__new__``, ``__init__`` args + * When using ``struct.unpack('q', ...`` try harder to prefer int to long + * Support OpenSSL version 1.1 (in addition to version 1.0) * Bug Fixes * Tweak a float comparison with 0 in `backendopt.inline` to avoid rounding errors 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 @@ -86,3 +86,20 @@ Improve support for new buffer interface in cpyext, bf_getbuffer on built-in types still missing + +.. branch: fix-struct-unpack-Q + +Improve compatibility with CPython in the ``struct`` module. In particular, +``struct.unpack`` now returns an ``int`` whenever the returned value fits, +while previously it always returned a ``long`` for certains format codes such +as ``Q`` (and also ``I``, ``L`` and ``q`` on 32 bit) + +.. branch: newinitwarn + +Issue warnings for stricter handling of ``__new/init__`` args (that +become TypeErrors in python 3) + +.. branch: openssl-1.1 + +PyPy can now be translated on a machine where the newer OpenSSL 1.1 is +installed. Thanks tumbleweed! diff --git a/pypy/module/_cffi_backend/__init__.py b/pypy/module/_cffi_backend/__init__.py --- a/pypy/module/_cffi_backend/__init__.py +++ b/pypy/module/_cffi_backend/__init__.py @@ -3,7 +3,7 @@ from rpython.rlib import rdynload, clibffi, entrypoint from rpython.rtyper.lltypesystem import rffi -VERSION = "1.8.4" +VERSION = "1.9.0" FFI_DEFAULT_ABI = clibffi.FFI_DEFAULT_ABI try: diff --git a/pypy/module/_cffi_backend/test/_backend_test_c.py b/pypy/module/_cffi_backend/test/_backend_test_c.py --- a/pypy/module/_cffi_backend/test/_backend_test_c.py +++ b/pypy/module/_cffi_backend/test/_backend_test_c.py @@ -1,7 +1,7 @@ # ____________________________________________________________ import sys -assert __version__ == "1.8.4", ("This test_c.py file is for testing a version" +assert __version__ == "1.9.0", ("This test_c.py file is for testing a version" " of cffi that differs from the one that we" " get from 'import _cffi_backend'") if sys.version_info < (3,): diff --git a/pypy/module/_socket/interp_socket.py b/pypy/module/_socket/interp_socket.py --- a/pypy/module/_socket/interp_socket.py +++ b/pypy/module/_socket/interp_socket.py @@ -507,6 +507,14 @@ @unwrap_spec(nbytes=int, flags=int) def recv_into_w(self, space, w_buffer, nbytes=0, flags=0): + """recv_into(buffer, [nbytes[, flags]]) -> nbytes_read + + A version of recv() that stores its data into a buffer rather than creating + a new string. Receive up to buffersize bytes from the socket. If buffersize + is not specified (or 0), receive up to the size available in the given buffer. + + See recv() for documentation about the flags. + """ rwbuffer = space.getarg_w('w*', w_buffer) lgt = rwbuffer.getlength() if nbytes == 0 or nbytes > lgt: @@ -518,6 +526,10 @@ @unwrap_spec(nbytes=int, flags=int) def recvfrom_into_w(self, space, w_buffer, nbytes=0, flags=0): + """recvfrom_into(buffer[, nbytes[, flags]]) -> (nbytes, address info) + + Like recv_into(buffer[, nbytes[, flags]]) but also return the sender's address info. + """ rwbuffer = space.getarg_w('w*', w_buffer) lgt = rwbuffer.getlength() if nbytes == 0: diff --git a/pypy/module/pyexpat/interp_pyexpat.py b/pypy/module/pyexpat/interp_pyexpat.py --- a/pypy/module/pyexpat/interp_pyexpat.py +++ b/pypy/module/pyexpat/interp_pyexpat.py @@ -523,8 +523,8 @@ maxindex = XML_GetSpecifiedAttributeCount(self.itself) else: maxindex = 0 - while attrs[maxindex]: - maxindex += 2 # copied + while attrs[maxindex]: + maxindex += 2 # copied if self.ordered_attributes: w_attrs = space.newlist([ diff --git a/rpython/rlib/rposix.py b/rpython/rlib/rposix.py --- a/rpython/rlib/rposix.py +++ b/rpython/rlib/rposix.py @@ -1362,8 +1362,14 @@ def _time_to_timeval(t, l_timeval): import math fracpart, intpart = math.modf(t) - rffi.setintfield(l_timeval, 'c_tv_sec', int(intpart)) - rffi.setintfield(l_timeval, 'c_tv_usec', int(fracpart * 1e6)) + intpart = int(intpart) + fracpart = int(fracpart * 1e6) + if fracpart < 0: + intpart -= 1 + fracpart += 1000000 + assert 0 <= fracpart < 1000000 + rffi.setintfield(l_timeval, 'c_tv_sec', intpart) + rffi.setintfield(l_timeval, 'c_tv_usec', fracpart) if not _WIN32: TMSP = lltype.Ptr(TMS) diff --git a/rpython/rlib/test/test_rposix.py b/rpython/rlib/test/test_rposix.py --- a/rpython/rlib/test/test_rposix.py +++ b/rpython/rlib/test/test_rposix.py @@ -59,6 +59,17 @@ compile(f, (str, float))(str(fname), t1) assert t1 == os.stat(str(fname)).st_mtime + def test_utime_negative_fraction(self): + def f(fname, t1): + os.utime(fname, (t1, t1)) + + fname = udir.join('test_utime_negative_fraction.txt') + fname.ensure() + t1 = -123.75 + compile(f, (str, float))(str(fname), t1) + got = os.stat(str(fname)).st_mtime + assert got == -123 or got == -123.75 + @win_only def test__getfullpathname(self): posix = __import__(os.name) _______________________________________________ pypy-commit mailing list [email protected] https://mail.python.org/mailman/listinfo/pypy-commit
