[pypy-commit] pypy release-pypy3.6-v7.x: merge py3.6 into release (preserve versioning)
mattip
pypy.commits at gmail.com
Mon Mar 11 08:14:54 EDT 2019
Author: Matti Picus <matti.picus at gmail.com>
Branch: release-pypy3.6-v7.x
Changeset: r96279:a05759e2b374
Date: 2019-03-11 14:02 +0200
http://bitbucket.org/pypy/pypy/changeset/a05759e2b374/
Log: merge py3.6 into release (preserve versioning)
diff --git a/lib_pypy/_ctypes/array.py b/lib_pypy/_ctypes/array.py
--- a/lib_pypy/_ctypes/array.py
+++ b/lib_pypy/_ctypes/array.py
@@ -263,7 +263,7 @@
try:
itemsize = struct.calcsize(fmt[1:])
except:
- itemsize = len(buffer(obj[0]))
+ itemsize = sizeof(obj[0])
return __pypy__.newmemoryview(memoryview(self._buffer), itemsize, fmt, shape)
ARRAY_CACHE = {}
diff --git a/pypy/doc/conf.py b/pypy/doc/conf.py
--- a/pypy/doc/conf.py
+++ b/pypy/doc/conf.py
@@ -71,9 +71,9 @@
# module/cpyext/include/patchlevel.h
#
# The short X.Y version.
-version = '7.1'
+version = '7.2'
# The full version, including alpha/beta/rc tags.
-release = '7.1.0'
+release = '7.2.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/pypy/doc/index-of-release-notes.rst b/pypy/doc/index-of-release-notes.rst
--- a/pypy/doc/index-of-release-notes.rst
+++ b/pypy/doc/index-of-release-notes.rst
@@ -1,11 +1,12 @@
Historical release notes
========================
-CPython 2.7 compatible versions
--------------------------------
+Combined releases
+-----------------
.. toctree::
+ release-v7.1.0.rst
release-v7.0.0.rst
release-v6.0.0.rst
release-v5.10.1.rst
@@ -14,6 +15,12 @@
release-v5.8.0.rst
release-v5.7.1.rst
release-v5.7.0.rst
+
+CPython 2.7 compatible versions
+-------------------------------
+
+.. toctree::
+
release-pypy2.7-v5.6.0.rst
release-pypy2.7-v5.4.1.rst
release-pypy2.7-v5.4.0.rst
@@ -61,15 +68,6 @@
release-0.7.0.rst
release-0.6
-CPython 3.5 compatible versions
--------------------------------
-
-.. toctree::
-
- release-v5.8.0.rst
- release-v5.7.1.rst
- release-v5.7.0.rst
-
CPython 3.3 compatible versions
-------------------------------
diff --git a/pypy/doc/release-v7.1.0.rst b/pypy/doc/release-v7.1.0.rst
new file mode 100644
--- /dev/null
+++ b/pypy/doc/release-v7.1.0.rst
@@ -0,0 +1,77 @@
+=========================================
+PyPy v7.1.0: release of 2.7, and 3.6-beta
+=========================================
+
+The PyPy team is proud to release the version 7.1.0 of PyPy, which includes
+two different interpreters:
+
+ - PyPy2.7, which is an interpreter supporting the syntax and the features of
+ Python 2.7
+
+ - PyPy3.6-beta: this is the second official release of PyPy to support 3.6
+ features, although it is still considered beta quality.
+
+The interpreters are based on much the same codebase, thus the double
+release.
+
+Until we can work with downstream providers to distribute builds with PyPy, we
+have made packages for some common packages `available as wheels`_.
+
+As always, this release is 100% compatible with the previous one and fixed
+several issues and bugs raised by the growing community of PyPy users.
+We strongly recommend updating.
+
+The PyPy3.6 release is still not production quality so your mileage may vary.
+There are open issues with incomplete compatibility and c-extension support.
+
+You can download the v7.0 releases here:
+
+ http://pypy.org/download.html
+
+We would like to thank our donors for the continued support of the PyPy
+project. If PyPy is not quite good enough for your needs, we are available for
+direct consulting work.
+
+We would also like to thank our contributors and encourage new people to join
+the project. PyPy has many layers and we need help with all of them: `PyPy`_
+and `RPython`_ documentation improvements, tweaking popular modules to run
+on pypy, or general `help`_ with making RPython's JIT even better.
+
+.. _`PyPy`: index.html
+.. _`RPython`: https://rpython.readthedocs.org
+.. _`help`: project-ideas.html
+.. _`cffi`: http://cffi.readthedocs.io
+.. _`cppyy`: https://cppyy.readthedocs.io
+.. _`available as wheels`: https://github.com/antocuni/pypy-wheels
+
+What is PyPy?
+=============
+
+PyPy is a very compliant Python interpreter, almost a drop-in replacement for
+CPython 2.7, 3.6. It's fast (`PyPy and CPython 2.7.x`_ performance
+comparison) due to its integrated tracing JIT compiler.
+
+We also welcome developers of other `dynamic languages`_ to see what RPython
+can do for them.
+
+The PyPy release supports:
+
+ * **x86** machines on most common operating systems
+ (Linux 32/64 bits, Mac OS X 64 bits, Windows 32 bits, OpenBSD, FreeBSD)
+
+ * big- and little-endian variants of **PPC64** running Linux,
+
+ * **s390x** running Linux
+
+Unfortunately at the moment of writing our ARM buildbots are out of service,
+so for now we are **not** releasing any binary for the ARM architecture.
+
+.. _`PyPy and CPython 2.7.x`: http://speed.pypy.org
+.. _`dynamic languages`: http://rpython.readthedocs.io/en/latest/examples.html
+
+
+Changelog
+=========
+
+If not specified, the changes are shared across versions
+
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
@@ -1,41 +1,6 @@
==========================
-What's new in PyPy2.7 7.0+
+What's new in PyPy2.7 7.1+
==========================
-.. this is a revision shortly after release-pypy-7.0.0
-.. startrev: 481c69f7d81f
-
-.. branch: zlib-copying-third-time-a-charm
-
-Make sure zlib decompressobjs have their streams deallocated immediately
-on flush.
-
-.. branch: zlib-copying-redux
-
-Fix calling copy on already-flushed compressobjs.
-
-
-
-.. branch: math-improvements
-
-Improve performance of long operations where one of the operands fits into
-an int.
-
-.. branch: regalloc-playground
-
-Improve register allocation in the JIT.
-
-.. branch: promote-unicode
-
-Implement rlib.jit.promote_unicode to complement promote_string
-
-.. branch: unicode-utf8
-
-Use utf8 internally to represent unicode, with the goal of never using rpython-level unicode
-
-.. branch: newmemoryview-app-level
-
-Since _ctypes is implemented in pure python over libffi, add interfaces and
-methods to support the buffer interface from python. Specifically, add a
-``__pypy__.newmemoryview`` function to create a memoryview and extend the use
-of the PyPy-specific ``__buffer__`` class method.
\ No newline at end of file
+.. this is a revision shortly after release-pypy-7.1.0
+.. startrev: 78914a03cf95
diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-pypy2-7.1.0.rst
copy from pypy/doc/whatsnew-head.rst
copy to pypy/doc/whatsnew-pypy2-7.1.0.rst
diff --git a/pypy/doc/whatsnew-pypy3-head.rst b/pypy/doc/whatsnew-pypy3-7.1.0.rst
copy from pypy/doc/whatsnew-pypy3-head.rst
copy to pypy/doc/whatsnew-pypy3-7.1.0.rst
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
@@ -1,11 +1,6 @@
========================
-What's new in PyPy3 7.0+
+What's new in PyPy3 7.1+
========================
-.. this is the revision after release-pypy3.6-v7.0
-.. startrev: 33fe3b2cf186
-
-.. branch: py3.5
-
-Merge in py.35 and use this branch as the primary pypy3 one
-
+.. this is the revision after release-pypy3.6-v7.1
+.. startrev: d642a3c217cb
diff --git a/pypy/module/__pypy__/test/test_newmemoryview.py b/pypy/module/__pypy__/test/test_newmemoryview.py
--- a/pypy/module/__pypy__/test/test_newmemoryview.py
+++ b/pypy/module/__pypy__/test/test_newmemoryview.py
@@ -19,7 +19,7 @@
from __pypy__ import bufferable, newmemoryview
class B(bufferable.bufferable):
def __init__(self):
- self.data = bytearray('abc')
+ self.data = bytearray(b'abc')
def __buffer__(self, flags):
return newmemoryview(memoryview(self.data), 1, 'B')
diff --git a/pypy/module/_cffi_backend/ctypestruct.py b/pypy/module/_cffi_backend/ctypestruct.py
--- a/pypy/module/_cffi_backend/ctypestruct.py
+++ b/pypy/module/_cffi_backend/ctypestruct.py
@@ -238,26 +238,32 @@
else:
self.ctype.convert_from_object(cdata, w_ob)
+ def add_varsize_length(self, space, itemsize, varsizelength, optvarsize):
+ # returns an updated 'optvarsize' to account for an array of
+ # 'varsizelength' elements, each of size 'itemsize', that starts
+ # at 'self.offset'.
+ try:
+ varsize = ovfcheck(itemsize * varsizelength)
+ size = ovfcheck(self.offset + varsize)
+ except OverflowError:
+ raise oefmt(space.w_OverflowError,
+ "array size would overflow a ssize_t")
+ assert size >= 0
+ return max(size, optvarsize)
+
def write_v(self, cdata, w_ob, optvarsize):
# a special case for var-sized C99 arrays
from pypy.module._cffi_backend import ctypearray
ct = self.ctype
+ space = ct.space
if isinstance(ct, ctypearray.W_CTypeArray) and ct.length < 0:
- space = ct.space
w_ob, varsizelength = ct.get_new_array_length(w_ob)
if optvarsize != -1:
# in this mode, the only purpose of this function is to compute
# the real size of the structure from a var-sized C99 array
assert cdata == lltype.nullptr(rffi.CCHARP.TO)
- itemsize = ct.ctitem.size
- try:
- varsize = ovfcheck(itemsize * varsizelength)
- size = ovfcheck(self.offset + varsize)
- except OverflowError:
- raise oefmt(space.w_OverflowError,
- "array size would overflow a ssize_t")
- assert size >= 0
- return max(size, optvarsize)
+ return self.add_varsize_length(space, ct.ctitem.size,
+ varsizelength, optvarsize)
# if 'value' was only an integer, get_new_array_length() returns
# w_ob = space.w_None. Detect if this was the case,
# and if so, stop here, leaving the content uninitialized
@@ -267,6 +273,12 @@
#
if optvarsize == -1:
self.write(cdata, w_ob)
+ elif (isinstance(ct, W_CTypeStructOrUnion) and ct._with_var_array and
+ not isinstance(w_ob, cdataobj.W_CData)):
+ subsize = ct.size
+ subsize = ct.convert_struct_from_object(
+ lltype.nullptr(rffi.CCHARP.TO), w_ob, subsize)
+ optvarsize = self.add_varsize_length(space, 1, subsize, optvarsize)
return optvarsize
def convert_bitfield_to_object(self, cdata):
diff --git a/pypy/module/_cffi_backend/newtype.py b/pypy/module/_cffi_backend/newtype.py
--- a/pypy/module/_cffi_backend/newtype.py
+++ b/pypy/module/_cffi_backend/newtype.py
@@ -368,6 +368,16 @@
raise oefmt(space.w_TypeError,
"field '%s.%s' has ctype '%s' of unknown size",
w_ctype.name, fname, ftype.name)
+ elif isinstance(ftype, ctypestruct.W_CTypeStructOrUnion):
+ ftype.force_lazy_struct()
+ # GCC (or maybe C99) accepts var-sized struct fields that are not
+ # the last field of a larger struct. That's why there is no
+ # check here for "last field": we propagate the flag
+ # '_with_var_array' to any struct that contains either an open-
+ # ended array or another struct that recursively contains an
+ # open-ended array.
+ if ftype._with_var_array:
+ with_var_array = True
#
if is_union:
boffset = 0 # reset each field at offset 0
@@ -419,7 +429,6 @@
# a nested anonymous struct or union
# note: it seems we only get here with ffi.verify()
srcfield2names = {}
- ftype.force_lazy_struct()
for name, srcfld in ftype._fields_dict.items():
srcfield2names[srcfld] = name
for srcfld in ftype._fields_list:
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
@@ -3441,6 +3441,15 @@
assert p.a[1] == 20
assert p.a[2] == 30
assert p.a[3] == 0
+ #
+ # struct of struct of varsized array
+ BStruct2 = new_struct_type("bar")
+ complete_struct_or_union(BStruct2, [('head', BInt),
+ ('tail', BStruct)])
+ for i in range(2): # try to detect heap overwrites
+ p = newp(new_pointer_type(BStruct2), [100, [200, list(range(50))]])
+ assert p.tail.y[49] == 49
+
def test_struct_array_no_length_explicit_position():
BInt = new_primitive_type("int")
diff --git a/pypy/module/_multiprocessing/test/test_win32.py b/pypy/module/_multiprocessing/test/test_win32.py
--- a/pypy/module/_multiprocessing/test/test_win32.py
+++ b/pypy/module/_multiprocessing/test/test_win32.py
@@ -2,7 +2,7 @@
import sys
class AppTestWin32:
- spaceconfig = dict(usemodules=('_multiprocessing', _cffi_backend',
+ spaceconfig = dict(usemodules=('_multiprocessing', '_cffi_backend',
'signal', '_rawffi', 'binascii'))
def setup_class(cls):
More information about the pypy-commit
mailing list