From issues-reply at bitbucket.org Mon Jul 1 11:35:49 2019 From: issues-reply at bitbucket.org (Anthony Sottile) Date: Mon, 01 Jul 2019 15:35:49 +0000 (UTC) Subject: [pypy-issue] Issue #3034: egg __spec__ is `None` if queried while importing using `importlib.util.find_spec` (pypy/pypy) Message-ID: <20190701153549.26958.72462@app-137.ash1.bb-inf.net> New issue 3034: egg __spec__ is `None` if queried while importing using `importlib.util.find_spec` https://bitbucket.org/pypy/pypy/issues/3034/egg-__spec__-is-none-if-queried-while Anthony Sottile: this is a bit of a rabbit hole, apologies ? originally from [https://github.com/pallets/flask/issues/3278](https://github.com/pallets/flask/issues/3278) ? An egg which queries itself using `importlib.util.find_spec` is unable to retrieve its own information. \(This works fine for normal modules it appears\) ? Here?s my minimal setup, shoved into one script: ? ```python import os.path import tempfile import subprocess import sys with tempfile.TemporaryDirectory() as t: with open(os.path.join(t, 'setup.py'), 'w') as setup: setup.write( 'from setuptools import setup\n' 'setup(packages=["site_egg"], zip_safe=True)' ) os.mkdir(os.path.join(t, 'site_egg')) with open(os.path.join(t, 'site_egg/__init__.py'), 'w') as f: f.write( 'import importlib.util\n' 'assert importlib.util.find_spec(__name__) is not None\n' ) open(os.path.join(t, 'site_egg/__init__.py'), 'a').close() subprocess.check_call( (sys.executable, 'setup.py', 'bdist_egg'), stdout=subprocess.DEVNULL, cwd=t, ) egg, = os.listdir(os.path.join(t, 'dist')) sys.path.insert(0, os.path.join(t, 'dist', egg)) import site_egg ``` ? in cpython I get the following output: ? ```shell $ python3.6 t.py $ ``` ? However with pypy3 I get: ? ``` $ pypy3 t.py Traceback (most recent call last): File "t.py", line 29, in import site_egg File "/tmp/tmp1c9axaoe/dist/UNKNOWN-0.0.0-py3.6.egg/site_egg/__init__.py", line 2, in File "/tmp/y/venvpp/lib-python/3/importlib/util.py", line 102, in find_spec raise ValueError('{}.__spec__ is None'.format(name)) ValueError: site_egg.__spec__ is None ``` ? ``` $ pypy3 --version --version Python 3.6.1 (784b254d6699, Apr 14 2019, 10:22:42) [PyPy 7.1.1-beta0 with GCC 6.2.0 20160901] ``` From issues-reply at bitbucket.org Mon Jul 1 16:09:04 2019 From: issues-reply at bitbucket.org (hugovk) Date: Mon, 01 Jul 2019 20:09:04 +0000 (UTC) Subject: [pypy-issue] Issue #3035: CPython old-style Unicode API deprecations (pypy/pypy) Message-ID: <20190701200904.1072.8649@celery-worker-111.ash1.bb-inf.net> New issue 3035: CPython old-style Unicode API deprecations https://bitbucket.org/pypy/pypy/issues/3035/cpython-old-style-unicode-api-deprecations hugovk: CPython deprecated `PyUnicode_AS_UNICODE` \(amongst others\) in CPython 3.3, and will remove it in CPython 4.0. [https://docs.python.org/3/c-api/unicode.html#c.PyUnicode\_AS\_UNICODE](https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_AS_UNICODE) Are there any plans to deprecate/remove/replace it in PyPy? More generally, how does PyPy deal with deprecations made in CPython? --- We had a [PR](https://github.com/python-pillow/Pillow/pull/3780) in our project to replace `PyUnicode_AS_UNICODE` with `PyUnicode_AsUCS4Copy` or `PyUnicode_READ_CHAR`. Whilst this was fine for CPython, we got an [error](https://github.com/python-pillow/Pillow/issues/3835#issuecomment-507351734) on PyPy3: `_imagingft.obj : error LNK2019: unresolved external symbol _PyUnicode_AsUCS4Copy referenced in function _text_layout_raqm` With: Python 3.6.1 \(784b254d6699, Apr 16 2019, 12:10:48\) \[PyPy 7.1.1-beta0 with MSC v.1910 32 bit\] on win32 and: Python 3.5.3 \(928a4f70d3de, Feb 08 2019, 12:56:35\) \[PyPy 7.0.0 with MSC v.1910 32 bit\] on win32 Thank you! From issues-reply at bitbucket.org Wed Jul 3 08:54:19 2019 From: issues-reply at bitbucket.org (Sasquatch) Date: Wed, 03 Jul 2019 12:54:19 +0000 (UTC) Subject: [pypy-issue] Issue #3036: Tkinter UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1 (pypy/pypy) Message-ID: <20190703125419.6070.45843@celery-worker-110.ash1.bb-inf.net> New issue 3036: Tkinter UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1 https://bitbucket.org/pypy/pypy/issues/3036/tkinter-unicodeencodeerror-mbcs-codec-cant Sasquatch: I am trying to get matplotlib working on my machine with pypy, but it seems tkinter is causing problems. I installed pypy from the nightly builds as recommend from here [https://stackoverflow.com/questions/56826170/value-error-invalid-argument-with-pypy-when-importing-pandas-and-plotly](https://stackoverflow.com/questions/56826170/value-error-invalid-argument-with-pypy-when-importing-pandas-and-plotly) When I import tkinter however, I get: ? ```python >>>> import tkinter Traceback (most recent call last): File "", line 1, in File "C:\pypy-c-jit-96765-24757bd09ed9-win32\lib-python\3\tkinter\__init__.py" , line 36, in import _tkinter # If this fails your Python may not be configured for Tk File "C:\pypy-c-jit-96765-24757bd09ed9-win32\lib_pypy\_tkinter\__init__.py", l ine 55, in tklib.Tcl_FindExecutable(os.fsencode(sys.executable)) File "C:\pypy-c-jit-96765-24757bd09ed9-win32\lib-python\3\os.py", line 800, in fsencode return filename.encode(encoding, errors) UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: mbcs encoding does not support errors='surrogateescape' ``` And thus: ``` >>>> import matplotlib.pyplot Traceback (most recent call last): File "", line 1, in File "C:\pypy-c-jit-96765-24757bd09ed9-win32\site-packages\matplotlib\pyplot.p y", line 2355, in switch_backend(rcParams["backend"]) File "C:\pypy-c-jit-96765-24757bd09ed9-win32\site-packages\matplotlib\pyplot.p y", line 221, in switch_backend backend_mod = importlib.import_module(backend_name) File "C:\pypy-c-jit-96765-24757bd09ed9-win32\lib-python\3\importlib\__init__.p y", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 979, in _gcd_import File "", line 962, in _find_and_load File "", line 951, in _find_and_load_unlocked File "", line 656, in _load_unlocked File "/frozen importlib._bootstrap_external", line 691, in exec_modul e File "", line 206, in _call_with_frames_removed File "C:\pypy-c-jit-96765-24757bd09ed9-win32\site-packages\matplotlib\backends \backend_tkagg.py", line 1, in from . import _backend_tk File "C:\pypy-c-jit-96765-24757bd09ed9-win32\site-packages\matplotlib\backends \_backend_tk.py", line 6, in import tkinter as tk File "C:\pypy-c-jit-96765-24757bd09ed9-win32\lib-python\3\tkinter\__init__.py" , line 36, in import _tkinter # If this fails your Python may not be configured for Tk File "C:\pypy-c-jit-96765-24757bd09ed9-win32\lib_pypy\_tkinter\__init__.py", l ine 55, in tklib.Tcl_FindExecutable(os.fsencode(sys.executable)) File "C:\pypy-c-jit-96765-24757bd09ed9-win32\lib-python\3\os.py", line 800, in fsencode return filename.encode(encoding, errors) UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: mbcs encoding does not support errors='surrogateescape' ``` From issues-reply at bitbucket.org Thu Jul 4 09:30:31 2019 From: issues-reply at bitbucket.org (Pierre Augier) Date: Thu, 04 Jul 2019 13:30:31 +0000 (UTC) Subject: [pypy-issue] Issue #3037: PyPy3.6 Release Schedule? New beta quality PyPy3.6 soon? (pypy/pypy) Message-ID: <20190704133031.6519.33871@app-137.ash1.bb-inf.net> New issue 3037: PyPy3.6 Release Schedule? New beta quality PyPy3.6 soon? https://bitbucket.org/pypy/pypy/issues/3037/pypy36-release-schedule-new-beta-quality Pierre Augier: I'd like to use PyPy with packages needing Python >= 3.6. In science, it is now quite standard. For example, conda, which only uses 2 Python versions, is now limited to Python 3.6 and 3.7 \(and quite soon 3.7 and 3.8 :slight_smile: \). So people tend to use f-strings and `pathlib.Path` and to assume that the code will be executed with Python >= 3.6. So having a better PyPy3.6 soon \(for example before EuroScipy in September\) would be desirable. PyPy3.6 7.1.1 has bugs that are now solved in the PyPy36 branch. For example, \[Transonic\]\([https://transonic.readthedocs.io](https://transonic.readthedocs.io)\) tests pass with the nightly builds but fail with PyPy3.6 7.1.1. Do you plan to release a new beta quality PyPy3.6 soon? I didn?t find anything like the release schedule of CPython for PyPy [https://www.python.org/dev/peps/pep-0596/](https://www.python.org/dev/peps/pep-0596/) ? Is there anything similar? From issues-reply at bitbucket.org Fri Jul 5 06:17:25 2019 From: issues-reply at bitbucket.org (=?utf-8?q?Karsten_Fl=C3=BCgge?=) Date: Fri, 05 Jul 2019 10:17:25 +0000 (UTC) Subject: [pypy-issue] Issue #3038: WebAssembly as target (pypy/pypy) Message-ID: <20190705101725.26274.35852@app-147.ash1.bb-inf.net> New issue 3038: WebAssembly as target https://bitbucket.org/pypy/pypy/issues/3038/webassembly-as-target Karsten Fl?gge: Do you have any plans targeting WASM? From issues-reply at bitbucket.org Sat Jul 6 08:46:53 2019 From: issues-reply at bitbucket.org (Shlomi Fish) Date: Sat, 06 Jul 2019 12:46:53 +0000 (UTC) Subject: [pypy-issue] Issue #3039: cython / array.array bindings generate errors (pypy/pypy) Message-ID: <20190706124652.24502.90513@celery-worker-110.ash1.bb-inf.net> New issue 3039: cython / array.array bindings generate errors https://bitbucket.org/pypy/pypy/issues/3039/cython-arrayarray-bindings-generate-errors Shlomi Fish: Why [https://github.com/shlomif/primesieve-python/tree/array-pypy3](https://github.com/shlomif/primesieve-python/tree/array-pypy3) \(note the branch\) gives me <> in pypy3 and works fine in cpython3? After I ?#if 0? the check, I get a segfault: ? ```plaintext shlomif[ProjEuler]:~/progs/riddles/project-euler/git/project-euler/641$ gdb -args pypy3 641-v1.py GNU gdb (GDB) 8.2-8.mga7 (Mageia release 7) Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-mageia-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from pypy3...Reading symbols from /home/shlomif/Download/unpack/prog/python/pypy3.5-6.0.0-linux_x86_64-portable/bin/pypy3.5.debug...(no debugging symbols found)...done. (no debugging symbols found)...done. (gdb) r Starting program: /home/shlomif/Download/unpack/prog/python/pypy3.5-6.0.0-linux_x86_64-portable/bin/pypy3 641-v1.py Missing separate debuginfos, use: debuginfo-install glibc-2.29-14.mga8.x86_64 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. resize (n=26355869, self=0x8e3350) at primesieve/array/_array.cpp:1190 1190 PyMem_Resize(items, char, (size_t)(n * self->ob_descr->itemsize)); Missing separate debuginfos, use: debuginfo-install lib64bz2_1-1.0.6-13.mga7.x86_64 lib64xcrypt1-4.4.6-1.mga7.x86_64 lib64zlib1-1.2.11-7.mga7.x86_64 libgomp1-8.3.1-0.20190628.2.mga8.x86_64 libstdc++6-8.3.1-0.20190628.2.mga8.x86_64 (gdb) p self $1 = (arrayobject *) 0x8e3350 (gdb) p self[0] $2 = {ob_refcnt = 2305843009213693953, ob_pypy_link = 140737275159976, ob_type = 0x8bb840, ob_size = 262193, data = {ob_item = 0x0, as_floats = 0x0, as_doubles = 0x0, as_ints = 0x0, as_uints = 0x0, as_uchars = 0x0, as_schars = 0x0, as_chars = 0x0, as_ulongs = 0x0, as_longs = 0x0, as_ulonglongs = 0x0, as_longlongs = 0x0, as_shorts = 0x0, as_ushorts = 0x0, as_pyunicodes = 0x0, as_voidptr = 0x0}, allocated = 0, ob_descr = 0x4100015a90, weakreflist = 0x4000, ob_exports = -309255392} (gdb) p self[0].ob ob_descr ob_pypy_link ob_size ob_exports ob_refcnt ob_type (gdb) p self[0].ob_descr $3 = (arraydescr *) 0x4100015a90 (gdb) p self[0].ob_descr [0] Cannot access memory at address 0x4100015a90 (gdb) p items $4 = (void *) 0x0 (gdb) p n $5 = 26355869 (gdb) p self[0].ob_descr $6 = (arraydescr *) 0x4100015a90 (gdb) q A debugging session is active. ``` Thanks! ? Here is the offending code: ? ```python # import array import heapq import sys import time from bisect import bisect_right # from subprocess import PIPE, Popen # import primesieve import primesieve.array from six import print_ from six.moves import range # Tuple is (n,k) where n is the sum and k is the count. # pipe = Popen(["primesieve", "-p1", "2", "500000029"], stdout=PIPE).stdout # pipe = Popen("primesieve -p1 2 1000", shell=True, stdout=PIPE).stdout t1 = time.time() primes = primesieve.array.primes(500000029) print_(primes[0]) t2 = time.time() ``` From issues-reply at bitbucket.org Mon Jul 8 08:56:14 2019 From: issues-reply at bitbucket.org (Amit Ripshtos) Date: Mon, 08 Jul 2019 12:56:14 +0000 (UTC) Subject: [pypy-issue] Issue #3040: ssl module in pypy3.6 does not have ssl.OP_NO_SSLv2 (pypy/pypy) Message-ID: <20190708125613.34835.30877@celery-worker-112.ash1.bb-inf.net> New issue 3040: ssl module in pypy3.6 does not have ssl.OP_NO_SSLv2 https://bitbucket.org/pypy/pypy/issues/3040/ssl-module-in-pypy36-does-not-have Amit Ripshtos: Hey guys, thanks for working on pypy! I found an issue when using aiohttp with pypy3.6 and doing verify=False , the aiohttp code creates SSLContext by doing: ``` sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23) sslcontext.options |= ssl.OP_NO_SSLv2 sslcontext.options |= ssl.OP_NO_SSLv3 sslcontext.options |= ssl.OP_NO_COMPRESSION sslcontext.set_default_verify_paths() return sslcontext ``` ? However, this code fails with the following exception: ``` AttributeError: module 'ssl' has no attribute 'OP_NO_SSLv2' ``` ? I tried to take a look and I saw that in pypy3.6, the attribute/option ?OP\_NO\_SSLv2?, therefore the aiohttp package fails when using the verify\_ssl=False setting. ? **How to mimic the issue:** Using pypy3.6, try to run this code: ``` import aiohttp async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False)) as session: async with session.request(method='get', url='https://google.com') as response: response.raise_for_status() await response.read() ``` ? This code will fail with the exception: `AttributeError: module 'ssl' has no attribute 'OP_NO_SSLv2'` ? **How it should be:** There should be be OP\_NO\_SSLv2 attribute under ssl module. ? I will try to fix the issue on my own, however I?m a newbie to pypy code , therefore I might need help. ? Thanks and have a great week, Amit. From issues-reply at bitbucket.org Mon Jul 8 09:43:48 2019 From: issues-reply at bitbucket.org (=?utf-8?q?Johan_J=C3=B6nsson?=) Date: Mon, 08 Jul 2019 13:43:48 +0000 (UTC) Subject: [pypy-issue] Issue #3041: pypy3 import numpy fails unknown symbol PyGILState_Check (pypy/pypy) Message-ID: <20190708134347.30209.12837@celery-worker-110.ash1.bb-inf.net> New issue 3041: pypy3 import numpy fails unknown symbol PyGILState_Check https://bitbucket.org/pypy/pypy/issues/3041/pypy3-import-numpy-fails-unknown-symbol Johan J?nsson: I am trying to install numpy \(both from source and via pip\). With pypy-7.1.1-beta0 \(from the gentoo repositories\) I can build/install numpy, however when I try to import numpy i get the following output ``` Python 3.6.1 (784b254d669919c872a505b807db8462b6140973, Jul 07 2019, 15:05:37) [PyPy 7.1.1-beta0 with GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``it's nonsense all the way down, and also all the way up'' >>>> import numpy Traceback (most recent call last): File ".local/lib/pypy3.6/site-packages/numpy/core/__init__.py", line 17, in from . import multiarray File ".local/lib/pypy3.6/site-packages/numpy/core/multiarray.py", line 14, in from . import overrides File ".local/lib/pypy3.6/site-packages/numpy/core/overrides.py", line 7, in from numpy.core._multiarray_umath import ( ImportError: .local/lib/pypy3.6/site-packages/numpy/core/_multiarray_umath.pypy3-71-x86_64-linux-gnu.so: undefined symbol: PyGILState_Check During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "~/.local/lib/pypy3.6/site-packages/numpy/__init__.py", line 142, in from . import core File ".local/lib/pypy3.6/site-packages/numpy/core/__init__.py", line 47, in raise ImportError(msg) ImportError: IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE! Importing the numpy c-extensions failed. - Try uninstalling and reinstalling numpy. - If you have already done that, then: 1. Check that you expected to use Python3.6 from "/usr/bin/pypy3", and that you have no directories in your PATH or PYTHONPATH that can interfere with the Python and numpy version "1.18.0.dev0+48efcc7" you're trying to use. 2. If (1) looks fine, you can open a new issue at https://github.com/numpy/numpy/issues. Please include details on: - how you installed Python - how you installed numpy - your operating system - whether or not you have multiple versions of Python installed - if you built from source, your compiler versions and ideally a build log - If you're working with a numpy git repository, try `git clean -xdf` (removes all files not under version control) and rebuild numpy. Note: this error has many possible causes, so please don't comment on an existing issue about this - open a new one instead. Original error was: ~/.local/lib/pypy3.6/site-packages/numpy/core/_multiarray_umath.pypy3-71-x86_64-linux-gnu.so: undefined symbol: PyGILState_Check ``` From issues-reply at bitbucket.org Tue Jul 9 04:47:22 2019 From: issues-reply at bitbucket.org (Jacob Lifshay) Date: Tue, 09 Jul 2019 08:47:22 +0000 (UTC) Subject: [pypy-issue] Issue #3042: crash when reading non-blocking subprocess output (pypy/pypy) Message-ID: <20190709084722.30273.4186@app-137.ash1.bb-inf.net> New issue 3042: crash when reading non-blocking subprocess output https://bitbucket.org/pypy/pypy/issues/3042/crash-when-reading-non-blocking-subprocess Jacob Lifshay: Output: ``` RPython traceback: File "pypy_interpreter.c", line 37926, in BuiltinCode_funcrun_obj File "pypy_module__io_1.c", line 11207, in W_BufferedReader_readline_w File "implement_2.c", line 32105, in dispatcher_70 File "pypy_module__io.c", line 15998, in W_BufferedReader__raw_read Traceback (most recent call last): File "pypy_bug.py", line 10, in s = p.stdout.readline() SystemError: unexpected internal exception (please report a bug): ; internal traceback was dumped to stderr ``` Versions: Python 3.6.1 \(7a2e437acfce, Mar 21 2019, 13:39:41\) \[PyPy 7.2.0-beta0 with GCC 6.2.0 20160901\] Ubuntu 18.04 x86\_64 reproducable using: ```python import subprocess import fcntl import os from select import select p = subprocess.Popen(["/bin/bash", "-c", "printf ''"], stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=None) fl = fcntl.fcntl(p.stdout, fcntl.F_GETFL) fcntl.fcntl(p.stdout, fcntl.F_SETFL, fl | os.O_NONBLOCK) while True: s = p.stdout.readline() print(s) if len(s) == 0: if p.poll() is not None: break try: select([p.stdout], [], [], 1.0) except InterruptedError: pass ``` From issues-reply at bitbucket.org Fri Jul 12 04:50:09 2019 From: issues-reply at bitbucket.org (Christoph Deil) Date: Fri, 12 Jul 2019 08:50:09 +0000 (UTC) Subject: [pypy-issue] Issue #3043: Support Py_RETURN_NOTIMPLEMENTED (pypy/pypy) Message-ID: <20190712085008.3648.42109@celery-worker-108.ash1.bb-inf.net> New issue 3043: Support Py_RETURN_NOTIMPLEMENTED https://bitbucket.org/pypy/pypy/issues/3043/support-py_return_notimplemented Christoph Deil: Hi, I?d like to try Astropy on PyPy. \(related ticket from last year in the Astropy tracker: [https://github.com/astropy/astropy/issues/7768](https://github.com/astropy/astropy/issues/7768)\) At the moment, `pip_pypy3 install astropy` fails like this: ``` astropy/wcs/src/unit_list_proxy.c:199:5: error: use of undeclared identifier 'Py_RETURN_NOTIMPLEMENTED' ``` Full log: [https://gist.github.com/cdeil/74d46beebdabf5b40cccedde759bdec1#file-gistfile1-txt-L1503](https://gist.github.com/cdeil/74d46beebdabf5b40cccedde759bdec1#file-gistfile1-txt-L1503) >From [https://docs.python.org/3/c-api/object.html](https://docs.python.org/3/c-api/object.html) : > `Py_RETURN_NOTIMPLEMENTED` - Properly handle returning `Py_NotImplemented` from within a C function \(that is, increment the reference count of NotImplemented and return it\). Is `Py_RETURN_NOTIMPLEMENTED` something you could support in PyPy? From issues-reply at bitbucket.org Sat Jul 13 11:04:58 2019 From: issues-reply at bitbucket.org (Zsolt Cserna) Date: Sat, 13 Jul 2019 15:04:58 +0000 (UTC) Subject: [pypy-issue] Issue #3044: py3.6: str.encode should not work with not-text encoders (pypy/pypy) Message-ID: <20190713150457.33657.87563@celery-worker-109.ash1.bb-inf.net> New issue 3044: py3.6: str.encode should not work with not-text encoders https://bitbucket.org/pypy/pypy/issues/3044/py36-strencode-should-not-work-with-not Zsolt Cserna: With Cpython, using a non-text encoder such as ?hex?, the following happens: ``` >>> "foo".encode("hex") Traceback (most recent call last): File "", line 1, in LookupError: 'hex' is not a text encoding; use codecs.encode() to handle arbitrary codecs ``` In pypy this call gets to the codec itself, where `TypeError` is raised \(which is correct as this encoding works on bytes, not on unicode\): ``` >>>> "foo".encode("hex") Traceback (most recent call last): File "/home/zsolt/src/pypy/lib-python/3/encodings/hex_codec.py", line 15, in hex_encode return (binascii.b2a_hex(input), len(input)) TypeError: a bytes-like object is required, not str ``` The root cause of the problem is that when looking up a codec in `str.encode`, `lookup_text_codec()` function is not called. Thereby the CodecInfo's `_is_text_encoding` is not checked at all as `str.encode` uses `codes.encode`under the hood. The solution would be adding a check for this method somewhere between `str.encode` and using the encoder. From issues-reply at bitbucket.org Mon Jul 22 09:23:20 2019 From: issues-reply at bitbucket.org (H. Turgut Uyar) Date: Mon, 22 Jul 2019 13:23:20 +0000 (UTC) Subject: [pypy-issue] Issue #3045: pathlib path resolving incorrectly (pypy/pypy) Message-ID: <20190722132319.12948.95063@app-147.ash1.bb-inf.net> New issue 3045: pathlib path resolving incorrectly https://bitbucket.org/pypy/pypy/issues/3045/pathlib-path-resolving-incorrectly H. Turgut Uyar: On PyPy 3.6.1 \(7.1.1-beta0\), resolving a pathlib path that contains an intermediate parent step produces an incorrect result \(at least, different from CPython\). For example, if the current directory is `/home/uyar/Projects/myproject` which contains a `docs` directory and a `setup.py` file, the following code produces `PosixPath('/home/uyar/Projects/myproject/docs')` ```python from pathlib import Path Path("docs/../setup.py").resolve() ``` Whereas in CPython the same code produces `PosixPath('/home/uyar/Projects/myproject/setup.py')` From issues-reply at bitbucket.org Wed Jul 24 07:37:41 2019 From: issues-reply at bitbucket.org (Alex Edwards) Date: Wed, 24 Jul 2019 11:37:41 +0000 (UTC) Subject: [pypy-issue] Issue #3046: Raspberry Pi Observations - RAM and Library Checks? (pypy/pypy) Message-ID: <20190724113741.29832.64857@celery-worker-110.ash1.bb-inf.net> New issue 3046: Raspberry Pi Observations - RAM and Library Checks? https://bitbucket.org/pypy/pypy/issues/3046/raspberry-pi-observations-ram-and-library Alex Edwards: Hi, I?ve just been compiling PyPy pypy2.7-v7.1.1-src.zip on a Raspberry Pi ?stretch? - quite a slow process! :slight_smile: Thought I?d share my installation experience and niggles and hope it helps. After quite a long time, 30-60mins perhaps, it bombed out with insufficient memory. I added some more swap and its working. It could be handy to simply warn if memory less than 500MB or 1GB spare perhaps? Adding 1GB swap worked, though I didn?t try smaller amounts. Then installing again, after perhaps an hour, the build failed again because of a missing -dev library / package libbz2-dev. Then twice more on libncurses5-dev. I then found your helpful page - [http://doc.pypy.org/en/latest/build.html](http://doc.pypy.org/en/latest/build.html) - and installed all the packages I could in advance. sudo apt-get install libexpat1-dev sudo apt-get install libncurses-dev sudo apt-get install libncursesw-dev sudo apt-get install libgdbm-dev sudo apt-get install tk-dev -- installs X, so avoid if possible sudo apt-get install liblzma-dev It would have helped me a lot if these dependencies had been spotted and warned/failed sooner. Also a link to your installation page would help too, rather than failing on one package per long compile. PS - I only more recently noticed that a newer version of pypy is in Raspbian buster - I should probably have just installed that! :smiley: Cheers Alex From issues-reply at bitbucket.org Thu Jul 25 11:30:46 2019 From: issues-reply at bitbucket.org (Zihan Zheng) Date: Thu, 25 Jul 2019 15:30:46 +0000 (UTC) Subject: [pypy-issue] Issue #3047: Internal exception when loading json with unicode escapes (pypy/pypy) Message-ID: <20190725153046.7061.3313@app-137.ash1.bb-inf.net> New issue 3047: Internal exception when loading json with unicode escapes https://bitbucket.org/pypy/pypy/issues/3047/internal-exception-when-loading-json-with Zihan Zheng: ``` >>>> import json >>>> json.loads('"\\udc00\\udc00"') RPython traceback: File "pypy_interpreter.c", line 42074, in BuiltinCode2_fastcall_2 File "pypy_module__pypyjson.c", line 221, in loads_1 File "pypy_module__pypyjson.c", line 647, in JSONDecoder_decode_any File "pypy_module__pypyjson.c", line 5884, in JSONDecoder_decode_string_escaped File "pypy_module__pypyjson.c", line 8763, in JSONDecoder_decode_escape_sequence_unicode File "rpython_rlib.c", line 23815, in unichr_as_utf8 Traceback (most recent call last): File "", line 1, in File "/usr/local/lib-python/3/json/__init__.py", line 361, in loads if _pypyjson else _default_decoder.decode(s)) SystemError: unexpected internal exception (please report a bug): ; internal traceback was dumped to stderr ``` Expected result: `'\udc00\udc00'` PyPy version: PyPy 7.1.1-beta0 From issues-reply at bitbucket.org Mon Jul 29 14:24:52 2019 From: issues-reply at bitbucket.org (Ronan Lamy) Date: Mon, 29 Jul 2019 18:24:52 +0000 (UTC) Subject: [pypy-issue] Issue #3048: tracemalloc (pypy/pypy) Message-ID: <20190729182451.17315.41479@app-147.ash1.bb-inf.net> New issue 3048: tracemalloc https://bitbucket.org/pypy/pypy/issues/3048/tracemalloc Ronan Lamy: pypy doesn't implement the tracemalloc module because it?s closely tied to CPython internals. However, quoting from [What?s New In Python 3.6](https://docs.python.org/3/whatsnew/3.6.html#warnings): > When a `ResourceWarning` warning is logged, the `tracemalloc` module is now used to try to retrieve the traceback where the destroyed object was allocated. which is a useful thing to do on any implementation and rather similar to what `pypy2 -X track-resources` does. So: * is there a sensible way to create a `_tracemalloc` that would make this work like on CPython? * or should we just enable `-X track-resources` on pypy3?