From issues-reply at bitbucket.org Fri Mar 3 08:35:02 2017 From: issues-reply at bitbucket.org (Jayson Reis) Date: Fri, 03 Mar 2017 13:35:02 -0000 Subject: [pypy-issue] Issue #2489: TypeError: object() takes no parameters when making singleton of extend tzinfo (pypy/pypy) Message-ID: <20170303133502.30306.47482@celery-worker-108.ash1.bb-inf.net> New issue 2489: TypeError: object() takes no parameters when making singleton of extend tzinfo https://bitbucket.org/pypy/pypy/issues/2489/typeerror-object-takes-no-parameters-when Jayson Reis: psycopg2cffi uses `__new__` of it's extended tzinfo version to make a singleton for specific tzinfos and this used to work on python 3.5.3 but using pypy3 nightly `Python 3.5.2 (6c8f0848fcf2, Mar 03 2017, 02:00:11)` `[PyPy 5.6.0-alpha0 with GCC 4.8.2] on linux` it will break with this message: ``` root at 945f7d0c31f9:/data# pypy3 test.py Traceback (most recent call last): File "test.py", line 17, in __new__ return cls._cache[key] KeyError: (None, None) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 24, in print(FixedOffsetTimezone()) File "test.py", line 19, in __new__ tz = super(FixedOffsetTimezone, cls).__new__(cls, offset, name) TypeError: object() takes no parameters ``` and this is the piece of code that will make it happen. ```python import datetime class FixedOffsetTimezone(datetime.tzinfo): _cache = dict() def __init__(self, offset=None, name=None): if offset is not None: self._offset = datetime.timedelta(minutes = offset) if name is not None: self._name = name def __new__(cls, offset=None, name=None): """Return a suitable instance created earlier if it exists """ key = (offset, name) try: return cls._cache[key] except KeyError: tz = super(FixedOffsetTimezone, cls).__new__(cls, offset, name) cls._cache[key] = tz return tz print(FixedOffsetTimezone()) ``` From issues-reply at bitbucket.org Sun Mar 5 11:53:33 2017 From: issues-reply at bitbucket.org (Daniil Yarancev) Date: Sun, 05 Mar 2017 16:53:33 -0000 Subject: [pypy-issue] Issue #2490: Random RPython assertion errors using PIP (pypy/pypy) Message-ID: <20170305165333.36744.2885@celery-worker-105.ash1.bb-inf.net> New issue 2490: Random RPython assertion errors using PIP https://bitbucket.org/pypy/pypy/issues/2490/random-rpython-assertion-errors-using-pip Daniil Yarancev: Script to reproduce: ``` #!python import pip import sys def test(): pip.main(['install', 'vmprof']) for x in range(int(sys.argv[1])): test() ``` Requires ~ 1000 iterations, and sometimes it's not crashing, sometimes crashing almost at the start. Errors can be different, there's some GDB stack traces: 1) https://paste.pound-python.org/show/b0QYrppVRAYHCgyFZuFV/ 2) https://paste.pound-python.org/show/S77PxZNjaE5t8Ir3sx7L/ From issues-reply at bitbucket.org Thu Mar 9 09:46:06 2017 From: issues-reply at bitbucket.org (CFSworks) Date: Thu, 09 Mar 2017 14:46:06 -0000 Subject: [pypy-issue] Issue #2491: cpyext-defined types with custom __qualname__ getset descriptors error on PyType_Ready (pypy/pypy) Message-ID: <20170309144606.34031.97366@celery-worker-107.ash1.bb-inf.net> New issue 2491: cpyext-defined types with custom __qualname__ getset descriptors error on PyType_Ready https://bitbucket.org/pypy/pypy/issues/2491/cpyext-defined-types-with-custom CFSworks: Certain CPython-API generating binding layers (the one I have in mind right now is Cython) may stick custom __qualname__ getset descriptors in their defined types. In CPython 3, this is allowed. The __qualname__-is-str check only occurs on type.__new__, so PyType_Ready'd custom types can bypass this check and include a custom descriptor if they'd like. In PyPy 3's cpyext, the C structs are flattened down to a dict and passed into the W_TypeObject constructor, which itself enforces the __qualname__ type check (which should, by the way, have a far more helpful error than "TypeError: expected string, got getset_descriptor object"). This should be resolved by not filtering __qualname__ out of dict_w when cpyext creates a type. From issues-reply at bitbucket.org Thu Mar 9 11:43:04 2017 From: issues-reply at bitbucket.org (Fabio Niephaus) Date: Thu, 09 Mar 2017 16:43:04 -0000 Subject: [pypy-issue] Issue #2492: _minimal_curses incompatible with rsdl (pypy/pypy) Message-ID: <20170309164304.35550.7474@celery-worker-106.ash1.bb-inf.net> New issue 2492: _minimal_curses incompatible with rsdl https://bitbucket.org/pypy/pypy/issues/2492/_minimal_curses-incompatible-with-rsdl Fabio Niephaus: `minimal_curses` [includes `term.h`](https://bitbucket.org/pypy/pypy/src/74eb11789df3e448b5f29b40d7e8b9bac176c631/pypy/module/_minimal_curses/fficurses.py) which defines a macro called `buttons`. rsdl ([on `sdl2` branch](https://bitbucket.org/pypy/rsdl/src/fb9abd552d07850ba831cbebebced073817b3398/rsdl/eci.py)) includes SDL.h which includes `SDL_messagebox.h`. Unfortunately, [`SDL_messagebox.h` contains `... *buttons`](https://hg.libsdl.org/SDL/file/a364af650bf1/include/SDL_messagebox.h#l100) and since all headers are globally included, the macro defined by `term.h` is incorrectly applied to `SDL_messagebox.h` which causes a syntax/compilation error. It'd be great if `term.h`'s includes could be isolated. From issues-reply at bitbucket.org Thu Mar 9 13:04:38 2017 From: issues-reply at bitbucket.org (rowillia) Date: Thu, 09 Mar 2017 18:04:38 -0000 Subject: [pypy-issue] Issue #2493: Unroll map(function, ${fixed width tuple}) (pypy/pypy) Message-ID: <20170309180438.11934.34158@celery-worker-101.ash1.bb-inf.net> New issue 2493: Unroll map(function, ${fixed width tuple}) https://bitbucket.org/pypy/pypy/issues/2493/unroll-map-function-fixed-width-tuple rowillia: I met Phil Jenvey last night at the SF Python meetup and he suggested I file an issue on this: We've been experimenting with PyPy, and we've got some math-heavy workloads that we've optimized with Cython, for example computing the haversine distance between two lat/lngs, below is a code snippet: ```python from math import sin, cos, asin, sqrt radians_per_degree = 0.0174532925 AVG_EARTH_RADIUS = 6371.0 MILES_PER_KM = 0.621371 def radians(theta): return radians_per_degree*theta def maybe_convert_to_miles(distance, miles): if miles: return MILES_PER_KM * distance else: return distance def _haversine(lat1, lng1, lat2, lng2): # convert all latitudes/longitudes from decimal degrees to radians lat1, lng1, lat2, lng2 = map(radians, (lat1, lng1, lat2, lng2)) # calculate haversine lat = lat2 - lat1 lng = lng2 - lng1 l1 = sin(lat * 0.5) l2 = sin(lng * 0.5) d = (l1 * l1) + cos(lat1) * cos(lat2) * (l2 * l2) return 2 * AVG_EARTH_RADIUS * asin(sqrt(d)) def haversine(point1, point2, miles=0): result = _haversine(point1[0], point1[1], point2[0], point2[1]) return maybe_convert_to_miles(result, miles) LYON = (45.7597, 4.8422) PARIS = (48.8567, 2.3508) MUNICH = (48.14287, 11.5770) ``` Last night I noted to Phil that the Cython version running in CPython was 2x faster than the pure python version running in PyPy. This was actually incorrect, the Cython version manually unrolled ` lat1, lng1, lat2, lng2 = map(radians, (lat1, lng1, lat2, lng2))` into ```python lat1 = radians(lat1) lng1 = radians(lng1) lat2 = radians(lat2) lng2 = radians(lng2) ``` Which resulted in a big win. Doing the same in PyPy resulted in the PyPy code only being 5% slower! It looks like there might be an opportunity for PyPy to unroll map calls in cases like this where we've got a fixed width tuple. Thanks for the amazing project! From issues-reply at bitbucket.org Thu Mar 9 16:20:28 2017 From: issues-reply at bitbucket.org (CFSworks) Date: Thu, 09 Mar 2017 21:20:28 -0000 Subject: [pypy-issue] Issue #2494: Regression: _hashlib "built-ins" are coerced to methods again (pypy/pypy) Message-ID: <20170309212028.18358.69393@celery-worker-105.ash1.bb-inf.net> New issue 2494: Regression: _hashlib "built-ins" are coerced to methods again https://bitbucket.org/pypy/pypy/issues/2494/regression-_hashlib-built-ins-are-coerced CFSworks: Commit d9e5c51789d1b7df1144c2e58264a2e97c45ac4b appears to have regressed issues #579 and #584. Because the returned "new_hash" function is now application-level, it's no longer "built-in" and classes are once again trying to turn it into a method. From issues-reply at bitbucket.org Fri Mar 10 06:57:24 2017 From: issues-reply at bitbucket.org (CFSworks) Date: Fri, 10 Mar 2017 11:57:24 -0000 Subject: [pypy-issue] Issue #2495: time.sleep() not interruptible on non-win32 (pypy/pypy) Message-ID: <20170310115724.31417.63872@celery-worker-105.ash1.bb-inf.net> New issue 2495: time.sleep() not interruptible on non-win32 https://bitbucket.org/pypy/pypy/issues/2495/timesleep-not-interruptible-on-non-win32 CFSworks: The current implementation of time.sleep() on non-win32 has [this](https://bitbucket.org/pypy/pypy/src/6f28fc42ee453285773b22e40cb0581e2a9878a9/pypy/module/time/interp_time.py?at=py3.5&fileviewer=file-view-default#interp_time.py-472) retry handler that attempts to repeat the select call if it exited short of the deadline. I haven't researched the legitimate purpose of the retry logic well enough to know if it should go away altogether, but it should not retry if the select() call was interrupted as a result of any (non-ignored) signal. On CPython 3.x, any non-ignored signal causes time.sleep() to return early. Note: I haven't checked win32 and I haven't checked the proper behavior with threaded applications, although the "as decreed by Guido, only the main thread can be interrupted." comment a little lower in the file suggests that time.sleep() should only retry if it's running in a separate thread. This behavior would make the most intuitive sense if the main thread is the only one that runs signal handlers, but I'm not knowledgeable enough on Python's signal handling to know for sure. From issues-reply at bitbucket.org Wed Mar 15 05:10:50 2017 From: issues-reply at bitbucket.org (Konstantin Lopuhin) Date: Wed, 15 Mar 2017 09:10:50 -0000 Subject: [pypy-issue] Issue #2496: Installing C-extensions with pypy3.5 on ubuntu (pypy/pypy) Message-ID: <20170315091050.28516.81666@celery-worker-107.ash1.bb-inf.net> New issue 2496: Installing C-extensions with pypy3.5 on ubuntu https://bitbucket.org/pypy/pypy/issues/2496/installing-c-extensions-with-pypy35-on Konstantin Lopuhin: I tried a couple of C extensions on the latest pypy3.5 nighly on Ubuntu 16.04, but they all fail with "Python.h: No such file or directory" error. I used this http://buildbot.pypy.org/nightly/py3.5/pypy-c-jit-90688-27474b4d14e4-linux64.tar.bz2 nightly build and then: ``` $ ./pypy-c-jit-90688-27474b4d14e4-linux64/bin/pypy3 -m venv ~/tmp/pypy3venv $ . ~/tmp/pypy3venv/bin/activate $ pip install pip -U $ pip install Pillow Collecting Pillow [431/449] Using cached Pillow-4.0.0.tar.gz Collecting olefile (from Pillow) Using cached olefile-0.44.zip Installing collected packages: olefile, Pillow Running setup.py install for olefile ... done Running setup.py install for Pillow ... error Complete output from command /home/kostia/tmp/pypy3venv/bin/pypy3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-t3y_01z1/Pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-niggd2sb-record/install-record.txt --sing le-version-externally-managed --compile --install-headers /home/kostia/tmp/pypy3venv/include/site/python3.5/Pillow: Single threaded build for pypy3 running install running build running build_py creating build creating build/lib.linux-x86_64-3.5 creating build/lib.linux-x86_64-3.5/PIL copying PIL/ImageChops.py -> build/lib.linux-x86_64-3.5/PIL ... skipped ... copying PIL/ImageWin.py -> build/lib.linux-x86_64-3.5/PIL running egg_info writing Pillow.egg-info/PKG-INFO writing dependency_links to Pillow.egg-info/dependency_links.txt writing requirements to Pillow.egg-info/requires.txt writing top-level names to Pillow.egg-info/top_level.txt warning: manifest_maker: standard file '-c' not found reading manifest file 'Pillow.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching '*.sh' no previously-included directories found matching 'docs/_static' warning: no previously-included files found matching '.coveragerc' warning: no previously-included files found matching '.editorconfig' warning: no previously-included files found matching '.landscape.yaml' warning: no previously-included files found matching 'appveyor.yml' warning: no previously-included files found matching 'build_children.sh' warning: no previously-included files found matching 'tox.ini' warning: no previously-included files matching '.git*' found anywhere in distribution warning: no previously-included files matching '*.pyc' found anywhere in distribution warning: no previously-included files matching '*.so' found anywhere in distribution writing manifest file 'Pillow.egg-info/SOURCES.txt' running build_ext building 'PIL._imaging' extension creating build/temp.linux-x86_64-3.5/libImaging gcc -pthread -DNDEBUG -O2 -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -I/usr/include/freetype2 -I/tmp/pip-build-t3y_01z1/Pillow/libImaging -I/home/kostia/tmp/pypy3venv/ include -I/usr/local/include -I/usr/include -I/home/kostia/tmp/pypy3venv/include -I/home/kostia/tmp/pypy3venv/include -I/usr/include/x86_64-linux-gnu -c _imaging.c -o build/tem p.linux-x86_64-3.5/_imaging.o _imaging.c:76:20: fatal error: Python.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1 ---------------------------------------- Command "/home/kostia/tmp/pypy3venv/bin/pypy3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-t3y_01z1/Pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__); code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-niggd2sb-record/install-record.txt --single-version-externally-ma naged --compile --install-headers /home/kostia/tmp/pypy3venv/include/site/python3.5/Pillow" failed with error code 1 in /tmp/pip-build-t3y_01z1/Pillow/ ``` ``pip install Pillow`` works for me on ``pypy2-v5.6.0``. From issues-reply at bitbucket.org Wed Mar 15 06:58:41 2017 From: issues-reply at bitbucket.org (Konstantin Lopuhin) Date: Wed, 15 Mar 2017 10:58:41 -0000 Subject: [pypy-issue] =?utf-8?q?Issue_=232497=3A_Installing_lxml_fails_on_?= =?utf-8?q?PyPy_3=2E5=3A_static_declaration_of_=E2=80=98PyBytes=5FFromForm?= =?utf-8?q?at=E2=80=99_follows_non-static_declaration_=28pypy/pypy=29?= Message-ID: <20170315105841.37187.67207@celery-worker-108.ash1.bb-inf.net> New issue 2497: Installing lxml fails on PyPy 3.5: static declaration of ?PyBytes_FromFormat? follows non-static declaration https://bitbucket.org/pypy/pypy/issues/2497/installing-lxml-fails-on-pypy-35-static Konstantin Lopuhin: Here is the error: ``` $ pip install lxml Collecting lxml Using cached lxml-3.7.3.tar.gz Building wheels for collected packages: lxml Running setup.py bdist_wheel for lxml ... error Complete output from command /home/kostia/tmp/pypy3/bin/pypy3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-giz7byil/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmps8n0ictjpip-wheel- --python-tag pp358: Building lxml version 3.7.3. Building without Cython. Using build configuration of libxslt 1.1.28 running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.5 creating build/lib.linux-x86_64-3.5/lxml copying src/lxml/cssselect.py -> build/lib.linux-x86_64-3.5/lxml ... copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-x86_64-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 running build_ext building 'lxml.etree' extension creating build/temp.linux-x86_64-3.5 creating build/temp.linux-x86_64-3.5/src creating build/temp.linux-x86_64-3.5/src/lxml gcc -pthread -DNDEBUG -O2 -fPIC -I/usr/include/libxml2 -Isrc/lxml/includes -I/home/kostia/tmp/pypy3/include -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-3.5/src/lxml/l xml.etree.o -w In file included from src/lxml/lxml.etree.c:515:0: src/lxml/includes/etree_defs.h:97:18: error: static declaration of ?PyBytes_FromFormat? follows non-static declaration static PyObject* PyBytes_FromFormat(const char* format, ...) { ^ In file included from /home/kostia/tmp/pypy3/include/Python.h:128:0, from src/lxml/lxml.etree.c:84: /home/kostia/tmp/pypy3/include/bytesobject.h:60:24: note: previous declaration of ?PyBytes_FromFormat? was here PyAPI_FUNC(PyObject *) PyBytes_FromFormat(const char*, ...); ^ Compile failed: command 'gcc' failed with exit status 1 creating tmp cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInit_o3zaqum.c -o tmp/xmlXPathInit_o3zaqum.o /tmp/xmlXPathInit_o3zaqum.c:2:1: warning: return type defaults to ?int? [-Wimplicit-int] main (int argc, char **argv) { ^ cc tmp/xmlXPathInit_o3zaqum.o -lxml2 -o a.out error: command 'gcc' failed with exit status 1 ---------------------------------------- Failed building wheel for lxml ``` This is Ubuntu 16.04, using latest pypy 3.5 nightly (http://buildbot.pypy.org/nightly/py3.5/pypy-c-jit-90688-27474b4d14e4-linux64.tar.bz2). Cython is installed, and ``import Cython.Compiler.Version`` works. From issues-reply at bitbucket.org Wed Mar 15 10:24:20 2017 From: issues-reply at bitbucket.org (Konstantin Lopuhin) Date: Wed, 15 Mar 2017 14:24:20 -0000 Subject: [pypy-issue] Issue #2498: Cython on PyPy 3: 'dict' object has no attribute 'iteritems' (pypy/pypy) Message-ID: <20170315142420.15290.37455@celery-worker-107.ash1.bb-inf.net> New issue 2498: Cython on PyPy 3: 'dict' object has no attribute 'iteritems' https://bitbucket.org/pypy/pypy/issues/2498/cython-on-pypy-3-dict-object-has-no Konstantin Lopuhin: I'm not sure if this a Cython or PyPy issue, but importing ``lxml.html`` fails with the following error: ``` >>>> import lxml.html Traceback (most recent call last): File "", line 1, in File "/home/kostia/tmp/pypy3/site-packages/lxml/html/__init__.py", line 89, in namespaces={'x':XHTML_NAMESPACE}) File "src/lxml/xpath.pxi", line 420, in lxml.etree.XPath.__init__ (src/lxml/lxml.etree.c:172552) File "src/lxml/xpath.pxi", line 150, in lxml.etree._XPathEvaluatorBase.set_context (src/lxml/lxml.etree.c:168951) File "src/lxml/xpath.pxi", line 66, in lxml.etree._XPathContext.set_context (src/lxml/lxml.etree.c:167729) File "src/lxml/extensions.pxi", line 255, in lxml.etree._BaseContext.registerLocalFunctions (src/lxml/lxml.etree.c:158962) AttributeError: 'dict' object has no attribute 'iteritems' ``` I'm using latest pypy 3.5 nightly (http://buildbot.pypy.org/nightly/py3.5/pypy-c-jit-90688-27474b4d14e4-linux64.tar.bz2) with a fix from #2497 that allows lxml installation. System is Ubuntu 16.04. Some other parts of lxml seem to work fine (e.g. lxml.etree). This is the line where is fails: https://github.com/lxml/lxml/blob/981a760856a15108e7143b1adbc2d07973c7cebb/src/lxml/extensions.pxi#L255 so this looks like ``.iteritems()`` does not work in Cython with PyPy 3.5? Unfortunately, I don't know how Cython and PyPy are integrated - maybe this is a Cython bug? From issues-reply at bitbucket.org Wed Mar 15 20:33:29 2017 From: issues-reply at bitbucket.org (Victor Stinner) Date: Thu, 16 Mar 2017 00:33:29 -0000 Subject: [pypy-issue] Issue #2499: cpyext: PyString_AsString() doesn't work (pypy/pypy) Message-ID: <20170316003329.21728.98765@celery-worker-107.ash1.bb-inf.net> New issue 2499: cpyext: PyString_AsString() doesn't work https://bitbucket.org/pypy/pypy/issues/2499/cpyext-pystring_asstring-doesnt-work Victor Stinner: The following fuction returns '\x01\x02' on CPytohn, but '\x00\x00' on PyPy. ``` static PyObject *py_apply_delta(PyObject *self, PyObject *args) { uint8_t *out; PyObject *ret; ret = PyString_FromStringAndSize(NULL, 2); if (ret == NULL) { PyErr_NoMemory(); return NULL; } out = (uint8_t *)PyString_AsString(ret); out[0] = 1; out[1] = 2; return ret; } ``` If you replace PyString_AsString() with PyString_AS_STRING(), it works as expected. It seems like PyString_AS_STRING() behaves differently. From issues-reply at bitbucket.org Thu Mar 16 23:56:39 2017 From: issues-reply at bitbucket.org (squeaky) Date: Fri, 17 Mar 2017 03:56:39 -0000 Subject: [pypy-issue] Issue #2500: [Pypy3] _ssl: NameError: name 'RAND_egd' is not defined (pypy/pypy) Message-ID: <20170317035639.21371.41893@celery-worker-107.ash1.bb-inf.net> New issue 2500: [Pypy3] _ssl: NameError: name 'RAND_egd' is not defined https://bitbucket.org/pypy/pypy/issues/2500/pypy3-_ssl-nameerror-name-rand_egd-is-not squeaky: Last time I translated about a month ago it used to work. March 17th on the 3.5 release brach tip I get: ``` Python 3.5.3 (74c8ff71e7aee0649d087acfc14072e7c29e9623, Mar 17 2017, 02:13:06) [PyPy 5.8.0-alpha0 with GCC 6.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``forward compatibility with optimizations that haven't been invented yet'' >>>> import _ssl Traceback (most recent call last): File "", line 1, in File "/root/portable-pypy/pypy3.5-5.8-alpha-20170317-linux_x86_64-portable/lib_pypy/_ssl/__init__.py", line 11, in RAND_egd = builtinify(RAND_egd) NameError: name 'RAND_egd' is not defined >>>> ``` PyPy is translated with OpenSSL 1.1: ``` ldd pypy3.5-5.8-alpha-20170317-linux_x86_64-portable/lib_pypy/_pypy_openssl.pypy3-58-x86_64-linux-gnu.so linux-vdso.so.1 => (0x00007ffd057dd000) libssl.so.1.1 => /root/portable-pypy/pypy3.5-5.8-alpha-20170317-linux_x86_64-portable/lib_pypy/../lib/libssl.so.1.1 (0x00007fe900fd8000) libcrypto.so.1.1 => /root/portable-pypy/pypy3.5-5.8-alpha-20170317-linux_x86_64-portable/lib_pypy/../lib/libcrypto.so.1.1 (0x00007fe900b4f000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe90092e000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe900565000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe900360000) /lib64/ld-linux-x86-64.so.2 (0x0000558cc9a57000) ``` From issues-reply at bitbucket.org Fri Mar 17 09:13:46 2017 From: issues-reply at bitbucket.org (KSHMK) Date: Fri, 17 Mar 2017 13:13:46 -0000 Subject: [pypy-issue] Issue #2501: [Pypy] Multiple Inheritance Bug: typeError: __init__() takes exactly 1 argument (2 given) (pypy/pypy) Message-ID: <20170317131346.19641.6084@celery-worker-107.ash1.bb-inf.net> New issue 2501: [Pypy] Multiple Inheritance Bug: typeError: __init__() takes exactly 1 argument (2 given) https://bitbucket.org/pypy/pypy/issues/2501/pypy-multiple-inheritance-bug-typeerror KSHMK: I found an error while installing and running to use pwntools. Pwntools inherits threading.local and stack implemented classes to implement a stack for each thread. However, when inheriting and executing __init__ "__init__() takes exactly 1 argument (2 given)". This error did not occur in Cpython. ``` #!python import threading class B(object): def __init__(self, K): self._current = K self.__stack = [] def push(self): print "push" class A(threading.local, B): pass K = A({"asdf":"asdf"}) K.push() print K._current ``` I have simplified the source of the error. If you change the order of inheritance ``` #!python import threading class B(object): def __init__(self, K): self._current = K self.__stack = [] def push(self): print "push" class A(B,threading.local): pass K = A({"asdf":"asdf"}) K.push() print K._current ``` No Error. Why? From issues-reply at bitbucket.org Fri Mar 17 22:32:28 2017 From: issues-reply at bitbucket.org (Shunning Jiang) Date: Sat, 18 Mar 2017 02:32:28 -0000 Subject: [pypy-issue] Issue #2502: Recipes for a loop with a lot of small functions (splitting long traces?) (pypy/pypy) Message-ID: <20170318023228.36682.38457@celery-worker-105.ash1.bb-inf.net> New issue 2502: Recipes for a loop with a lot of small functions (splitting long traces?) https://bitbucket.org/pypy/pypy/issues/2502/recipes-for-a-loop-with-a-lot-of-small Shunning Jiang: I'm dealing a big loop that is expected to execute for 10M-1B iterations. Inside the iteration I will have 500 functions. Inside each function there is not much work going on, basically 5-10 lines of calculations or for i in xrange(2) small loops. I wonder if there is a way to write code differently to avoid generating too long traces. ``` #!python for i in xrange(1000000000): func1() func2() func3() func4() func5() func6() func7() func8() ... func500() ``` The speedup of pypy over cpython is negligible. I looked at jit log and found that there are too many (~100) trace too long aborts. Is there anyway to still get high performance (or let the performance scale with the number of functions) in this case? Thanks! From issues-reply at bitbucket.org Fri Mar 17 23:56:36 2017 From: issues-reply at bitbucket.org (Denis Akhiyarov) Date: Sat, 18 Mar 2017 03:56:36 -0000 Subject: [pypy-issue] Issue #2503: provide pip in builds (pypy/pypy) Message-ID: <20170318035636.22525.64228@celery-worker-106.ash1.bb-inf.net> New issue 2503: provide pip in builds https://bitbucket.org/pypy/pypy/issues/2503/provide-pip-in-builds Denis Akhiyarov: cpython has built-in pip, so why not include pip in pypy as well? From issues-reply at bitbucket.org Sat Mar 18 02:08:41 2017 From: issues-reply at bitbucket.org (Denis Akhiyarov) Date: Sat, 18 Mar 2017 06:08:41 -0000 Subject: [pypy-issue] Issue #2504: pypy pythonnet call fails on PyPyClass_New (pypy/pypy) Message-ID: <20170318060841.31462.61510@celery-worker-101.ash1.bb-inf.net> New issue 2504: pypy pythonnet call fails on PyPyClass_New https://bitbucket.org/pypy/pypy/issues/2504/pypy-pythonnet-call-fails-on-pypyclass_new Denis Akhiyarov: Exception thrown at 0x1081C174 (libpypy-c.dll) in pypy.exe: 0xC0000005: Access violation reading location 0x00000004. ``` IntPtr s = Runtime.PyPyString_FromString("_temp"); IntPtr d = Runtime.PyPyDict_New(); IntPtr c = Runtime.PyPyClass_New(IntPtr.Zero, d, s); ``` Python 2.7.13 (3ecf4b9db0f5, Mar 16 2017, 21:26:47) [PyPy 5.8.0-alpha0 with MSC v.1500 32 bit] on win32 From issues-reply at bitbucket.org Sat Mar 18 04:28:01 2017 From: issues-reply at bitbucket.org (Denis Akhiyarov) Date: Sat, 18 Mar 2017 08:28:01 -0000 Subject: [pypy-issue] Issue #2505: PySys_SetArgvEx not exposed in cpyext, but is available in stubs.py (pypy/pypy) Message-ID: <20170318082801.19477.23463@celery-worker-108.ash1.bb-inf.net> New issue 2505: PySys_SetArgvEx not exposed in cpyext, but is available in stubs.py https://bitbucket.org/pypy/pypy/issues/2505/pysys_setargvex-not-exposed-in-cpyext-but Denis Akhiyarov: https://github.com/mozillazg/pypy/search?utf8=%E2%9C%93&q=PySys_SetArgvEx&type=Code https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/Include/sysmodule.h#L18 From issues-reply at bitbucket.org Sat Mar 18 20:08:58 2017 From: issues-reply at bitbucket.org (Donald Stufft) Date: Sun, 19 Mar 2017 00:08:58 -0000 Subject: [pypy-issue] Issue #2506: sysconfig returns incorrect paths (pypy/pypy) Message-ID: <20170319000858.39672.54200@celery-worker-101.ash1.bb-inf.net> New issue 2506: sysconfig returns incorrect paths https://bitbucket.org/pypy/pypy/issues/2506/sysconfig-returns-incorrect-paths Donald Stufft: The sysconfig module is supposed to be able to be used to locate a variety of Python path locations, however these APIs are returning the incorrect paths on pypy. Here's what this looks like on CPython 2.7: ``` $ python2 -c "import sysconfig,pprint; pprint.pprint(sysconfig.get_paths())" {'data': '/Users/dstufft/.pyenv/versions/2.7.13', 'include': '/Users/dstufft/.pyenv/versions/2.7.13/include/python2.7', 'platinclude': '/Users/dstufft/.pyenv/versions/2.7.13/include/python2.7', 'platlib': '/Users/dstufft/.pyenv/versions/2.7.13/lib/python2.7/site-packages', 'platstdlib': '/Users/dstufft/.pyenv/versions/2.7.13/lib/python2.7', 'purelib': '/Users/dstufft/.pyenv/versions/2.7.13/lib/python2.7/site-packages', 'scripts': '/Users/dstufft/.pyenv/versions/2.7.13/bin', 'stdlib': '/Users/dstufft/.pyenv/versions/2.7.13/lib/python2.7'} ``` and here is PyPy 5.6.0: ``` pypy -c "import sysconfig,pprint; pprint.pprint(sysconfig.get_paths())" {'data': '/Users/dstufft/.pyenv/versions/pypy-5.6.0', 'include': '/Users/dstufft/.pyenv/versions/pypy-5.6.0/include', 'platinclude': '/Users/dstufft/.pyenv/versions/pypy-5.6.0/include', 'platlib': '/Users/dstufft/.pyenv/versions/pypy-5.6.0/lib-pypy/2.7', 'platstdlib': '/Users/dstufft/.pyenv/versions/pypy-5.6.0/lib-pypy/2.7', 'purelib': '/Users/dstufft/.pyenv/versions/pypy-5.6.0/lib-pypy/2.7', 'scripts': '/Users/dstufft/.pyenv/versions/pypy-5.6.0/bin', 'stdlib': '/Users/dstufft/.pyenv/versions/pypy-5.6.0/lib-pypy/2.7'} ``` You can see that the platlib and purelib keys in PyPy are pointing to the PyPy standard library location, whereas in CPython they are pointing to the site-packages, which is the correct location. From issues-reply at bitbucket.org Tue Mar 21 06:31:21 2017 From: issues-reply at bitbucket.org (Serge G) Date: Tue, 21 Mar 2017 10:31:21 -0000 Subject: [pypy-issue] Issue #2507: Building pypy 5.7.0 from source failed (pypy/pypy) Message-ID: <20170321103121.29733.22646@celery-worker-105.ash1.bb-inf.net> New issue 2507: Building pypy 5.7.0 from source failed https://bitbucket.org/pypy/pypy/issues/2507/building-pypy-570-from-source-failed Serge G: Shortly after start building fails with error ``` #!python [translation:ERROR] ImportError: No module named pycparser ``` There is no issue with 5.6.0. Here is my full log: https://gist.github.com/senseysensor/51252f6c98b4436c7ded9d76f239b560 All [listed dependencies](http://pypy.readthedocs.io/en/latest/build.html#install-build-time-dependencies) I have installed. This is AWS instance (EMR cluster with linux AMI). From issues-reply at bitbucket.org Tue Mar 21 12:30:40 2017 From: issues-reply at bitbucket.org (Jason Myers) Date: Tue, 21 Mar 2017 16:30:40 -0000 Subject: [pypy-issue] Issue #2508: Dictionary pop (with default) fails with KeyError for some keys (pypy/pypy) Message-ID: <20170321163040.12347.59772@celery-worker-108.ash1.bb-inf.net> New issue 2508: Dictionary pop (with default) fails with KeyError for some keys https://bitbucket.org/pypy/pypy/issues/2508/dictionary-pop-with-default-fails-with Jason Myers: Latest release (5.7.0) OSX binary Seems to depend on the type of keys in the dictionary. ``` Python 2.7.13 (fa3249d55d15, Mar 19 2017, 19:48:32) [PyPy 5.7.0 with GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>> {}.pop(None, None) >>>> {1: 1}.pop(None, None) Traceback (most recent call last): File "", line 1, in KeyError: None >>>> {'a': 'a'}.pop(None, None) Traceback (most recent call last): File "", line 1, in KeyError: None >>>> {}.pop(1, None) >>>> {1: 1}.pop(1, None) 1 >>>> {'a': 'a'}.pop(1, None) Traceback (most recent call last): File "", line 1, in KeyError: 1 >>>> ``` Confirmed it does work on previous (5.6.0): ``` Python 2.7.12 (aff251e54385, Nov 09 2016, 17:25:49) [PyPy 5.6.0 with GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>> {}.pop(None, None) >>>> {1: 1}.pop(None, None) >>>> {'a': 'a'}.pop(None, None) >>>> {}.pop(1, None) >>>> {1: 1}.pop(1, None) 1 >>>> {'a': 'a'}.pop(1, None) >>>> ``` From issues-reply at bitbucket.org Tue Mar 21 13:03:29 2017 From: issues-reply at bitbucket.org (Philip Jenvey) Date: Tue, 21 Mar 2017 17:03:29 -0000 Subject: [pypy-issue] Issue #2509: Support Alpine Linux (pypy/pypy) Message-ID: <20170321170329.20576.33501@celery-worker-105.ash1.bb-inf.net> New issue 2509: Support Alpine Linux https://bitbucket.org/pypy/pypy/issues/2509/support-alpine-linux Philip Jenvey: Alpine linux has become a popular OS target for building smaller sized docker images. With Docker already providing an [Official Image](https://docs.docker.com/docker-hub/official_repos/) of PyPy, we should fix our Alpine Linux issues to facilitate an official pypy-alpine like cpython already has. It looks like at least some of the leg work has already been done: https://github.com/docker-library/pypy/issues/5#issuecomment-240354215 https://github.com/JayH5/alpine-pypy From issues-reply at bitbucket.org Wed Mar 22 04:40:04 2017 From: issues-reply at bitbucket.org (Jorge Ferrando) Date: Wed, 22 Mar 2017 08:40:04 -0000 Subject: [pypy-issue] =?utf-8?q?Issue_=232510=3A_Error_installing_fastcach?= =?utf-8?q?e=3A_=E2=80=98PyListObject_=7Baka_struct_=3Canonymous=3E=7D?= =?utf-8?b?4oCZIGhhcyBubyBtZW1iZXIgbmFtZWQg4oCYb2JfaXRlbeKAmSAocHlweS9w?= =?utf-8?q?ypy=29?= Message-ID: <20170322084004.37193.20448@celery-worker-107.ash1.bb-inf.net> New issue 2510: Error installing fastcache: ?PyListObject {aka struct }? has no member named ?ob_item? https://bitbucket.org/pypy/pypy/issues/2510/error-installing-fastcache-pylistobject Jorge Ferrando: Running latest pypy version on Ubuntu 16.04.2 LTS: ``` #!bash pypy --version Python 2.7.13 (fa3249d55d15, Mar 19 2017, 20:21:48) [PyPy 5.7.0 with GCC 6.2.0 20160901] ``` An trying to pip install fastcache, it fails with the errors below: ``` #!bash Collecting fastcache Using cached fastcache-1.0.2.tar.gz Installing collected packages: fastcache Running setup.py install for fastcache ... error Complete output from command /usr/local/bin/pypy -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-L928Ih/fastcache/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-KOIGzk-record/install-record.txt --single-version-externally-managed --compile: running install running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/fastcache copying fastcache/benchmark.py -> build/lib.linux-x86_64-2.7/fastcache copying fastcache/__init__.py -> build/lib.linux-x86_64-2.7/fastcache creating build/lib.linux-x86_64-2.7/fastcache/tests copying fastcache/tests/test_thread.py -> build/lib.linux-x86_64-2.7/fastcache/tests copying fastcache/tests/test_clrucache.py -> build/lib.linux-x86_64-2.7/fastcache/tests copying fastcache/tests/test_functools.py -> build/lib.linux-x86_64-2.7/fastcache/tests copying fastcache/tests/__init__.py -> build/lib.linux-x86_64-2.7/fastcache/tests running build_ext building 'fastcache._lrucache' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/src gcc -pthread -DNDEBUG -O2 -fPIC -I/opt/pypy2-v5.7.0-linux64/include -c src/_lrucache.c -o build/temp.linux-x86_64-2.7/src/_lrucache.o In file included from /opt/pypy2-v5.7.0-linux64/include/Python.h:81:0, from src/_lrucache.c:1: src/_lrucache.c: In function ?hashseq_traverse?: src/_lrucache.c:146:36: error: ?PyListObject {aka struct }? has no member named ?ob_item? Py_VISIT(((PyListObject *)self)->ob_item[i]); ^ /opt/pypy2-v5.7.0-linux64/include/object.h:287:21: note: in definition of macro ?Py_VISIT? if (op) { \ ^ src/_lrucache.c:146:36: error: ?PyListObject {aka struct }? has no member named ?ob_item? Py_VISIT(((PyListObject *)self)->ob_item[i]); ^ /opt/pypy2-v5.7.0-linux64/include/object.h:288:55: note: in definition of macro ?Py_VISIT? int vret = visit((PyObject *)(op), arg); \ ^ src/_lrucache.c: In function ?hashseq_clear?: src/_lrucache.c:157:24: error: ?PyListObject {aka struct }? has no member named ?ob_item? PyObject **item = a->ob_item; ^ src/_lrucache.c:163:10: error: ?PyListObject {aka struct }? has no member named ?ob_item? a->ob_item = NULL; ^ src/_lrucache.c:164:10: error: ?PyListObject {aka struct }? has no member named ?allocated? a->allocated = 0; ^ src/_lrucache.c: In function ?hashseq_dealloc?: src/_lrucache.c:188:9: error: ?PyListObject {aka struct }? has no member named ?ob_item? if (lo->ob_item != NULL){ ^ In file included from /opt/pypy2-v5.7.0-linux64/include/Python.h:81:0, from src/_lrucache.c:1: src/_lrucache.c:191:20: error: ?PyListObject {aka struct }? has no member named ?ob_item? Py_XDECREF(lo->ob_item[i]); ^ /opt/pypy2-v5.7.0-linux64/include/object.h:47:34: note: in definition of macro ?Py_XDECREF? #define Py_XDECREF(op) do { if ((op) == NULL) ; else Py_DECREF(op); } while (0) ^ src/_lrucache.c:191:20: error: ?PyListObject {aka struct }? has no member named ?ob_item? Py_XDECREF(lo->ob_item[i]); ^ /opt/pypy2-v5.7.0-linux64/include/object.h:40:29: note: in definition of macro ?Py_DECREF? if (--((PyObject *)(op))->ob_refcnt != 0) \ ^ src/_lrucache.c:191:7: note: in expansion of macro ?Py_XDECREF? Py_XDECREF(lo->ob_item[i]); ^ src/_lrucache.c:191:20: error: ?PyListObject {aka struct }? has no member named ?ob_item? Py_XDECREF(lo->ob_item[i]); ^ /opt/pypy2-v5.7.0-linux64/include/object.h:43:38: note: in definition of macro ?Py_DECREF? _Py_Dealloc((PyObject *)(op)); \ ^ src/_lrucache.c:191:7: note: in expansion of macro ?Py_XDECREF? Py_XDECREF(lo->ob_item[i]); ^ src/_lrucache.c:193:18: error: ?PyListObject {aka struct }? has no member named ?ob_item? PyMem_FREE(lo->ob_item); ^ src/_lrucache.c: In function ?hashseq_richcompare?: src/_lrucache.c:229:13: error: ?PyListObject {aka struct }? has no member named ?ob_item? if (vl->ob_item[i] != wl->ob_item[i]){ ^ src/_lrucache.c:229:31: error: ?PyListObject {aka struct }? has no member named ?ob_item? if (vl->ob_item[i] != wl->ob_item[i]){ ^ src/_lrucache.c:231:44: error: ?PyListObject {aka struct }? has no member named ?ob_item? int k = PyObject_RichCompareBool(vl->ob_item[i], ^ src/_lrucache.c:232:44: error: ?PyListObject {aka struct }? has no member named ?ob_item? wl->ob_item[i], Py_EQ); ^ src/_lrucache.c: In function ?cache_get_doc?: src/_lrucache.c:436:9: error: ?PyFunctionObject {aka struct }? has no member named ?func_doc? if (fn->func_doc == NULL) ^ In file included from /opt/pypy2-v5.7.0-linux64/include/Python.h:81:0, from src/_lrucache.c:1: src/_lrucache.c:439:16: error: ?PyFunctionObject {aka struct }? has no member named ?func_doc? INC_RETURN(fn->func_doc); ^ /opt/pypy2-v5.7.0-linux64/include/object.h:37:40: note: in definition of macro ?Py_INCREF? #define Py_INCREF(ob) (((PyObject *)(ob))->ob_refcnt++) ^ src/_lrucache.c:439:3: note: in expansion of macro ?INC_RETURN? INC_RETURN(fn->func_doc); ^ src/_lrucache.c:439:16: error: ?PyFunctionObject {aka struct }? has no member named ?func_doc? INC_RETURN(fn->func_doc); ^ src/_lrucache.c:122:47: note: in definition of macro ?INC_RETURN? #define INC_RETURN(op) return Py_INCREF(op), (op) ^ src/_lrucache.c: In function ?restricted?: src/_lrucache.c:448:10: warning: implicit declaration of function ?PyEval_GetRestricted? [-Wimplicit-function-declaration] if (!PyEval_GetRestricted()) ^ src/_lrucache.c: In function ?func_get_dict?: src/_lrucache.c:462:11: error: ?PyFunctionObject {aka struct }? has no member named ?func_dict? if (op->func_dict == NULL) { ^ src/_lrucache.c:463:11: error: ?PyFunctionObject {aka struct }? has no member named ?func_dict? op->func_dict = PyDict_New(); ^ src/_lrucache.c:464:15: error: ?PyFunctionObject {aka struct }? has no member named ?func_dict? if (op->func_dict == NULL) ^ In file included from /opt/pypy2-v5.7.0-linux64/include/Python.h:81:0, from src/_lrucache.c:1: src/_lrucache.c:467:17: error: ?PyFunctionObject {aka struct }? has no member named ?func_dict? Py_INCREF(op->func_dict); ^ /opt/pypy2-v5.7.0-linux64/include/object.h:37:40: note: in definition of macro ?Py_INCREF? #define Py_INCREF(ob) (((PyObject *)(ob))->ob_refcnt++) ^ src/_lrucache.c:468:14: error: ?PyFunctionObject {aka struct }? has no member named ?func_dict? return op->func_dict; ^ src/_lrucache.c: In function ?func_set_dict?: src/_lrucache.c:490:13: error: ?PyFunctionObject {aka struct }? has no member named ?func_dict? tmp = op->func_dict; ^ src/_lrucache.c:492:7: error: ?PyFunctionObject {aka struct }? has no member named ?func_dict? op->func_dict = value; ^ src/_lrucache.c: In function ?hashseq_arghash?: src/_lrucache.c:558:8: error: ?PyListObject {aka struct }? has no member named ?ob_item? p = v->ob_item; ^ src/_lrucache.c:560:9: warning: implicit declaration of function ?Py_EnterRecursiveCall? [-Wimplicit-function-declaration] if (Py_EnterRecursiveCall(" in computing hash")){ ^ src/_lrucache.c:565:5: warning: implicit declaration of function ?Py_LeaveRecursiveCall? [-Wimplicit-function-declaration] Py_LeaveRecursiveCall(); ^ src/_lrucache.c: In function ?make_key?: src/_lrucache.c:630:5: error: ?PyListObject {aka struct }? has no member named ?ob_item? lo->ob_item = (PyObject **) PyMem_MALLOC(nbytes); ^ src/_lrucache.c:631:8: error: ?PyListObject {aka struct }? has no member named ?ob_item? if(lo->ob_item == NULL){ ^ src/_lrucache.c:635:12: error: ?PyListObject {aka struct }? has no member named ?ob_item? memset(lo->ob_item, 0, nbytes); ^ src/_lrucache.c:638:5: error: ?PyListObject {aka struct }? has no member named ?allocated? lo->allocated = size; ^ src/_lrucache.c: In function ?cache_call?: src/_lrucache.c:849:41: error: ?PyDictObject {aka struct }? has no member named ?ma_used? if (((PyDictObject *)co->cache_dict)->ma_used == co->maxsize){ ^ src/_lrucache.c: In function ?cache_info?: src/_lrucache.c:969:66: error: ?PyDictObject {aka struct }? has no member named ?ma_used? ((PyDictObject *)co->cache_dict)->ma_used); ^ src/_lrucache.c:973:66: error: ?PyDictObject {aka struct }? has no member named ?ma_used? ((PyDictObject *)co->cache_dict)->ma_used); ^ error: command 'gcc' failed with exit status 1 ---------------------------------------- Command "/usr/local/bin/pypy -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-L928Ih/fastcache/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-KOIGzk-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-L928Ih/fastcache/ ``` From issues-reply at bitbucket.org Wed Mar 22 07:05:41 2017 From: issues-reply at bitbucket.org (David Moss) Date: Wed, 22 Mar 2017 11:05:41 -0000 Subject: [pypy-issue] Issue #2511: Refcheck error using latest pandas 0.9.12 with PyPy 5.7.0 (pypy/pypy) Message-ID: <20170322110541.29564.72894@celery-worker-107.ash1.bb-inf.net> New issue 2511: Refcheck error using latest pandas 0.9.12 with PyPy 5.7.0 https://bitbucket.org/pypy/pypy/issues/2511/refcheck-error-using-latest-pandas-0912 David Moss: A very simple and innocuous looking bit of pandas code is failing with the latest official release of PyPy running the latest version of pandas. **Version** ``` #! ? pypy --version Python 2.7.13 (fa3249d55d15, Mar 19 2017, 19:48:32) [PyPy 5.7.0 with GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] ? pypy -c 'import pandas; print(pandas.__version__)' 0.19.2 ``` **Minimal Test Case** ``` #!python import pandas as pd df = pd.DataFrame({'x': ['a', 'b', 'b']}) df['x'].unique() ``` It generate the following error. ``` #! Traceback (most recent call last): File "refcheck_error.py", line 3, in print(df['x'].unique()) File "/Users/dm/pypy-latest/site-packages/pandas/core/series.py", line 1241, in unique result = super(Series, self).unique() File "/Users/dm/pypy-latest/site-packages/pandas/core/base.py", line 973, in unique result = unique1d(values) File "/Users/dm/pypy-latest/site-packages/pandas/core/nanops.py", line 811, in unique1d uniques = table.unique(_ensure_object(values)) File "pandas/src/hashtable_class_helper.pxi", line 826, in pandas.hashtable.PyObjectHashTable.unique (pandas/hashtable.c:14521) ValueError: cannot resize an array with refcheck=True on PyPy. Use the resize function or refcheck=False ``` Runs quite happily under CPython on the same system. From issues-reply at bitbucket.org Thu Mar 23 11:38:35 2017 From: issues-reply at bitbucket.org (Pete Vine) Date: Thu, 23 Mar 2017 15:38:35 -0000 Subject: [pypy-issue] Issue #2512: pypy2 5.6/5.7 regression (pypy/pypy) Message-ID: <20170323153835.37374.55560@celery-worker-106.ash1.bb-inf.net> New issue 2512: pypy2 5.6/5.7 regression https://bitbucket.org/pypy/pypy/issues/2512/pypy2-56-57-regression Pete Vine: Can't translate pypy2 any more, targeting the slowpath backend: ``` [translation:info] Error: File "/home/guest/pypy2-v5.7.0-src/rpython/translator/goal/translate.py", line 318, in main drv.proceed(goals) File "/home/guest/pypy2-v5.7.0-src/rpython/translator/driver.py", line 551, in proceed result = self._execute(goals, task_skip = self._maybe_skip()) File "/home/guest/pypy2-v5.7.0-src/rpython/translator/tool/taskengine.py", line 114, in _execute res = self._do(goal, taskcallable, *args, **kwds) File "/home/guest/pypy2-v5.7.0-src/rpython/translator/driver.py", line 278, in _do res = func() File "/home/guest/pypy2-v5.7.0-src/rpython/translator/driver.py", line 361, in task_pyjitpl_lltype backend_name=self.config.translation.jit_backend, inline=True) File "/home/guest/pypy2-v5.7.0-src/rpython/jit/metainterp/warmspot.py", line 72, in apply_jit warmrunnerdesc.finish() File "/home/guest/pypy2-v5.7.0-src/rpython/jit/metainterp/warmspot.py", line 288, in finish self.annhelper.finish() File "/home/guest/pypy2-v5.7.0-src/rpython/rtyper/annlowlevel.py", line 218, in finish self.finish_annotate() File "/home/guest/pypy2-v5.7.0-src/rpython/rtyper/annlowlevel.py", line 238, in finish_annotate ann.complete_helpers() File "/home/guest/pypy2-v5.7.0-src/rpython/annotator/annrpython.py", line 116, in complete_helpers self.complete() File "/home/guest/pypy2-v5.7.0-src/rpython/annotator/annrpython.py", line 229, in complete raise annmodel.AnnotatorError(text) [translation:ERROR] AnnotatorError: Blocked block -- operation cannot succeed v3484 = getattr(self_291, ('element_ones')) In : Happened at file /home/guest/pypy2-v5.7.0-src/rpython/jit/backend/x86/vector_ext.py line 345 ==> self.mc.MOVAPD(maskloc, heap(self.element_ones[get_scale(size)])) self.mc.PXOR(resloc, resloc) # note that resloc contains true false for each element by the last compare operation self.mc.PBLENDVB_xx(resloc.value, maskloc.value) Known variable annotations: self_291 = SomeInstance(can_be_None=False, classdef=rpython.jit.backend.x86.assembler.Assembler386) ``` In other words, pypy2 `5.6` or `5.7` can't be translated with `--jit-backend=x86-without-sse2` any longer. From issues-reply at bitbucket.org Thu Mar 23 11:56:30 2017 From: issues-reply at bitbucket.org (=?utf-8?b?QWx0YW4gw5Z6bMO8?=) Date: Thu, 23 Mar 2017 15:56:30 -0000 Subject: [pypy-issue] Issue #2513: nogil-unsafe-2 has gil ? (pypy/pypy) Message-ID: <20170323155630.18879.83029@celery-worker-105.ash1.bb-inf.net> New issue 2513: nogil-unsafe-2 has gil ? https://bitbucket.org/pypy/pypy/issues/2513/nogil-unsafe-2-has-gil Altan ?zl?: Hi! i want to work around gil-less pypy and i did compile nogil-unsafe-2 branch ``` #!python import threading,time def x(): b=0 for a in range(20000000):b+=a*a class myThread (threading.Thread): def __init__(self): threading.Thread.__init__(self) def run(self): x() t=time.time() trs=[] for c in range(4): m=myThread() m.start() trs.append(m) for tr in trs:tr.join() print "4 thread",time.time()-t t=time.time() for c in range(4): x() print "1 thread", time.time()-t ``` * 4 thread 1.40300607681 * 1 thread 1.34966206551 why it doesn't work ? From issues-reply at bitbucket.org Thu Mar 23 12:11:33 2017 From: issues-reply at bitbucket.org (Vilhjalmur Thorsteinsson) Date: Thu, 23 Mar 2017 16:11:33 -0000 Subject: [pypy-issue] Issue #2514: Python REPL throws exception on fresh install of PyPy3 5.7 (pypy/pypy) Message-ID: <20170323161133.16284.45816@celery-worker-105.ash1.bb-inf.net> New issue 2514: Python REPL throws exception on fresh install of PyPy3 5.7 https://bitbucket.org/pypy/pypy/issues/2514/python-repl-throws-exception-on-fresh Vilhjalmur Thorsteinsson: After fresh install of PyPy3 5.7, going to the Python REPL and typing a simple expression, then pressing the Home and End keys a couple of times, leads to an exception: ``` #!bash (p35) villi at 46:~/github/Reynir$ python Python 3.5.3 (b16a4363e930, Mar 20 2017, 16:13:46) [PyPy 5.7.0-beta0 with GCC 6.2.0 20160901] on linux Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``PyPy 2.0.1 released'' >>>> 2+2 4 >>>> Traceback (most recent call last): File "/home/villi/pypy35/lib_pypy/_pypy_interact.py", line 45, in interactive_console run_interactive(mainmodule) File "/home/villi/pypy35/lib_pypy/pyrepl/simple_interact.py", line 73, in run_multiline_interactive_console returns_unicode=True) File "/home/villi/pypy35/lib_pypy/pyrepl/readline.py", line 275, in multiline_input return reader.readline(returns_unicode=returns_unicode) File "/home/villi/pypy35/lib_pypy/pyrepl/reader.py", line 616, in readline self.handle1() File "/home/villi/pypy35/lib_pypy/pyrepl/reader.py", line 599, in handle1 self.do_cmd(cmd) File "/home/villi/pypy35/lib_pypy/pyrepl/reader.py", line 546, in do_cmd cmd.do() File "/home/villi/pypy35/lib_pypy/pyrepl/commands.py", line 373, in do r.insert((self.event + r.console.getpending().data) * r.get_arg()) TypeError: unsupported operand type(s) for +: 'bytes' and 'str' (p35) villi at 46:~/github/Reynir$ ``` This is plain Debian8, accessed via MobaTek MobaXTerm. CPython 3.6 REPL Home/End keys work fine on same server through same terminal. From issues-reply at bitbucket.org Thu Mar 23 15:02:32 2017 From: issues-reply at bitbucket.org (psuben) Date: Thu, 23 Mar 2017 19:02:32 -0000 Subject: [pypy-issue] Issue #2515: PyPy2 5.7 - PyExc_SystemError undefined symbol at runtime (pypy/pypy) Message-ID: <20170323190232.22619.84189@celery-worker-101.ash1.bb-inf.net> New issue 2515: PyPy2 5.7 - PyExc_SystemError undefined symbol at runtime https://bitbucket.org/pypy/pypy/issues/2515/pypy2-57-pyexc_systemerror-undefined psuben: Just upgraded from PyPy2 5.6 to 5.7. I am able to successfully build a wheel for this package and install it. However at runtime, I get that PyExc_SystemError is undefined. I was able to successfully build/install/import on PyPy2 5.6 and couldn't find anything about pypy removing PyExc_SystemError in 5.7. See steps below: ``` #!bash (virtualenv_run_pypy)root at 30cf015501ef:/code# pip wheel --index-url https://pypi.yelpcorp.com/pypi/ pygear==0.9.2 Collecting pygear==0.9.2 Using cached https://pypi.yelpcorp.com/api/package/pygear/pygear-0.9.2.tar.gz Building wheels for collected packages: pygear Running setup.py bdist_wheel for pygear ... done Stored in directory: /code Successfully built pygear (virtualenv_run_pypy)root at 30cf015501ef:/code# pip install pygear-0.9.2-pp257-pypy_41-linux_x86_64.whl Processing ./pygear-0.9.2-pp257-pypy_41-linux_x86_64.whl Installing collected packages: pygear Successfully installed pygear-0.9.2 (virtualenv_run_pypy)root at 30cf015501ef:/code# python Python 2.7.13 (fa3249d55d15b9829e1be69cdf45b5a44cec902d, Mar 21 2017, 18:46:42) [PyPy 5.7.0 with GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>> import pygear Traceback (most recent call last): File "", line 1, in ImportError: unable to load extension module '/code/virtualenv_run_pypy/site-packages/pygear.pypy-41.so': /code/virtualenv_run_pypy/site-packages/pygear.pypy-41.so: undefined symbol: PyExc_SystemError ``` From issues-reply at bitbucket.org Fri Mar 24 07:30:08 2017 From: issues-reply at bitbucket.org (Victor Stinner) Date: Fri, 24 Mar 2017 11:30:08 -0000 Subject: [pypy-issue] Issue #2516: Bad performance on requests.get().iter_content() iterator (pypy/pypy) Message-ID: <20170324113008.2910.57832@celery-worker-106.ash1.bb-inf.net> New issue 2516: Bad performance on requests.get().iter_content() iterator https://bitbucket.org/pypy/pypy/issues/2516/bad-performance-on-requestsget Victor Stinner: The following script is ~10x slower on PyPy 5.7 compared to CPython 3.5.2: ``` import requests from contextlib import closing def test(): with closing(requests.get('http://speedtest.tele2.net/10GB.zip', stream=True)) as request: for chunk in request.iter_content(1048576): yield chunk for _ in test(): pass ``` From issues-reply at bitbucket.org Fri Mar 24 08:07:10 2017 From: issues-reply at bitbucket.org (lesshaste) Date: Fri, 24 Mar 2017 12:07:10 -0000 Subject: [pypy-issue] Issue #2517: Example scientific numpy code 6x slower in pypy (pypy/pypy) Message-ID: <20170324120710.5292.74810@celery-worker-105.ash1.bb-inf.net> New issue 2517: Example scientific numpy code 6x slower in pypy https://bitbucket.org/pypy/pypy/issues/2517/example-scientific-numpy-code-6x-slower-in lesshaste: The attached numpy code computes the permanent of a matrix and is about 6 times slower in pypy 5.7 than cpython. This is a problem in real scientific code so we have resorted to using cython currently. time python test.py -3.11279519223e-07 real 0m5.085s user 0m5.180s sys 0m0.304s time bin/pypy test.py -3.11279519223e-07 real 0m33.465s user 0m33.412s sys 0m0.036s From issues-reply at bitbucket.org Fri Mar 24 10:48:50 2017 From: issues-reply at bitbucket.org (peterjc) Date: Fri, 24 Mar 2017 14:48:50 -0000 Subject: [pypy-issue] Issue #2518: pypy3 hashing numpy float types inconsistent / unhashable (pypy/pypy) Message-ID: <20170324144850.35359.77873@celery-worker-108.ash1.bb-inf.net> New issue 2518: pypy3 hashing numpy float types inconsistent / unhashable https://bitbucket.org/pypy/pypy/issues/2518/pypy3-hashing-numpy-float-types peterjc: Desired behaviour, using Python 3.5.0 in 64-bit Linux: ```bash $ python3 Python 3.5.0 (default, Sep 28 2015, 11:25:31) [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import numpy >>> print(numpy.__version__) 1.12.1 >>> f = 123.456 >>> for t in [np.float, np.float16, np.float32, np.float64, np.float128]: ... new = t(f) ... print(hash(new), hash(new)==hash(f), t.__name__) ... 1051464412201451643 True float 1008806316530991227 False float16 1051467367688700027 False float32 1051464412201451643 True float64 1051464412201451643 True float128 >>> quit() >>> quit() ``` i.e. We expect all the floats to be hashable, and some types should have hash the same as Python's float. Observed behaviour using PyPy3.5 v5.7 beta from https://bitbucket.org/squeaky/portable-pypy/downloads/pypy3.5-5.7-beta-linux_x86_64-portable.tar.bz2 ```bash $ ~/Downloads/pypy3.5-5.7-beta-linux_x86_64-portable/bin/pypy Python 3.5.3 (b16a4363e930f6401bceb499b9520955504c6cb0, Mar 21 2017, 12:36:24) [PyPy 5.7.0-beta0 with GCC 6.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``the world doesn't want us to know'' >>>> import numpy as np >>>> print(np.__version__) 1.12.1 >>>> f = 123.456 >>>> for t in [np.float, np.float16, np.float32, np.float64, np.float128]: .... new = t(f) .... print(t, hash(new), hash(new)==hash(f)) .... 1051464412201451643 True 1008806316530991227 False 1051467367688700027 False Traceback (most recent call last): File "", line 3, in TypeError: 'numpy.float64' objects are unhashable >>>> >>>> >>>> for t in [np.float, np.float16, np.float16, np.float32, np.float64, np.float128]: .... new = t(f) .... print(hash(new), hash(new)==hash(f), t.__name__) .... 1051464412201451643 True float 1008806316530991227 False float16 1008806316530991227 False float16 1051467367688700027 False float32 Traceback (most recent call last): File "", line 3, in TypeError: 'numpy.float64' objects are unhashable >>>> quit() ``` In both cases NumPy 1.12.1 was installed with pip. Problem one: hash from ``numpy.float32`` is inconsistent (expected to match Python's float). Problem two: ``numpy.float64`` is unhashable. From issues-reply at bitbucket.org Fri Mar 24 11:01:36 2017 From: issues-reply at bitbucket.org (peterjc) Date: Fri, 24 Mar 2017 15:01:36 -0000 Subject: [pypy-issue] Issue #2519: Unbalanced LaTeX style quotes in PyPy3 welcome message (pypy/pypy) Message-ID: <20170324150136.510.38362@celery-worker-106.ash1.bb-inf.net> New issue 2519: Unbalanced LaTeX style quotes in PyPy3 welcome message https://bitbucket.org/pypy/pypy/issues/2519/unbalanced-latex-style-quotes-in-pypy3 peterjc: PyPy2 does not show a welcome message starting "And now for something completely different", e.g. ```bash $ ~/Downloads/pypy-5.7-linux_x86_64-portable/bin/pypy Python 2.7.13 (fa3249d55d15b9829e1be69cdf45b5a44cec902d, Mar 21 2017, 14:51:03) [PyPy 5.7.0 with GCC 6.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>> quit() ``` However, PyPy3 shows a random quote wrapped in LaTeX style quote marks (double back tick for opening, double apostrophe for closing), e.g. ```bash $ ~/Downloads/pypy3.5-5.7-beta-linux_x86_64-portable/bin/pypy Python 3.5.3 (b16a4363e930f6401bceb499b9520955504c6cb0, Mar 21 2017, 12:36:24) [PyPy 5.7.0-beta0 with GCC 6.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``"Somewhere inside the large lumbering blob of PyPy there is an elegant core trying to get out." - cfbolz'' >>>> quit() ``` or: ```bash $ ~/Downloads/pypy3.5-5.7-beta-linux_x86_64-portable/bin/pypy Python 3.5.3 (b16a4363e930f6401bceb499b9520955504c6cb0, Mar 21 2017, 12:36:24) [PyPy 5.7.0-beta0 with GCC 6.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``happy new year'' >>>> quit() ``` This style is now archaic and likely to cause trouble in other settings after copy-and-pasting. In particular most markdown languages consider back-ticks to indicate a code literal - and many bug trackers (e.g. GitHub, BitBucket) use this for reporting issues. I propose that you simply remove the double-back-tick and the double-apostrophe. From issues-reply at bitbucket.org Fri Mar 24 12:47:10 2017 From: issues-reply at bitbucket.org (peterjc) Date: Fri, 24 Mar 2017 16:47:10 -0000 Subject: [pypy-issue] Issue #2520: Missing marshal.h for PyMarshal_WriteObjectToString PyMarshal_ReadObjectFromString (pypy/pypy) Message-ID: <20170324164710.38009.1989@celery-worker-101.ash1.bb-inf.net> New issue 2520: Missing marshal.h for PyMarshal_WriteObjectToString PyMarshal_ReadObjectFromString https://bitbucket.org/pypy/pypy/issues/2520/missing-marshalh-for peterjc: Biopython releases until now have not attempted to compile any C extension code under PyPy. During the early days of PyPy we deliberately excluding them: https://github.com/biopython/biopython/blob/biopython-168/setup.py#L416 However, in experiments with PyPy2 v5.6 and v5.7 compiling our C code mostly works, with the exception of: ```python Extension('Bio.trie', ['Bio/triemodule.c', 'Bio/trie.c'], include_dirs=["Bio"] ), ``` The following tests are from https://github.com/peterjc/biopython/commit/ce5eed17bffff7999d7c23ebcb01a0380f30c8fb which is/was a test branch with a modified ``setup.py`` to remove the PyPy skipping code. e.g. https://travis-ci.org/peterjc/biopython/builds/214701332 vs https://travis-ci.org/peterjc/biopython/builds/214709981 where PyPy2 v5.7 (and PyPy3.5 v5.7 beta) both fail to compile ``Bio.trie`` Run locally to show the full details: ``` $ rm -rf build && ~/Downloads/pypy-5.7-linux_x86_64-portable/bin/pypy setup.py build ... building 'Bio.trie' extension gcc -pthread -DNDEBUG -O2 -fPIC -IBio -I/home/pc40583/Downloads/pypy-5.7-linux_x86_64-portable/include -c Bio/triemodule.c -o build/temp.linux-x86_64-2.7/Bio/triemodule.o Bio/triemodule.c:2:21: error: marshal.h: No such file or directory Bio/triemodule.c: In function ?_write_value_to_handle?: Bio/triemodule.c:630: warning: assignment makes pointer from integer without a cast Bio/triemodule.c: In function ?_read_value_from_handle?: Bio/triemodule.c:735: warning: assignment makes pointer from integer without a cast error: command 'gcc' failed with exit status 1 ``` https://github.com/biopython/biopython/blob/biopython-168/Bio/triemodule.c starts: ```C #include #include #include "trie.h" ``` The C code references functions ``PyMarshal_WriteObjectToString`` and ``PyMarshal_ReadObjectFromString``, and constant ``Py_MARSHAL_VERSION``. It appears PyPy only supports the Python level marshal interface defined in ``pypy/lib_pypy/_marshal.py``, and not the C level API? The closest issue I could find on the PyPy tracker was #684. From issues-reply at bitbucket.org Sat Mar 25 12:54:22 2017 From: issues-reply at bitbucket.org (CTPaHHuK-HEbA) Date: Sat, 25 Mar 2017 16:54:22 -0000 Subject: [pypy-issue] Issue #2521: Pillow ImportError (pypy/pypy) Message-ID: <20170325165422.5683.28270@celery-worker-106.ash1.bb-inf.net> New issue 2521: Pillow ImportError https://bitbucket.org/pypy/pypy/issues/2521/pillow-importerror CTPaHHuK-HEbA: After update PyPy2.7 5.6.0 to 5.7.0 File "I:\get.py", line 17, in from PIL import Image, ImageGrab File "C:\Python27\pypy\site-packages\PIL\Image.py", line 67, in from PIL import _imaging as core ImportError: unable to load extension module 'C:\Python27\pypy\site-packages\PIL\_imaging.pypy-41.pyd': The specified procedure was not found From issues-reply at bitbucket.org Sat Mar 25 17:44:26 2017 From: issues-reply at bitbucket.org (mattip) Date: Sat, 25 Mar 2017 21:44:26 -0000 Subject: [pypy-issue] Issue #2522: regression in multiple inheritance (pypy/pypy) Message-ID: <20170325214426.24154.97039@celery-worker-105.ash1.bb-inf.net> New issue 2522: regression in multiple inheritance https://bitbucket.org/pypy/pypy/issues/2522/regression-in-multiple-inheritance mattip: On PyPy 5.7 a class that inherits from a c-api class and a app-level class initiates the app-level class tp_new to 0x1. Numpy will call the second ``tp_bases``'s ``tp_new``, which crashes. To reproduce, ``pip install numpy`` then run ``` #!python import numpy as np class A(object): pass class B(A, np.float64): pass class B0(np.float64, A): pass class C0(B0): pass x = B0(1.0) ``` Reported by Gelin Yan on pypy-dev, then distilled from ``numpy/core/tests/test_scalarinherit.py`` From issues-reply at bitbucket.org Mon Mar 27 21:07:31 2017 From: issues-reply at bitbucket.org (psuben) Date: Tue, 28 Mar 2017 01:07:31 -0000 Subject: [pypy-issue] Issue #2523: PyPy2 5.7 regression with pycrypto 2.6.1 (pypy/pypy) Message-ID: <20170328010731.32115.34646@celery-worker-107.ash1.bb-inf.net> New issue 2523: PyPy2 5.7 regression with pycrypto 2.6.1 https://bitbucket.org/pypy/pypy/issues/2523/pypy2-57-regression-with-pycrypto-261 psuben: I am building pycrypto 2.6.1 without gmp and mpir. I am able to successfully install and import pycrypto however there is a strange attribute error that occurred in the following situation: ``` #!python Python 2.7.13 (fa3249d55d15b9829e1be69cdf45b5a44cec902d, Mar 21 2017, 18:46:42) [PyPy 5.7.0 with GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>> from Crypto.Cipher import DES3 >>>> mytst = DES3.new('\x9a\xb8\x96\x84\xab\xde\xb2\xdc\xe5\x16F\xe6\xf6\xc7\xea\xd6^l\xb3f\x97\xa2\xeca') Traceback (most recent call last): File "", line 1, in File "/nail/home/psuben/pg/yelp-main/virtualenv_pypy/site-packages/Crypto/Cipher/DES3.py", line 114, in new return DES3Cipher(key, *args, **kwargs) File "/nail/home/psuben/pg/yelp-main/virtualenv_pypy/site-packages/Crypto/Cipher/DES3.py", line 76, in __init__ blockalgo.BlockAlgo.__init__(self, _DES3, key, *args, **kwargs) File "/nail/home/psuben/pg/yelp-main/virtualenv_pypy/site-packages/Crypto/Cipher/blockalgo.py", line 142, in __init__ self.IV = self._cipher.IV AttributeError: '_DES3' object has no attribute 'IV' ``` This does not occur in CPython2.7: ``` #!python Python 2.7.6 (default, Jun 28 2016, 17:53:28) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from Crypto.Cipher import DES3 >>> mytst = DES3.new('\x9a\xb8\x96\x84\xab\xde\xb2\xdc\xe5\x16F\xe6\xf6\xc7\xea\xd6^l\xb3f\x97\xa2\xeca') >>> mytst.IV '\x00\x00\x00\x00\x00\x00\x00\x00' ``` From issues-reply at bitbucket.org Wed Mar 29 09:28:16 2017 From: issues-reply at bitbucket.org (Eli Oxman) Date: Wed, 29 Mar 2017 13:28:16 -0000 Subject: [pypy-issue] Issue #2524: Regression: __import__ does not allow unicode strings in fromlist (pypy/pypy) Message-ID: <20170329132816.31047.98489@celery-worker-105.ash1.bb-inf.net> New issue 2524: Regression: __import__ does not allow unicode strings in fromlist https://bitbucket.org/pypy/pypy/issues/2524/regression-__import__-does-not-allow Eli Oxman: On regular Python 2.7 I see the following behavior: ``` >>> main_module = __import__('foo', fromlist=[u'bar']) Traceback (most recent call last): File "", line 1, in ImportError: No module named foo ``` On Pypy 5.6 I got the same behavior, but on Pypy 5.7 I get: ``` >>>> main_module = __import__('foo', fromlist=[u'bar']) Traceback (most recent call last): File "", line 1, in TypeError: 'fromlist' items must be str, not unicode ``` I believe it should be possible to import with unicode literals in the `fromlist`. In particular I stumbled upon this when using a 3rd party library that uses `from __future__ import unicode_literals`. From issues-reply at bitbucket.org Thu Mar 30 05:13:56 2017 From: issues-reply at bitbucket.org (=?utf-8?q?Andr=C3=A9__Cimander?=) Date: Thu, 30 Mar 2017 09:13:56 -0000 Subject: [pypy-issue] Issue #2525: Pypy 5.7: eventlet + psycopg2cffi + celery RuntimeError: Second simultaneous read (pypy/pypy) Message-ID: <20170330091356.12046.10422@celery-worker-106.ash1.bb-inf.net> New issue 2525: Pypy 5.7: eventlet + psycopg2cffi + celery RuntimeError: Second simultaneous read https://bitbucket.org/pypy/pypy/issues/2525/pypy-57-eventlet-psycopg2cffi-celery Andr? Cimander: Hey, first of all, thanks for working on this wonderful project! We are considering switching our worker infrastructure to PyPy, while doing initial work I stumbled over this socket problem. We are test-running a celery worker with 60 threads (since we are I/O bound by external apis). It's working fine with CPython + eventlet + psycopg2/psycopg2cffi. The database connection is made to a local pgbouncer instance(3500 concurrent connection limit, 60 connections to the DB with enough reserve pool connections) on a unix-domain socket, maybe that's a problem with PyPy? If it's indeed a bug and you need more information, we are eager to help. If it's a stupid mistake from our side: sorry for wasting your time. __OS:__ * Ubuntu 16.04 | Linux worker4 4.4.0-66-generic #87-Ubuntu SMP Fri Mar 3 15:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux * PyPy 5.7.0 with GCC 6.2.0 20160901 (we used the Linux x86-64 binary (64bit, tar.bz2 built on Ubuntu 12.04 - 14.04) download, maybe this is the culprit?) __Relevant Packages:__ * celery==3.1.25 * eventlet==0.20.1 * psycopg2cffi==2.7.5 * django==1.9.12 __Stacktrace:__ ``` RuntimeError: Second simultaneous read on fileno 5 detected. Unless you really know what you're doing, make sure that only one greenthread can read any particular socket. Consider using a pools.Pool. If you do know what you're doing and want to disable this error, call eventlet.debug.hub_prevent_multiple_readers(False) - MY THREAD=>; THAT THREAD=FdListener('read', 5, >, >) File "celery/app/trace.py", line 240, in trace_task R = retval = fun(*args, **kwargs) File "celery/app/trace.py", line 438, in __protected_call__ return self.run(*args, **kwargs) File "influencerdb/utils/tasks.py", line 16, in run self.action(*args, **kwargs) File "influencerdb_insights_instagram/tasks.py", line 44, in action channel = get_instance_or_false(InfluencerChannelInstagram, influencer_channel_id) File "globalcore/utils/model.py", line 170, in get_instance_or_false obj = qset.get(**{model_id_key: model_id_or_object}) File "django/db/models/query.py", line 381, in get num = len(clone) File "django/db/models/query.py", line 240, in __len__ self._fetch_all() File "django/db/models/query.py", line 1074, in _fetch_all self._result_cache = list(self.iterator()) File "django/db/models/query.py", line 52, in __iter__ results = compiler.execute_sql() File "django/db/models/sql/compiler.py", line 846, in execute_sql cursor = self.connection.cursor() File "django/db/backends/base/base.py", line 233, in cursor cursor = self.make_cursor(self._cursor()) File "django/db/backends/base/base.py", line 204, in _cursor self.ensure_connection() File "django/db/backends/base/base.py", line 199, in ensure_connection self.connect() File "django/db/backends/base/base.py", line 171, in connect self.connection = self.get_new_connection(conn_params) File "django/db/backends/postgresql/base.py", line 186, in get_new_connection self.isolation_level = connection.isolation_level File "psycopg2cffi/_impl/connection.py", line 43, in check_closed_ return func(self, *args, **kwargs) File "psycopg2cffi/_impl/connection.py", line 253, in isolation_level name = self._get_guc('default_transaction_isolation') File "psycopg2cffi/_impl/connection.py", line 217, in _get_guc pgres = self._execute_green(query) File "psycopg2cffi/_impl/connection.py", line 689, in _execute_green _green_callback(self) File "eventlet/support/psycopg2_patcher.py", line 50, in eventlet_wait_callback trampoline(conn.fileno(), read=True) File "eventlet/hubs/__init__.py", line 158, in trampoline listener = hub.add(hub.READ, fileno, current.switch, current.throw, mark_as_closed) File "eventlet/hubs/epolls.py", line 49, in add listener = BaseHub.add(self, evtype, fileno, cb, tb, mac) File "eventlet/hubs/hub.py", line 177, in add evtype, fileno, evtype, cb, bucket[fileno])) ``` From issues-reply at bitbucket.org Thu Mar 30 06:29:55 2017 From: issues-reply at bitbucket.org (Nurdok) Date: Thu, 30 Mar 2017 10:29:55 -0000 Subject: [pypy-issue] Issue #2526: Future statements are considered illegal if they are separated by a semicolon (pypy/pypy) Message-ID: <20170330102955.27947.76414@celery-worker-106.ash1.bb-inf.net> New issue 2526: Future statements are considered illegal if they are separated by a semicolon https://bitbucket.org/pypy/pypy/issues/2526/future-statements-are-considered-illegal Nurdok: According to the Python documentation: > A future statement must appear near the top of the module. And indeed, both `CPython` and PyPy emit an error when violating this rule: ``` #!python # foo.py import sys from __future__ import unicode_literals from __future__ import nested_scopes ``` ``` #!bash $ python foo.py File "foo.py", line 2 from __future__ import unicode_literals ^ SyntaxError: from __future__ imports must occur at the beginning of the file ``` ``` #!bash $ python foo.py $ pypy foo.py File "foo.py", line 2 SyntaxError: __future__ statements must appear at beginning of file ``` When you remove the `import sys` line, both `CPython` and `PyPy` accept the program. However, when you change `foo.py` to perform both statements in the same line: ``` #!python # foo.py from __future__ import unicode_literals; from __future__ import nested_scopes ``` `CPython` accepts the program, while `PyPy` does not: ``` #!bash $ pypy foo.py File "foo.py", line 1 SyntaxError: __future__ statements must appear at beginning of file ``` Tested on `CPython` 2.7.12 and: ``` #!bash $ pypy -V Python 2.7.13 (fa3249d55d15, Mar 20 2017, 03:48:52) [PyPy 5.7.0 with MSC v.1500 32 bit] ```