From issues-reply at bitbucket.org Sun Oct 1 20:30:30 2017 From: issues-reply at bitbucket.org (Oscar Smith) Date: Mon, 02 Oct 2017 00:30:30 +0000 (UTC) Subject: [pypy-issue] Issue #2671: Set lookup is slow(ish) (pypy/pypy) Message-ID: <20171002003029.23810.66048@celery-worker-105.ash1.bb-inf.net> New issue 2671: Set lookup is slow(ish) https://bitbucket.org/pypy/pypy/issues/2671/set-lookup-is-slow-ish Oscar Smith: For not tiny strings, lookup by string or list is much faster than for set. All are faster than CPython, but it is a performance gotcha, so if it were easy to fix, that would be great. Below is reproduction code ``` #!python t1=time() x="abcdef" for i in range(100000): for char in "abcdefghijklmnopqrstuvwxyz": if char not in x: pass t2=time() x={'a','b','c','d','e','f'} for i in range(100000): for char in "abcdefghijklmnopqrstuvwxyz": if char not in x: pass t3=time() print('String Time', t2-t1) print('Set Time', t3-t2) ``` ``` String Time 0.12956809997558594 Set Time 0.6732444763183594 ``` From issues-reply at bitbucket.org Wed Oct 4 02:09:13 2017 From: issues-reply at bitbucket.org (David Meyer) Date: Wed, 04 Oct 2017 06:09:13 +0000 (UTC) Subject: [pypy-issue] Issue #2672: str.encode segfault on 3.5 and 3.6 for unrecognized "errors" (pypy/pypy) Message-ID: <20171004060913.40867.9242@celery-worker-109.ash1.bb-inf.net> New issue 2672: str.encode segfault on 3.5 and 3.6 for unrecognized "errors" https://bitbucket.org/pypy/pypy/issues/2672/strencode-segfault-on-35-and-36-for David Meyer: >>>> ''.encode(errors='surrogateescape') Segmentation fault >>>> ''.encode(errors='other_invalid_or_unrecognized') Segmentation fault From issues-reply at bitbucket.org Fri Oct 6 09:11:38 2017 From: issues-reply at bitbucket.org (Omer Ben-Amram) Date: Fri, 06 Oct 2017 13:11:38 +0000 (UTC) Subject: [pypy-issue] Issue #2673: PyPy3 failure with pandas C-engine (pypy/pypy) Message-ID: <20171006131138.21755.68441@celery-worker-106.ash1.bb-inf.net> New issue 2673: PyPy3 failure with pandas C-engine https://bitbucket.org/pypy/pypy/issues/2673/pypy3-failure-with-pandas-c-engine Omer Ben-Amram: I have both pypy2 and pypy3 installed on my mac. I'm running into this error when trying to read from a csv ``` import sys print(sys.version) > 3.5.3 (d72f9800a42b, Oct 06 2017, 09:04:27) [PyPy 5.9.0-beta0 with GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] ``` ```python import pandas as pd df = pd.DataFrame({'a': 1, 'b': 2}, index=pd.RangeIndex(2)) df.to_csv('test.csv') pd.read_csv('./test.csv') ``` ``` ValueErrorTraceback (most recent call last) in () 4 df.to_csv('test.csv') 5 ----> 6 pd.read_csv('./test.csv') ~/pypy3-5.9-osx/site-packages/pandas/io/parsers.py in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, escapechar, comment, encoding, dialect, tupleize_cols, error_bad_lines, warn_bad_lines, skipfooter, skip_footer, doublequote, delim_whitespace, as_recarray, compact_ints, use_unsigned, low_memory, buffer_lines, memory_map, float_precision) 653 skip_blank_lines=skip_blank_lines) 654 --> 655 return _read(filepath_or_buffer, kwds) 656 657 parser_f.__name__ = name ~/pypy3-5.9-osx/site-packages/pandas/io/parsers.py in _read(filepath_or_buffer, kwds) 403 404 # Create the parser. --> 405 parser = TextFileReader(filepath_or_buffer, **kwds) 406 407 if chunksize or iterator: ~/pypy3-5.9-osx/site-packages/pandas/io/parsers.py in __init__(self, f, engine, **kwds) 762 self.options['has_index_names'] = kwds['has_index_names'] 763 --> 764 self._make_engine(self.engine) 765 766 def close(self): ~/pypy3-5.9-osx/site-packages/pandas/io/parsers.py in _make_engine(self, engine) 983 def _make_engine(self, engine='c'): 984 if engine == 'c': --> 985 self._engine = CParserWrapper(self.f, **self.options) 986 else: 987 if engine == 'python': ~/pypy3-5.9-osx/site-packages/pandas/io/parsers.py in __init__(self, src, **kwds) 1603 kwds['allow_leading_cols'] = self.index_col is not False 1604 -> 1605 self._reader = parsers.TextReader(src, **kwds) 1606 1607 # XXX ValueError: only single character unicode strings can be converted to Py_UCS4, got length 0 ``` It will work if I specify to use the "python" engine : `pd.read_csv('./test.csv', engine='python')` It also works with pypy2 5.9 with the C engine. Any idea on why this might be happening? I'm aware that `Py_UCS4` does not exist in python2, but I'm not sure what would cause that, maybe some incomparability with cpyext? Thanks! From issues-reply at bitbucket.org Fri Oct 6 10:24:57 2017 From: issues-reply at bitbucket.org (Jason Rhinelander) Date: Fri, 06 Oct 2017 14:24:57 +0000 (UTC) Subject: [pypy-issue] Issue #2674: cpyext: tp_new not called in some multiple inheritance situations (pypy/pypy) Message-ID: <20171006142457.10875.43100@celery-worker-109.ash1.bb-inf.net> New issue 2674: cpyext: tp_new not called in some multiple inheritance situations https://bitbucket.org/pypy/pypy/issues/2674/cpyext-tp_new-not-called-in-some-multiple Jason Rhinelander: I've been testing out the pypy2-5.9.0 release with [pybind11](https://github.com/pybind/pybind11) and run into a segfault with one of the multiple inheritance tests (which was fine under 5.8.0 and under CPython). Basically the test amounts to: ```Python class PyBase(object): pass class MI1b(PyBase, Base1): # Doesn't work def __init__(self): PyBase.__init__(self) Base1.__init__(self) class MI1c(Base1, PyBase): # Works def __init__(self): PyBase.__init__(self) Base1.__init__(self) ``` where `Base1` is a C extension class which inherits from a common C extension base class (`pybind11_object`, which itself inherits from `object`) with a `tp_new` that initializes extra data needed for pybind objects. That base class `tp_new`, however, never gets called in the `MI1b` case, and so the instance doesn't get initialized properly, leading to a segfault when trying to access the expected internal data. The `mro()` of the two classes are: ``` # Working class (MI1c) MRO: [, , , , ] # Non-working class (MI1b) MRO: [, , , , ] ``` where `pybind11_object` is the type with the custom `tp_new`. (Though I think that extra `pybind11_object` base class doesn't really matter to the issue: `tp_new` isn't called even if I set it directly on the `Base1` type object). I suspect that the fix for #2666 is involved here: I tried a few pypy nightlies, and the problem doesn't occur in the builds up to and including `pypy-c-jit-92494-8e1aad229f8e-linux64.tar.bz2`, but does starting with `pypy-c-jit-92504-5acb984186b5-linux64.tar.bz2`--which looks to coincide with the timing of the #2666 fix (3f4fc77711549cd63bfda14d7d1c125af8b33425). From issues-reply at bitbucket.org Sat Oct 7 11:00:56 2017 From: issues-reply at bitbucket.org (=?utf-8?b?QWx0YW4gw5Z6bMO8?=) Date: Sat, 07 Oct 2017 15:00:56 +0000 (UTC) Subject: [pypy-issue] Issue #2675: Functional Python (pypy/pypy) Message-ID: <20171007150055.17749.35350@celery-worker-105.ash1.bb-inf.net> New issue 2675: Functional Python https://bitbucket.org/pypy/pypy/issues/2675/functional-python Altan ?zl?: I?d like to work on unsafe pypy for erlang like python. Where should i start ? It takes so long to compile pypy. From issues-reply at bitbucket.org Sat Oct 7 16:22:13 2017 From: issues-reply at bitbucket.org (bmerry) Date: Sat, 07 Oct 2017 20:22:13 +0000 (UTC) Subject: [pypy-issue] Issue #2676: List of build dependencies for Ubuntu 16.04 has wrong package names (pypy/pypy) Message-ID: <20171007202213.27335.92952@celery-worker-109.ash1.bb-inf.net> New issue 2676: List of build dependencies for Ubuntu 16.04 has wrong package names https://bitbucket.org/pypy/pypy/issues/2676/list-of-build-dependencies-for-ubuntu-1604 bmerry: The page at http://doc.pypy.org/en/latest/build.html#install-build-time-dependencies has a list of packages to install for Ubuntu 12.04 to 16.04, which does not match the actual packages available on 16.04: - libz-dev should be zlib1g-dev - libncurses-dev should be libncurses5-dev - libncursesw-dev should be libncursesw5-dev In the first two cases apt-get automatically chooses the correct package, but in the final case it does not. From issues-reply at bitbucket.org Tue Oct 10 11:02:57 2017 From: issues-reply at bitbucket.org (Jacek Szpot) Date: Tue, 10 Oct 2017 15:02:57 +0000 (UTC) Subject: [pypy-issue] Issue #2677: PyBuffer_ToContiguous: undeclared identifier when building `dlib` (pypy/pypy) Message-ID: <20171010150257.25042.84986@celery-worker-105.ash1.bb-inf.net> New issue 2677: PyBuffer_ToContiguous: undeclared identifier when building `dlib` https://bitbucket.org/pypy/pypy/issues/2677/pybuffer_tocontiguous-undeclared Jacek Szpot: Hey guys! > **TL;DR:** `undeclared identifier 'PyBuffer_ToContiguous'` when trying to build `dlib` I bumped into this when trying to install `dlib` (`pip3 install dlib`): ``` In file included from /private/var/folders/xq/btzncyq941bfxkwd_xb_sjh80000gn/T/pip-build-rxh9qq8v/dlib/tools/python/src/matrix.cpp:4: In file included from /private/var/folders/xq/btzncyq941bfxkwd_xb_sjh80000gn/T/pip-build-rxh9qq8v/dlib/dlib/../dlib/python.h:9: /private/var/folders/xq/btzncyq941bfxkwd_xb_sjh80000gn/T/pip-build-rxh9qq8v/dlib/dlib/../dlib/python/numpy.h:109:17: error: use of undeclared identifier 'PyBuffer_ToContiguous' if (PyBuffer_ToContiguous(&contig_buf[0], &pybuf, pybuf.len, 'C')) ^ /private/var/folders/xq/btzncyq941bfxkwd_xb_sjh80000gn/T/pip-build-rxh9qq8v/dlib/dlib/../dlib/python/numpy_image.h:22:9: note: in instantiation of function template specialization 'get_numpy_ndarray_parts' requested here get_numpy_ndarray_parts(img, _data, _contig_buf, shape); ^ In file included from /private/var/folders/xq/btzncyq941bfxkwd_xb_sjh80000gn/T/pip-build-rxh9qq8v/dlib/tools/python/src/matrix.cpp:4: In file included from /private/var/folders/xq/btzncyq941bfxkwd_xb_sjh80000gn/T/pip-build-rxh9qq8v/dlib/dlib/../dlib/python.h:9: /private/var/folders/xq/btzncyq941bfxkwd_xb_sjh80000gn/T/pip-build-rxh9qq8v/dlib/dlib/../dlib/python/numpy.h:109:17: error: use of undeclared identifier 'PyBuffer_ToContiguous' if (PyBuffer_ToContiguous(&contig_buf[0], &pybuf, pybuf.len, 'C')) ^ /private/var/folders/xq/btzncyq941bfxkwd_xb_sjh80000gn/T/pip-build-rxh9qq8v/dlib/dlib/../dlib/python/numpy_image.h:76:9: note: in instantiation of function template specialization 'get_numpy_ndarray_parts' requested here get_numpy_ndarray_parts(img, _data, _contig_buf, shape); ^ 2 errors generated. make[2]: *** [CMakeFiles/dlib_.dir/src/matrix.cpp.o] Error 1 make[1]: *** [CMakeFiles/dlib_.dir/all] Error 2 make: *** [all] Error 2 error: cmake build failed! ``` More details: ``` Python 3.5.3 (d72f9800a42b46a8056951b1da2426d2c2d8d502, Oct 07 2017, 08:21:16) [PyPy 5.9.0-beta0 with GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin ``` The CPython interpreter has this symbol defined somewhere in `abstract.h` - I see that for my `pypy3` installation (and inside a virtualenv), the `include/abstract.h` is way shorter and only contains like two symbols. Is this simply something that's not yet implemented, or am I miss something? Let me know if you need more info. From issues-reply at bitbucket.org Wed Oct 11 07:16:44 2017 From: issues-reply at bitbucket.org (JINOPAEK) Date: Wed, 11 Oct 2017 11:16:44 +0000 (UTC) Subject: [pypy-issue] Issue #2678: Is code possible to run PyPy? (pypy/pypy) Message-ID: <20171011111643.10685.90988@celery-worker-108.ash1.bb-inf.net> New issue 2678: Is code possible to run PyPy? https://bitbucket.org/pypy/pypy/issues/2678/is-code-possible-to-run-pypy JINOPAEK: I want to social network analysis with python networkx but when I use python, it is very slow.. So I search many solution, I choose PyPy But I don't know PyPy deep... I can use ubuntu Code is ``` #!python import networkx as nx import time start_time = time.time() G = nx.Graph() # ??? ?? f= open('H:/??????/201310_Network_basic.txt','r') # ?? ?? #?? ?? f_1 = f.readlines() for lineF in f_1: i = lineF[:-1].split('|') categories = i[0] k = (i[0],i[1]) G.add_node(i[0]) # ?? ?? G.add_edge(*k) # ?? ?? pos = nx.shell_layout(G) #?? ?? nx.draw_networkx_labels(G,pos,font_size=10) # ?? ??? nx.draw_shell(G) # ??? ?? ?? #???? ?? #???? ?? x = G.number_of_edges() # ? ??? ??? y = len(G) #? ??? ? # ??????? PART o = nx.degree_centrality(G) o1 = [] o2 = [] for v in o.values(): o1.append(float(v)) e = float(sum(o1)/y) #??????? for w in o.values(): o2.append(float(pow(w-e,2))) j = float(sum(o2)/y) #??????? o = str(o)#??????? #????? PARRT p = nx.betweenness_centrality(G) p1 = [] p2= [] for s in p.values(): p1.append(s) l = float(sum(p1)/y) # ??????? for t in p.values(): p2.append(pow(t-l,2)) m = float(sum(p2)/y) # ??????? p = str(p) #??????? q = nx.degree(G) #???? n1=[] for r in q.values(): n1.append(r) n = sum(n1)#?? ???? ? n = str(n) e = str(e) j = str(j) l = str(l) m = str(m) q = str(q) x = str(x) y = str(y) g = open('C:/Users/UrbanLab-4/Desktop/201310??.txt','a+') print('???? '+': ' + y + '\n',file=g) print('\n'+'? ??? '+': ' + x + '\n',file=g) print('\n'+'?? ???? ? '+': ' + n + '\n',file=g) print('\n'+'???? '+': ' + q + '\n',file=g) print('\n'+'??????? '+': ' + o + '\n',file=g) print('\n'+'??????? ?? '+':' +e + '\n',file=g) print('\n'+'??????? ?? '+':' +j + '\n',file=g) print('\n'+'??????? '+':' +p + '\n',file=g) print('\n'+'??????? ?? '+':' +l + '\n',file=g) print('\n'+'??????? ??'+':' +m + '\n',file=g) g.close() f.close() end_time = time.time() print(end_time - start_time) ``` From issues-reply at bitbucket.org Thu Oct 12 13:50:55 2017 From: issues-reply at bitbucket.org (Ned Batchelder) Date: Thu, 12 Oct 2017 17:50:55 +0000 (UTC) Subject: [pypy-issue] Issue #2679: Random (and incorrect) ResourceWarnings in a large test suite (pypy/pypy) Message-ID: <20171012175055.32110.82386@celery-worker-108.ash1.bb-inf.net> New issue 2679: Random (and incorrect) ResourceWarnings in a large test suite https://bitbucket.org/pypy/pypy/issues/2679/random-and-incorrect-resourcewarnings-in-a Ned Batchelder: Running the coverage.py test suite under pypy3 gives ResourceWarnings about unclosed files, but they are different each time, and point to places that seemingly cannot be unclosed files. To reproduce (http://coverage.readthedocs.io/en/coverage-4.4.1/contributing.html#getting-the-code): 1. clone https://bitbucket.org/ned/coveragepy (there's github too if you prefer) 1. pip install -r requirements/dev.pip 1. tox -e pypy3 When I run it, I get output like https://gist.github.com/nedbat/b665b022e588357c78e18178dc542b9b The fd seems to always be 10 or 11? From issues-reply at bitbucket.org Thu Oct 12 18:31:51 2017 From: issues-reply at bitbucket.org (Eric Ma) Date: Thu, 12 Oct 2017 22:31:51 +0000 (UTC) Subject: [pypy-issue] Issue #2680: Slow speed going from numpy data structure to Python data structures (pypy/pypy) Message-ID: <20171012223151.11574.24370@celery-worker-105.ash1.bb-inf.net> New issue 2680: Slow speed going from numpy data structure to Python data structures https://bitbucket.org/pypy/pypy/issues/2680/slow-speed-going-from-numpy-data-structure Eric Ma: When comparing the use of PyPy to CPython, I saw that there was a big difference on the following task: ```python from numpy.random import binomial from time import time from collections import Counter start = time() coinflips = binomial(n=1, p=0.3, size=int(1E7)) end = time() print('Time for numpy coinflips: {} seconds'.format(end - start)) print(Counter(coinflips)) end = time() print('{} seconds'.format(end - start)) ``` I wrote a blog post comparing things, and can be found [here](https://ericmjl.github.io/blog/2017/10/11/pypy-impressive/) ([backup website](https://ericmjl.github.io/blog/2017/10/11/pypy-impressive/)). From issues-reply at bitbucket.org Fri Oct 13 11:13:40 2017 From: issues-reply at bitbucket.org (tkadm30) Date: Fri, 13 Oct 2017 15:13:40 +0000 (UTC) Subject: [pypy-issue] Issue #2681: TypeError: __weakref__ slot disallowed: we already got one (pypy/pypy) Message-ID: <20171013151340.26683.46873@celery-worker-107.ash1.bb-inf.net> New issue 2681: TypeError: __weakref__ slot disallowed: we already got one https://bitbucket.org/pypy/pypy/issues/2681/typeerror-__weakref__-slot-disallowed-we tkadm30: Traceback (most recent call last): File "/usr/local/pypy/pypy2-v5.9.0-linux32/lib-python/2.7/wsgiref/handlers.py", line 85, in run self.result = application(self.environ, self.start_response) File "/usr/local/pypy/pypy2-v5.9.0-linux32/lib-python/2.7/wsgiref/validate.py", line 176, in lint_app iterator = application(environ, start_response_wrapper) File "/home/erob/src/django-hotsauce-oauthclient/lib/wsgi_oauth2/middleware.py", line 292, in __call__ return self.application(environ, start_response) File "lib/notmm/controllers/wsgi.pyx", line 136, in notmm.controllers.wsgi.BaseController.__call__ TypeError: __weakref__ slot disallowed: we already got one From issues-reply at bitbucket.org Sat Oct 14 18:11:26 2017 From: issues-reply at bitbucket.org (desbma) Date: Sat, 14 Oct 2017 22:11:26 +0000 (UTC) Subject: [pypy-issue] Issue #2682: sqlite3.Cursor has lastrowid set to None for multiline INSERT queries (pypy/pypy) Message-ID: <20171014221126.20802.60786@celery-worker-110.ash1.bb-inf.net> New issue 2682: sqlite3.Cursor has lastrowid set to None for multiline INSERT queries https://bitbucket.org/pypy/pypy/issues/2682/sqlite3cursor-has-lastrowid-set-to-none desbma: The attached code fails (assert at line 15) on Pypy2 or Pypy3 5.9.0. It works well on CPython. It took me a lot of time to simplify the test case down to this. Surprisingly lastrowid is set to None only if the insert query is a multi line string... From issues-reply at bitbucket.org Tue Oct 17 10:16:06 2017 From: issues-reply at bitbucket.org (Antonio Cuni) Date: Tue, 17 Oct 2017 14:16:06 +0000 (UTC) Subject: [pypy-issue] Issue #2683: Infinite traceback with greenlets (pypy/pypy) Message-ID: <20171017141606.11261.55993@celery-worker-109.ash1.bb-inf.net> New issue 2683: Infinite traceback with greenlets https://bitbucket.org/pypy/pypy/issues/2683/infinite-traceback-with-greenlets Antonio Cuni: Consider the following minimal example: ``` import traceback import greenlet def run_in_b(): print 2 A.switch() print 4 def run_in_a(): print 1 B.switch() print 3 A = greenlet.getcurrent() B = greenlet.greenlet(run_in_b) run_in_a() traceback.print_stack(B.gr_frame, 10) ``` On CPython, it prints simply this: ``` $ python hangs.py 1 2 3 File "hangs.py", line 6, in run_in_b A.switch() ``` On PyPy, there seems to be an endless cycle of frames: ``` $ pypy hangs.py 1 2 3 File "/home/antocuni/pypy/default/lib_pypy/greenlet.py", line 190, in _greenlet_start res = greenlet.run(*args, **kwds) File "hangs.py", line 6, in run_in_b A.switch() File "/home/antocuni/pypy/default/lib_pypy/greenlet.py", line 53, in switch return self.__switch('switch', (args, kwds)) File "/home/antocuni/pypy/default/lib_pypy/greenlet.py", line 92, in __switch args, kwds = unbound_method(current, *baseargs, to=target) File "/home/antocuni/pypy/default/lib_pypy/greenlet.py", line 190, in _greenlet_start res = greenlet.run(*args, **kwds) File "hangs.py", line 6, in run_in_b A.switch() File "/home/antocuni/pypy/default/lib_pypy/greenlet.py", line 53, in switch return self.__switch('switch', (args, kwds)) File "/home/antocuni/pypy/default/lib_pypy/greenlet.py", line 92, in __switch args, kwds = unbound_method(current, *baseargs, to=target) File "/home/antocuni/pypy/default/lib_pypy/greenlet.py", line 190, in _greenlet_start res = greenlet.run(*args, **kwds) File "hangs.py", line 6, in run_in_b A.switch() ``` This is a minimal example which shows the issue; however, the bug causes issues also with eventlet, in which `get_hub().run` plays the role of `A` and an arbitrary `spawn()`ed function plays the role of `B`. Tested with pypy 5.9 and nightly. From issues-reply at bitbucket.org Fri Oct 20 14:51:38 2017 From: issues-reply at bitbucket.org (Jean-Baptiste Lamy) Date: Fri, 20 Oct 2017 18:51:38 +0000 (UTC) Subject: [pypy-issue] Issue #2684: xml.parsers.expat does not handle entities (pypy/pypy) Message-ID: <20171020185138.30095.32649@celery-worker-106.ash1.bb-inf.net> New issue 2684: xml.parsers.expat does not handle entities https://bitbucket.org/pypy/pypy/issues/2684/xmlparsersexpat-does-not-handle-entities Jean-Baptiste Lamy: The xml.parsers.expat does not handle entities in PyPy3, but it does with CPython. The attached file produces different results with PyPy3 5.9 and Python 3.6.2: Python3: http://www.w3.org/1999/02/22-rdf-syntax-ns#RDF {'http://www.w3.org/XML/1998/namespacebase': 'http://www.semanticweb.org/jiba/ontologies/2017/0/test'} PyPy3: rdf:RDF {'xmlns': 'http://www.semanticweb.org/jiba/ontologies/2017/0/test#', 'xml:base': 'http://www.semanticweb.org/jiba/ontologies/2017/0/test', 'xmlns:rdfs': 'http://www.w3.org/2000/01/rdf-schema#', 'xmlns:owl': 'http://www.w3.org/2002/07/owl#', 'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema#', 'xmlns:rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'} From issues-reply at bitbucket.org Sun Oct 22 01:09:07 2017 From: issues-reply at bitbucket.org (Michael Merickel) Date: Sun, 22 Oct 2017 05:09:07 +0000 (UTC) Subject: [pypy-issue] Issue #2685: regression with pyramid+zope.interface (pypy/pypy) Message-ID: <20171022050907.2063.59252@celery-worker-108.ash1.bb-inf.net> New issue 2685: regression with pyramid+zope.interface https://bitbucket.org/pypy/pypy/issues/2685/regression-with-pyramid-zopeinterface Michael Merickel: I apologize for opening an issue without much information. I have no idea what the issue is but there is a regression between PyPy versions that our test suite has detected. It appears to be introduced between 5.4.1 and 5.6.0. Issue fixing the build: https://github.com/Pylons/pyramid/pull/3183 Broken build with 5.7.1: https://travis-ci.org/Pylons/pyramid/builds/291021497 Fixed build with 5.4.1: https://travis-ci.org/Pylons/pyramid/builds/291028609 From issues-reply at bitbucket.org Thu Oct 26 10:37:14 2017 From: issues-reply at bitbucket.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Thu, 26 Oct 2017 14:37:14 +0000 (UTC) Subject: [pypy-issue] Issue #2686: pysha3 fails tests due to mutable methods (?) (pypy/pypy) Message-ID: <20171026143713.39286.81712@celery-worker-107.ash1.bb-inf.net> New issue 2686: pysha3 fails tests due to mutable methods (?) https://bitbucket.org/pypy/pypy/issues/2686/pysha3-fails-tests-due-to-mutable-methods Micha? G?rny: ``` $ pypy --version Python 2.7.13 (84a2f3e6a7f88f2fe698e473998755b3bd1a12e2, Oct 08 2017, 10:49:35) [PyPy 5.9.0 with GCC 5.4.0] ``` Originally reported as [tiran/pysha3#13](https://github.com/tiran/pysha3/issues/13). The upstream author claims the failures are due to incompatible behavior with CPython: > It looks like a bug in PyPy. You shouldn't be able to modify any members like methods or attributes. Happens both with JIT enabled and disabled. To reproduce: ``` $ git clone https://github.com/tiran/pysha3 $ cd pysha3 $ pypy --jit off setup.py test running test running build running build_py running build_ext test_basics (__main__.SHA3_224Tests) ... FAIL test_hashlib (__main__.SHA3_224Tests) ... ok test_hmac (__main__.SHA3_224Tests) ... ok test_vectors (__main__.SHA3_224Tests) ... ok test_vectors_unaligned (__main__.SHA3_224Tests) ... ok test_basics (__main__.SHA3_256Tests) ... FAIL test_hashlib (__main__.SHA3_256Tests) ... ok test_hmac (__main__.SHA3_256Tests) ... ok test_vectors (__main__.SHA3_256Tests) ... ok test_vectors_unaligned (__main__.SHA3_256Tests) ... ok test_basics (__main__.SHA3_384Tests) ... FAIL test_hashlib (__main__.SHA3_384Tests) ... ok test_hmac (__main__.SHA3_384Tests) ... ok test_vectors (__main__.SHA3_384Tests) ... ok test_vectors_unaligned (__main__.SHA3_384Tests) ... ok test_basics (__main__.SHA3_512Tests) ... FAIL test_hashlib (__main__.SHA3_512Tests) ... ok test_hmac (__main__.SHA3_512Tests) ... ok test_vectors (__main__.SHA3_512Tests) ... ok test_vectors_unaligned (__main__.SHA3_512Tests) ... ok test_basics (__main__.Shake_128Tests) ... FAIL test_hashlib (__main__.Shake_128Tests) ... ok test_hmac (__main__.Shake_128Tests) ... ok test_vectors (__main__.Shake_128Tests) ... ok test_vectors_unaligned (__main__.Shake_128Tests) ... ok test_basics (__main__.Shake_256Tests) ... FAIL test_hashlib (__main__.Shake_256Tests) ... ok test_hmac (__main__.Shake_256Tests) ... ok test_vectors (__main__.Shake_256Tests) ... ok test_vectors_unaligned (__main__.Shake_256Tests) ... ok test_basics (__main__.Keccak_224Tests) ... FAIL test_hashlib (__main__.Keccak_224Tests) ... ok test_hmac (__main__.Keccak_224Tests) ... ok test_vectors (__main__.Keccak_224Tests) ... ok test_vectors_unaligned (__main__.Keccak_224Tests) ... ok test_basics (__main__.Keccak_256Tests) ... FAIL test_hashlib (__main__.Keccak_256Tests) ... ok test_hmac (__main__.Keccak_256Tests) ... ok test_vectors (__main__.Keccak_256Tests) ... ok test_vectors_unaligned (__main__.Keccak_256Tests) ... ok test_basics (__main__.Keccak_384Tests) ... FAIL test_hashlib (__main__.Keccak_384Tests) ... ok test_hmac (__main__.Keccak_384Tests) ... ok test_vectors (__main__.Keccak_384Tests) ... ok test_vectors_unaligned (__main__.Keccak_384Tests) ... ok test_basics (__main__.Keccak_512Tests) ... FAIL test_hashlib (__main__.Keccak_512Tests) ... ok test_hmac (__main__.Keccak_512Tests) ... ok test_vectors (__main__.Keccak_512Tests) ... ok test_vectors_unaligned (__main__.Keccak_512Tests) ... ok ====================================================================== FAIL: test_basics (__main__.SHA3_224Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests.py", line 110, in test_basics self.assertRaises(AttributeError, setattr, sha3, "digest", 3) AssertionError: AttributeError not raised ====================================================================== FAIL: test_basics (__main__.SHA3_256Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests.py", line 110, in test_basics self.assertRaises(AttributeError, setattr, sha3, "digest", 3) AssertionError: AttributeError not raised ====================================================================== FAIL: test_basics (__main__.SHA3_384Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests.py", line 110, in test_basics self.assertRaises(AttributeError, setattr, sha3, "digest", 3) AssertionError: AttributeError not raised ====================================================================== FAIL: test_basics (__main__.SHA3_512Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests.py", line 110, in test_basics self.assertRaises(AttributeError, setattr, sha3, "digest", 3) AssertionError: AttributeError not raised ====================================================================== FAIL: test_basics (__main__.Shake_128Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests.py", line 110, in test_basics self.assertRaises(AttributeError, setattr, sha3, "digest", 3) AssertionError: AttributeError not raised ====================================================================== FAIL: test_basics (__main__.Shake_256Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests.py", line 110, in test_basics self.assertRaises(AttributeError, setattr, sha3, "digest", 3) AssertionError: AttributeError not raised ====================================================================== FAIL: test_basics (__main__.Keccak_224Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests.py", line 110, in test_basics self.assertRaises(AttributeError, setattr, sha3, "digest", 3) AssertionError: AttributeError not raised ====================================================================== FAIL: test_basics (__main__.Keccak_256Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests.py", line 110, in test_basics self.assertRaises(AttributeError, setattr, sha3, "digest", 3) AssertionError: AttributeError not raised ====================================================================== FAIL: test_basics (__main__.Keccak_384Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests.py", line 110, in test_basics self.assertRaises(AttributeError, setattr, sha3, "digest", 3) AssertionError: AttributeError not raised ====================================================================== FAIL: test_basics (__main__.Keccak_512Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests.py", line 110, in test_basics self.assertRaises(AttributeError, setattr, sha3, "digest", 3) AssertionError: AttributeError not raised ---------------------------------------------------------------------- Ran 50 tests in 2.794s FAILED (failures=10) Traceback (most recent call last): File "setup.py", line 123, in "Topic :: Security :: Cryptography", File "/usr/lib64/pypy/lib-python/2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/lib64/pypy/lib-python/2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib64/pypy/lib-python/2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "setup.py", line 64, in run errno = subprocess.check_call([sys.executable, "tests.py"], env=env) File "/usr/lib64/pypy/lib-python/2.7/subprocess.py", line 186, in check_call raise CalledProcessError(retcode, cmd) CalledProcessError: Command '['/usr/bin/pypy', 'tests.py']' returned non-zero exit status 1 ``` From issues-reply at bitbucket.org Thu Oct 26 10:46:31 2017 From: issues-reply at bitbucket.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Thu, 26 Oct 2017 14:46:31 +0000 (UTC) Subject: [pypy-issue] Issue #2687: PyPy3 is missing pystrhex.h, breaking pysha3 (pypy/pypy) Message-ID: <20171026144631.33637.7443@celery-worker-108.ash1.bb-inf.net> New issue 2687: PyPy3 is missing pystrhex.h, breaking pysha3 https://bitbucket.org/pypy/pypy/issues/2687/pypy3-is-missing-pystrhexh-breaking-pysha3 Micha? G?rny: ``` $ pypy3 --version Python 3.5.3 (d72f9800a42b46a8056951b1da2426d2c2d8d502, Oct 08 2017, 10:51:34) [PyPy 5.9.0-beta0 with GCC 5.4.0] ``` It seems that CPython 3.5 introduced a new `pystrhex.h` header that some modules such as pysha3 are relying on. As a result, pysha3 fails to build: ``` $ git clone https://github.com/tiran/pysha3 $ cd pysha3 $ pypy3 setup.py build running build running build_py running build_ext building '_pysha3' extension cc -pthread -fPIC -DPY_WITH_KECCAK=1 -I/usr/lib64/pypy3/include -c Modules/_sha3/sha3module.c -o build/temp.linux-x86_64-3.5/Modules/_sha3/sha3module.o In file included from Modules/_sha3/sha3module.c:20:0: Modules/_sha3/backport.inc:78:22: fatal error: pystrhex.h: No such file or directory compilation terminated. error: command 'cc' failed with exit status 1 ``` From issues-reply at bitbucket.org Thu Oct 26 10:51:40 2017 From: issues-reply at bitbucket.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Thu, 26 Oct 2017 14:51:40 +0000 (UTC) Subject: [pypy-issue] Issue #2688: PyPy3 is missing 'Py_hexdigits' for C extensions (Py3.3), breaking pyblake2 (pypy/pypy) Message-ID: <20171026145140.26604.23751@celery-worker-109.ash1.bb-inf.net> New issue 2688: PyPy3 is missing 'Py_hexdigits' for C extensions (Py3.3), breaking pyblake2 https://bitbucket.org/pypy/pypy/issues/2688/pypy3-is-missing-py_hexdigits-for-c Micha? G?rny: ``` $ pypy3 --version Python 3.5.3 (d72f9800a42b46a8056951b1da2426d2c2d8d502, Oct 08 2017, 10:51:34) [PyPy 5.9.0-beta0 with GCC 5.4.0] ``` pyblake2 is using `Py_hexdigits` in the C extension when the Python version >= 3.3. However, PyPy3 seems to be missing this and so the build fails: ``` $ git clone https://github.com/dchest/pyblake2 $ cd pyblake2 $ pypy3 setup.py build running build running build_ext building 'pyblake2' extension cc -pthread -fPIC -DBLAKE2_COMPRESS_SSE2=1 -I/usr/lib64/pypy3/include -c pyblake2module.c -o build/temp.linux-x86_64-3.5/pyblake2module.o pyblake2module.c: In function 'tohex': pyblake2module.c:124:20: error: 'Py_hexdigits' undeclared (first use in this function) # define hexdigits Py_hexdigits ^ pyblake2module.c:131:24: note: in expansion of macro 'hexdigits' dst[i*2 + 0] = hexdigits[(src[i] >> 4) & 0x0f]; ^ pyblake2module.c:124:20: note: each undeclared identifier is reported only once for each function it appears in # define hexdigits Py_hexdigits ^ pyblake2module.c:131:24: note: in expansion of macro 'hexdigits' dst[i*2 + 0] = hexdigits[(src[i] >> 4) & 0x0f]; ^ error: command 'cc' failed with exit status 1 ``` From issues-reply at bitbucket.org Sat Oct 28 05:17:53 2017 From: issues-reply at bitbucket.org (Ronan Lamy) Date: Sat, 28 Oct 2017 09:17:53 +0000 (UTC) Subject: [pypy-issue] Issue #2689: _thread.lock is not weakrefable (pypy/pypy) Message-ID: <20171028091753.4743.86944@celery-worker-110.ash1.bb-inf.net> New issue 2689: _thread.lock is not weakrefable https://bitbucket.org/pypy/pypy/issues/2689/_threadlock-is-not-weakrefable Ronan Lamy: PyPy: ``` Python 3.5.3 (61c11feab4e6, Oct 09 2017, 15:04:00) [PyPy 5.10.0-alpha0 with GCC 6.2.0 20160901] on linux Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``A pink glittery rotating lambda'' >>>> import weakref, _thread >>>> weakref.ref(_thread.allocate_lock()) Traceback (most recent call last): File "", line 1, in TypeError: cannot create weak reference to '_thread.lock' object ``` CPython: ``` Python 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import weakref, _thread >>> weakref.ref(_thread.allocate_lock()) ``` From issues-reply at bitbucket.org Sun Oct 29 14:17:04 2017 From: issues-reply at bitbucket.org (acoady) Date: Sun, 29 Oct 2017 18:17:04 +0000 (UTC) Subject: [pypy-issue] Issue #2690: Importing module when PyPy is kernel for Jupyter Notebook (pypy/pypy) Message-ID: <20171029181704.9570.56298@celery-worker-106.ash1.bb-inf.net> New issue 2690: Importing module when PyPy is kernel for Jupyter Notebook https://bitbucket.org/pypy/pypy/issues/2690/importing-module-when-pypy-is-kernel-for acoady: I encountered a problem when pypy is configured as a kernel for a Jupyter Notebook and I tried to import a module that contains calls the display() rountine in the IPython.display package. This problem does not occur when pypy3 is configured as the kernel for the Jupyter Notebook nor when Python2 or Python3 is configured as the kernel. It only occurs when pypy for Python2 is configured as the kernel. What happens is that when you execute the code to import a module that calls IPython.display.display() routine the kernel hangs and the import never completes. I have jupyter installed on an ubuntu linux machine using Anaconda with Python 3. I also installed pypy and pypy3 on the ubuntu linux machine and configured them as kernels for the Jupyter notebook. When I open a notebook I am able to switch between the 3 kernels, namely Python3 , PyPy and PyPy3. The problem I am having is that the following import statement fails when PyPy is configured as the kernel for the notebook. from test import * executing this line in a notebook cell fails when PyPy is the kernel for the notebook, but it works fine when the notebook is configured to have the PyPy3 kernel or the Python3 kernel. It also works fine when Python2 is the kernel. The contents of the test.py file is the following. import IPython from IPython.display import display a = 1 display(a) When I execute the cell containing from test import * when PyPY is the kernel the cell execution never completes and the * symbol remains displayed to the left of the cell indefinitely. If I put the contents of test.py in a notebook cell and execute the cell it works fine on pypy. It's only when I try to import test that the system hangs. To recreate the problem you need to install Jupyter, http://jupyter.org/install.html and also install pypy and pypy3. Next you need to configure pypy as a kernel for the jupyter notebook following these steps. Step 1: Download PyPy and install pypy on your machine https://pypy.org/download.html Step 2: Add the installed path to pypy on your machine to your PATH environment variable Step 3: Add pip to PyPy from the terminal window pypy -m ensurepip Step 4: pip install notebook and its dependencies to pypy pypy -m pip install notebook Step 5: Add pypy kernel to Jupyter Notebook pypy -m ipykernel install --user --name pypy --display-name "Python (PyPy)" If these steps were successful, then you should see the PyPy kernel as one of the available kernels in the Jupyter Notebook. From the terminal window run jupyter notebook which launches the jupyter notebook in a browser window. Then click the "file" button in the notebook and you should see "Python (PyPy)" as a kernel that you can use. Select PyPy to create a PyPy notebook. Then in the cell of the notebook type. import sys sys.version and execute the cell. It should indicate that it is using PyPy. To execute a cell with python code in a jupyter notebook you click on the cell and then use the key sequence (Shift+Enter) to execute the python code in the cell. With pypy as the kernel try executing the contents of the test.py code in a notebook cell. import IPython from IPython.display import display a = 1 display(a) Then execute this code in the cell (Shift+Enter) key sequence. Next try importing test.py in a notebook cell. from test import * and you will see that it hangs when pypy for Python 2 is the kernel. It works fine for all other kernels. To change the kernel in a Jupyter Notebook you can use the menu in an open notebook. (Kernel -> Change Kernel ) . You can also restart the kernel using the Kernel menu item in the open notebook. From issues-reply at bitbucket.org Sun Oct 29 18:43:36 2017 From: issues-reply at bitbucket.org (Shlomi Fish) Date: Sun, 29 Oct 2017 22:43:36 +0000 (UTC) Subject: [pypy-issue] Issue #2691: Deep recrsion program causes pypy2-5.9.1 to segfault (pypy/pypy) Message-ID: <20171029224336.2832.71866@celery-worker-107.ash1.bb-inf.net> New issue 2691: Deep recrsion program causes pypy2-5.9.1 to segfault https://bitbucket.org/pypy/pypy/issues/2691/deep-recrsion-program-causes-pypy2-591-to Shlomi Fish: The attached program segfaults on pypy2 5.9.1 linux x86-64 while running fine on cpython 2.7.x. It uses sys.setrecursionlimit(). Increasing the stack using "ulimit -s" does not help. From issues-reply at bitbucket.org Mon Oct 30 11:35:20 2017 From: issues-reply at bitbucket.org (Thomas Hisch) Date: Mon, 30 Oct 2017 15:35:20 +0000 (UTC) Subject: [pypy-issue] Issue #2692: Add missing crypto algorithms, introduced in cpython3.6 (pypy/pypy) Message-ID: <20171030153520.19615.53587@celery-worker-108.ash1.bb-inf.net> New issue 2692: Add missing crypto algorithms, introduced in cpython3.6 https://bitbucket.org/pypy/pypy/issues/2692/add-missing-crypto-algorithms-introduced Thomas Hisch: PyPy(3.6) does not yet contain an implementation for the crypto libraries, introduced in cpython3.6 (see https://bugs.python.org/issue16113) From issues-reply at bitbucket.org Mon Oct 30 21:03:34 2017 From: issues-reply at bitbucket.org (Justin Winokur) Date: Tue, 31 Oct 2017 01:03:34 +0000 (UTC) Subject: [pypy-issue] Issue #2693: os.stat and st_birthtime on macOS (HFS+) (pypy/pypy) Message-ID: <20171031010334.13583.57986@celery-worker-106.ash1.bb-inf.net> New issue 2693: os.stat and st_birthtime on macOS (HFS+) https://bitbucket.org/pypy/pypy/issues/2693/osstat-and-st_birthtime-on-macos-hfs Justin Winokur: Not sure if this is a bug or a feature request, but on macOS with CPython (tested 2.7 and 3.6), `os.stat`'s `stat_result` has `st_birthtime` while PyPy (tested PyPy 5.9.0) does not.