Debian Codegraph @

pypy/doc/release-v7.2.0.rst

raw
1 =========================================================
2 PyPy v7.2.0: release of 2.7, and 3.6, released 2019-10-14
3 =========================================================
4
5 The PyPy team is proud to release the version 7.2.0 of PyPy, which includes
6 two different interpreters:
7
8 - PyPy2.7, which is an interpreter supporting the syntax and the features of
9 Python 2.7 including the stdlib for CPython 2.7.13
10
11 - PyPy3.6: which is an interpreter supporting the syntax and the features of
12 Python 3.6, including the stdlib for CPython 3.6.9.
13
14 The interpreters are based on much the same codebase, thus the double
15 release.
16
17 With the support of Arm Holdings Ltd. and `Crossbar.io`_, this release supports
18 the 64-bit ``aarch64`` ARM architecture. More about the work and the
19 performance data around this welcome development can be found in the `blog
20 post`_.
21
22 This release removes the "beta" tag from PyPy3.6. While there may still be some
23 small corner-case incompatibilities (around the exact error messages in
24 exceptions and the handling of faulty codec errorhandlers) we are happy with
25 the quality of the 3.6 series and are looking forward to working on a Python
26 3.7 interpreter.
27
28 We updated our benchmark runner at https://speed.pypy.org to a more modern
29 machine and updated the baseline python to CPython 2.7.11. Thanks to `Baroque
30 Software`_ for maintaining the benchmark runner.
31
32 The CFFI-based ``_ssl`` module was backported to PyPy2.7 and updated to use
33 cryptography_ version 2.7. Additionally the ``_hashlib``, and ``crypt`` (or
34 ``_crypt`` on Python3) modules were converted to CFFI. This has two
35 consequences. End users and packagers can more easily update these libraries
36 for their platform by executing ``(cd lib_pypy; ../bin/pypy _*_build.py)``.
37 More significantly, since PyPy itself links to fewer system shared objects
38 (DLLs), on platforms with a single runtime namespace like linux different CFFI
39 and c-extension modules can load different versions of the same shared object
40 into PyPy without collision (`issue 2617`_).
41
42 Until downstream providers begin to distribute c-extension builds with PyPy, we
43 have made packages for some common packages `available as wheels`_.
44
45 The `CFFI`_ backend has been updated to version 1.13.0. We recommend using CFFI
46 rather than c-extensions to interact with C, and `cppyy`_ for interacting with
47 C++ code.
48
49 Thanks to Anvil_, we revived the `PyPy Sandbox`_, which allows total control
50 over a python interpreter's interactions with the external world.
51
52 We implemented a new JSON decoder that is much faster, uses less memory, and
53 uses a JIT-friendly specialized dictionary.
54
55 As always, this release is 100% compatible with the previous one and fixed
56 several issues and bugs raised by the growing community of PyPy users.
57 We strongly recommend updating. Many of the fixes are the direct result of
58 end-user bug reports, so please continue reporting issues as they crop up.
59
60 You can download the v7.2 releases here:
61
62 https://pypy.org/download.html
63
64 We would like to thank our donors for the continued support of the PyPy
65 project. If PyPy is not quite good enough for your needs, we are available for
66 direct consulting work.
67
68 We would also like to thank our contributors and encourage new people to join
69 the project. PyPy has many layers and we need help with all of them: `PyPy`_
70 and `RPython`_ documentation improvements, tweaking popular modules to run
71 on pypy, or general `help`_ with making RPython's JIT even better. Since the
72 previous release, we have accepted contributions from 27 new contributors,
73 thanks for pitching in.
74
75 .. _`PyPy`: index.html
76 .. _`RPython`: https://rpython.readthedocs.org
77 .. _`help`: project-ideas.html
78 .. _`CFFI`: https://cffi.readthedocs.io
79 .. _`cppyy`: https://cppyy.readthedocs.io
80 .. _`available as wheels`: https://github.com/antocuni/pypy-wheels
81 .. _`Baroque Software`: https://baroquesoftware.com
82 .. _Anvil: https://anvil.works
83 .. _`PyPy Sandbox`: https://morepypy.blogspot.com/2019/08
84 .. _`Crossbar.io`: https://crossbario.com
85 .. _`blog post`: https://morepypy.blogspot.com/2019/07/pypy-jit-for-aarch64.html
86 .. _cryptography: https://cryptography.io/en/latest
87
88 What is PyPy?
89 =============
90
91 PyPy is a very compliant Python interpreter, almost a drop-in replacement for
92 CPython 2.7, 3.6. It's fast (`PyPy and CPython 2.7.x`_ performance
93 comparison) due to its integrated tracing JIT compiler.
94
95 We also welcome developers of other `dynamic languages`_ to see what RPython
96 can do for them.
97
98 This PyPy release supports:
99
100 * **x86** machines on most common operating systems
101 (Linux 32/64 bits, Mac OS X 64 bits, Windows 32 bits, OpenBSD, FreeBSD)
102
103 * big- and little-endian variants of **PPC64** running Linux,
104
105 * **s390x** running Linux
106
107 * 64-bit **ARM** machines running Linux.
108
109 Unfortunately at the moment of writing our ARM buildbots are out of service,
110 so for now we are **not** releasing any binary for the ARM architecture (32
111 bit), although PyPy does support ARM 32 bit processors.
112
113 .. _`PyPy and CPython 2.7.x`: https://speed.pypy.org
114 .. _`dynamic languages`: https://rpython.readthedocs.io/en/latest/examples.html
115
116
117 Changelog
118 =========
119
120 Changes released in v7.1.1
121 --------------------------
122
123 * Improve performance of ``u''.append``
124 * Prevent a crash in ``zlib`` when flushing a closed stream
125 * Fix a few corner cases when encountering unicode values above 0x110000
126 * Teach the JIT how to handle very large constant lists, sets, or dicts
127 * Fix building on ARM32 (`issue 2984`_)
128 * Fix a bug in register assignment in ARM32
129 * Package windows DLLs needed by cffi modules next to the cffi c-extensions
130 (`issue 2988`_)
131 * Cleanup and refactor JIT code to remove ``rpython.jit.metainterp.typesystem``
132 * Fix memoryviews of ctype structures with padding, (CPython issue 32780_)
133
134 Changes to Python 3.6 released in v7.1.1
135 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
136
137 * On win32, override some ``errno.E*`` values that were added to MSVC in v2010
138 so that ``errno.E* == errno.WSAE*`` as in CPython
139 * Do the same optimization that CPython does for ``(1, 2, 3, *a)`` (but at the
140 AST level)
141 * Raise a ``TypeError`` when using buffers and unicode such as ``''.strip(buffer)``
142 and ``'a' < buffer``
143 * Support ``_overlapped`` and asyncio on win32
144 * Fix an issue where ``''.join(list_of_strings)`` would rarely confuse utf8 and
145 bytes (`issue 2997`_)
146 * Fix ``io.IncrementalNewlineDecoder`` interaction with ``\r`` (`issue 3012`_)
147
148 Changes shared across versions
149 ------------------------------
150
151 * Update ``cffi`` to 1.13.0
152 * Add support for ARM aarch64
153 * Many internal changes to the utf-8 processing code, since now unicode strings
154 are stored internally as utf-8. A few corner cases were fixed, and performance
155 bottlenecks were improved. Specifically, issues were fixed with ``maketrans``,
156 ``strip``, comparison with ``bytearray``, use in ``array.array``, ``join``,
157 ``translate``, forrmatting, ``__int__``, ``str(<int>)``, ``startswith``,
158 ``endswith``,
159 * Reduce the probability of a deadlock when acquiring a semaphore by
160 moving global state changes closer to the actual acquire (`issue 2953`_)
161 * Cleanup and refactor parts of the JIT code
162 * Cleanup ``optimizeopt``
163 * Support the ``z15`` variant of the ``s390x`` CPU.
164 * Fixes to ``_ctypes`` handling of memoryviews
165 * Fix a shadowstack overflow when using ``sys.setrecursionlimit`` (`issue 2722`)
166 * Fix a bug that prevent memory-tracking in vmprof working on PyPy
167 * Improve the speed and memory use of the ``_pypyjson`` JSON decoder. The
168 resulting dictionaries that come out of the JSON decoder have faster lookups too
169 * ``struct.unpack`` of a sliced ``bytearray`` exposed a subtle bug where the
170 JIT's ``gc_load`` family of calls must force some lazy code (`issue 3014`_)
171 * Remove ``copystrcontent`` and ``copyunicodecontent`` in the backends.
172 Instead, replace it in ``rewrite.py`` with a direct call to ``memcpy()`` and
173 a new basic operation, ``load_effective_address``, which the backend can
174 even decide not to implement.
175 * Allow 2d indexing in ``memoryview.__setitem__`` (`issue 3028`_)
176 * Speed up 'bytearray += bytes' and other similar combinations
177 * Compute the greatest common divisor of two RPython ``rbigint`` instances
178 using `Lehmer's algorithm`_ and use it in the ``math`` module
179 * Add ``RFile.closed`` to mirror standard `file` behaviour
180 * Add a ``-D`` pytest option to run tests directly on the host python without
181 any knowledge of PyPy internals. This allows using ``pypy3 pytest.py ...``
182 for a subset of tests (called **app-level testing**)
183 * Accept arguments to ``subprocess.Popen`` that are not directly subscriptable
184 (like iterators) (`issue 3050`_)
185 * Catch more low-level ``SocketError`` exceptions and turn them into app-level
186 exceptions (`issue 3049`_)
187 * Fix formatting of a ``memoryview``: ``b"<%s>" % memoryview(b"X")``
188 * Correctly wrap the I/O errors we can get when importing modules
189 * Fix bad output from JSON with ``'skipkeys=True'`` (`issue 3052`_)
190 * Fix compatibility with latest virtualenv HEAD
191 * Avoid ``RuntimeError`` in ``repr()`` of recursive ``dictviews`` (CPython
192 issue 18533_)
193 * Fix for printing after ``gc.get_objects()`` (`issue 2979`)
194 * Optimize many fast-paths through utf-8 code when we know it is ascii or no
195 surroagates are present
196 * Check for a rare case of someone shrinking a buffer from another thread
197 while using it in a ``read()`` variant. One of the issues discovered when
198 reviewing the code for the sandbox.
199 * Prevent segfault when slicing ``array.array`` with a large step size
200 * Support building ``ncurses`` on Suse Linux
201 * Update statically-linked ``_ssl`` OpenSSL to 1.1.0c on ``darwin``
202 * Optimize ``W_TextIOWrapper._readline`` and ``ByteBuffer.getslice``
203 * Fix possible race condition in threading ``Lock.release()`` (`issue 3072`_)
204 * Make ``CDLL(None)`` on win32 raise ``TypeError``
205 * Change ``sys.getfilesystemcodeerors()`` to ``'strict'`` on win32
206 * Update vendored version of ``pycparser`` to version 2.19
207 * Implement a much faster JSON decoder (3x speedup for large json files, 2x less memory)
208
209 C-API (cpyext) and c-extensions
210 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
211
212 * Add ``DateTime_FromTimestamp`` and ``Date_FromTimestamp`` to the
213 ``PyDateTime_CAPI`` struct
214
215 * Add constants and macros needed to build opencv2_ with PyPy2.7
216 * Add more constants to `sysconfig``. Set ``MACOSX_DEPLOYMENT_TARGET`` for
217 darwin (`issue 2994`_)
218 * fix ``CBuffer.buffer_attach``
219 * Add ``_PyDict_GetItemWithError`` (``PyDict_GetItemWithError`` on Python3)
220
221 Python 3.6 only
222 ---------------
223
224 * Accept ``a, b = (*x, 2)`` (`issue 2995`_)
225 * Class methods with the signature ``def meth(*args, **kwargs)`` were not adding
226 an implied ``self`` argument (`issue 2996`_)
227 * Fix handling of ``__fpath__`` (`issue 2985`_)
228 * Disable ``assert`` when run with ``-O`` (`issue 3000`_)
229 * ``codecs.encode``, ``codecs.decode`` can behave differently than
230 ``ustr.encode``, ``bytes.decode`` (`issue 3001`_)
231 * Putting ``pdb.set_trace`` call in a threaded program did not work (`issue
232 3003`_)
233 * Fix parsing for converting strings with underscore into ints
234 * Add ``memoryview.obj`` which stores a reference, (`issue 3016`_)
235 * Fix datetime.fromtimestamp for win32 (CPython issue 29097_)
236 * Improve multiprocessing support on win32
237 * Support negative offsets in ``lnotab`` (`issue 2943`_)
238 * Fix leak of file descriptor with `_io.FileIO('dir/')`
239 * Fix ``float.__round__(None)`` (`issue 3033`_)
240 * Fix for when we should use the Universal Newline mode on Windows for
241 stdin/stdout/stderr (`issue 3007`_)
242 * Fix ImportError invalid arguments error wording
243 * Ignore GeneratorExit when throwing into the aclose coroutine of an
244 asynchronous generator (CPython issue 35409_)
245 * Improve the pure-python ``faulthander`` module
246 * Properly raise an exception when a ``BlockingIOError`` exception escapes
247 from ``W_BufferedReader.readline_w()`` (`issue 3042`_)
248 * Fix a code path only used in ``zipimport`` (`issue 3034`_)
249 * Update the stdlib to 3.6.9, fix many failing tests
250 * Fix handling of ``__debug__``, ``-O``, and ``sys.flags.optimizeOptimize``
251 (CPython issue 27169_)
252 * Fix raising ``SystemExit`` in ``atexit``
253 * Fix case where ``int(<subint>)`` would go into infinite recursion
254 * Don't ignore fold parameter in ``(date,)time.replace()``
255 * Fix logic bug for ``memoryview.cast`` (when ``view.format`` is not ``'B'``)
256 * Implement retry-on-EINTR in fcntl module (CPython issue 35189_)
257 * Fix handling of 1st argument to ``hashlib.blake2{b,s}()`` (CPython issue
258 33729_)
259 * Prevent overflow in ``_hashlib`` ``digest()`` (CPython issue 34922_)
260 * ``IOBase.readlines()`` relies on the iterator protocol instead of calling
261 ``readline()`` directly
262 * Don't inherit ``IS_ABSTRACT`` flag in classes
263 * Reset raw_pos after unwinding the raw stream (CPython issue 32228_)
264 * Add existing options ``-b`` and ``-d`` to ``pypy3 --help`` text
265 * Clean up ``_codecs`` error handling code
266 * Add support for using stdlib as a zipfile
267 * Check return type of ``__prepare__()`` (CPython issue 31588_)
268 * Fix logic in ``_curses.get_wch`` (`issue 3064`_)
269 * Match CPython exit code when failing to flush stdout/stderr at exit
270 * Improve SyntaxError message output
271 * Add ``range.__bool__``
272 * Add cursor validity check to ``_sqlite.Cursor.close``
273 * Improve message when mistakenly using ``print something`` in Python3
274 * Handle generator exit in ``athrow()`` (CPython issue 33786_)
275 * Support unmarshalling ``TYPE_INT64`` and turn ``OverflowErrors`` from
276 ``marshal.loads`` into ``ValueErrors``
277 * Update ``_posixsubprocess.c`` to match CPython (CPython issue 32270_)
278 * Remove unused ``_posixsubprocess.cloexec_pipe()``
279 * Add missing constants to ``stat`` and ``kill _stat`` (`issue 3073`_)
280 * Fix argument handling in ``select.poll().poll()``
281 * Raise ``SyntaxError`` instead of ``DeprecationWarning`` when treating invalid
282 escapes in bytes as errors (CPython issue 28691_)
283 * Handle locale in `time.strftime()`. (`issue 3079`_)
284 * Fix an issue when calling ``PyFrame.fset_f_lineno`` (`issue 3066`_)
285
286 Python 3.6 c-API
287 ~~~~~~~~~~~~~~~~
288
289 * Add ``PyStructSequence_InitType2``, ``Py_RETURN_NOTIMPLEMENTED``,
290 ``PyGILState_Check``, ``PyUnicode_AsUCS4``, ``PyUnicode_AsUCS4Copy``,
291 ``PyErr_SetFromWindowsErr``,
292 * Sync the various ``Py**Flag`` constants with CPython
293 * Allow ``PyTypeObject`` with ``tp_doc==""`` (`issue 3055`_)
294 * Update ``pymacro.h`` to match CPython 3.6.9
295 * Support more datetime C functions and definitions
296
297 .. _`Lehmer's algorithm`: https://en.wikipedia.org/wiki/Lehmer's_GCD_algorithm
298 .. _29097: https://bugs.python.org/issue29097
299 .. _32780: https://bugs.python.org/issue32780
300 .. _35409 : https://bugs.python.org/issue35409
301 .. _27169 : https://bugs.python.org/issue27169
302 .. _18533 : https://bugs.python.org/issue18533
303 .. _35189 : https://bugs.python.org/issue35189
304 .. _33279 : https://bugs.python.org/issue33279
305 .. _34922 : https://bugs.python.org/issue34922
306 .. _32228 : https://bugs.python.org/issue32228
307 .. _31588 : https://bugs.python.org/issue31588
308 .. _33786 : https://bugs.python.org/issue33786
309 .. _32270 : https://bugs.python.org/issue32270
310 .. _28691 : https://bugs.python.org/issue28691
311 .. _33729 : https://bugs.python.org/issue33729
312
313 .. _opencv2: https://github.com/skvark/opencv-python/
314 .. _`issue 2617`: https://bitbucket.com/pypy/pypy/issues/2617
315 .. _`issue 2722`: https://bitbucket.com/pypy/pypy/issues/2722
316 .. _`issue 2953`: https://bitbucket.com/pypy/pypy/issues/2953
317 .. _`issue 2943`: https://bitbucket.com/pypy/pypy/issues/2943
318 .. _`issue 2980`: https://bitbucket.com/pypy/pypy/issues/2980
319 .. _`issue 2984`: https://bitbucket.com/pypy/pypy/issues/2984
320 .. _`issue 2994`: https://bitbucket.com/pypy/pypy/issues/2994
321 .. _`issue 2995`: https://bitbucket.com/pypy/pypy/issues/2995
322 .. _`issue 2996`: https://bitbucket.com/pypy/pypy/issues/2995
323 .. _`issue 2997`: https://bitbucket.com/pypy/pypy/issues/2995
324 .. _`issue 2988`: https://bitbucket.com/pypy/pypy/issues/2988
325 .. _`issue 2985`: https://bitbucket.com/pypy/pypy/issues/2985
326 .. _`issue 2986`: https://bitbucket.com/pypy/pypy/issues/2986
327 .. _`issue 3000`: https://bitbucket.com/pypy/pypy/issues/3000
328 .. _`issue 3001`: https://bitbucket.com/pypy/pypy/issues/3001
329 .. _`issue 3003`: https://bitbucket.com/pypy/pypy/issues/3003
330 .. _`issue 3007`: https://bitbucket.com/pypy/pypy/issues/3007
331 .. _`issue 3012`: https://bitbucket.com/pypy/pypy/issues/3012
332 .. _`issue 3014`: https://bitbucket.com/pypy/pypy/issues/3014
333 .. _`issue 3016`: https://bitbucket.com/pypy/pypy/issues/3016
334 .. _`issue 3028`: https://bitbucket.com/pypy/pypy/issues/3028
335 .. _`issue 3033`: https://bitbucket.com/pypy/pypy/issues/3033
336 .. _`issue 3034`: https://bitbucket.com/pypy/pypy/issues/3034
337 .. _`issue 3042`: https://bitbucket.com/pypy/pypy/issues/3042
338 .. _`issue 3049`: https://bitbucket.com/pypy/pypy/issues/3049
339 .. _`issue 3050`: https://bitbucket.com/pypy/pypy/issues/3050
340 .. _`issue 3052`: https://bitbucket.com/pypy/pypy/issues/3052
341 .. _`issue 3055`: https://bitbucket.com/pypy/pypy/issues/3055
342 .. _`issue 2979`: https://bitbucket.com/pypy/pypy/issues/2979
343 .. _`issue 3064`: https://bitbucket.com/pypy/pypy/issues/3064
344 .. _`issue 3072`: https://bitbucket.com/pypy/pypy/issues/3072
345 .. _`issue 3073`: https://bitbucket.com/pypy/pypy/issues/3073
346 .. _`issue 3079`: https://bitbucket.com/pypy/pypy/issues/3079
347 .. _`issue 3066`: https://bitbucket.com/pypy/pypy/issues/3066