From issues-reply at bitbucket.org Tue Aug 1 16:22:22 2017 From: issues-reply at bitbucket.org (pieroliviermarquis) Date: Tue, 01 Aug 2017 20:22:22 +0000 (UTC) Subject: [pypy-issue] Issue #2620: Ignoring ensurepip failure: pip 9.0.1 requires SSL/TLS (pypy/pypy) Message-ID: <20170801202222.27027.75243@celery-worker-107.ash1.bb-inf.net> New issue 2620: Ignoring ensurepip failure: pip 9.0.1 requires SSL/TLS https://bitbucket.org/pypy/pypy/issues/2620/ignoring-ensurepip-failure-pip-901 pieroliviermarquis: I am trying to install pip and I am getting this error. $ pypy3 -m ensurepip. Ignoring ensurepip failure: pip 9.0.1 requires SSL/TLS I am using the lasted nightly build. I don't have this problem with 2.7 and I already have pip installed on my computer so it must be something with the package. From issues-reply at bitbucket.org Thu Aug 3 07:47:48 2017 From: issues-reply at bitbucket.org (Mihnea Saracin) Date: Thu, 03 Aug 2017 11:47:48 +0000 (UTC) Subject: [pypy-issue] Issue #2621: Ctypes Structure doesn`t support duplicate field names (pypy/pypy) Message-ID: <20170803114748.31475.27452@celery-worker-108.ash1.bb-inf.net> New issue 2621: Ctypes Structure doesn`t support duplicate field names https://bitbucket.org/pypy/pypy/issues/2621/ctypes-structure-doesn-t-support-duplicate Mihnea Saracin: When I try to run the attached script, it gives the following result only for PyPy . But on Cpython this is legitimate code. ``` #!python ValueError: duplicate field name a ``` The script is part of ctypes/test/test_byteswap.py lines 168-186 From issues-reply at bitbucket.org Thu Aug 3 17:40:52 2017 From: issues-reply at bitbucket.org (David Callahan) Date: Thu, 03 Aug 2017 21:40:52 +0000 (UTC) Subject: [pypy-issue] Issue #2622: building boost 1.64 (pypy/pypy) Message-ID: <20170803214051.24003.17775@celery-worker-107.ash1.bb-inf.net> New issue 2622: building boost 1.64 https://bitbucket.org/pypy/pypy/issues/2622/building-boost-164 David Callahan: Building boost 1.64 with PyPy yields the following error messages: ``` #!text libs/python/src/exec.cpp: In function ?boost::python::api::object boost::python::exec_file(boost::python::str, boost::python::api::object, boost::python::api::object)?: libs/python/src/exec.cpp:89:30: error: ?_Py_fopen? was not declared in this scope FILE *fs = _Py_fopen(f, "r"); ^ libs/python/src/wrapper.cpp: In member function ?boost::python::override boost::python::detail::wrapper_base::get\_override(const char*, PyTypeObject*) const?: libs/python/src/wrapper.cpp:28:50: error: ?struct PyMethodObject? has no member named ?im_self? > && ((PyMethodObject*)m.get())->im_self == this->m_self ^ libs/python/src/wrapper.cpp:37:61: error: ?struct PyMethodObject? has no member named ?im_func? if (borrowed_f != ((PyMethodObject*)m.get())->im_func) ``` In CPython 3.6.3 Py_fopen is declared in fileutils.h. Boost guards this access with a test on Pyhton version >= 3.4. Note, to build boost with PyPy, I modified the project-config.jam file built by boostrap.sh by changing the "using" line for python to be: ``` #!text using python : 3.5 # Version : /home/dcallahan/projects/pypy/install/bin/pypy3 # Python Path : /home/dcallahan/projects/pypy/install/include # include path : /home/dcallahan/projects/pypy/install/bin # lib path(s) ; } ``` ^ From issues-reply at bitbucket.org Fri Aug 4 14:23:49 2017 From: issues-reply at bitbucket.org (Nathaniel Smith) Date: Fri, 04 Aug 2017 18:23:49 +0000 (UTC) Subject: [pypy-issue] Issue #2623: Theoretical memory consistency problem in rpython signal handling (pypy/pypy) Message-ID: <20170804182348.18363.98375@celery-worker-110.ash1.bb-inf.net> New issue 2623: Theoretical memory consistency problem in rpython signal handling https://bitbucket.org/pypy/pypy/issues/2623/theoretical-memory-consistency-problem-in Nathaniel Smith: Here's `pypysig_pushback`: ```python void pypysig_pushback(int signum) { if (0 <= signum && signum < NSIG) { pypysig_flags[signum] = 1; pypysig_occurred = 1; pypysig_counter.value = -1; } } ``` For correctness, it requires that the write to `pypysig_flags` happens-before the write to `pypysig_occurred`, because of how `pypysig_poll` is written. However, on most CPU architectures this is not guaranteed ? the variables here are marked `volatile` which prevents the C compiler from rearranging the stores, but it doesn't do anything to prevent the cache hierarchy from rearranging the stores. `pypysig_pushback` and `pypysig_poll` should use something like `stdatomic.h` when storing/loading these variables to ensure that proper memory fences are included. On x86/x86-64 you can probably get away with this, and on Unix the signal handler usually (but not always) runs in the main thread, so it's not likely that anyone is hitting this in practice, but in theory any code that relies on `volatile` for cross-thread synchronization is just wrong. CPython version of this bug: https://bugs.python.org/issue31119 From issues-reply at bitbucket.org Sun Aug 6 15:25:50 2017 From: issues-reply at bitbucket.org (Nathaniel Smith) Date: Sun, 06 Aug 2017 19:25:50 +0000 (UTC) Subject: [pypy-issue] Issue #2624: Weird performance on pypy3 when reading from a text-mode file (pypy/pypy) Message-ID: <20170806192549.18330.6195@celery-worker-105.ash1.bb-inf.net> New issue 2624: Weird performance on pypy3 when reading from a text-mode file https://bitbucket.org/pypy/pypy/issues/2624/weird-performance-on-pypy3-when-reading Nathaniel Smith: This little benchmark tries to estimate the speed of `file.read` by comparing `seek(0); read()` versus `seek(0)`. If the file's opened in binary mode, then things makes sense and PyPy is fast ? CPython does ~400 ns/(seek+read) and PyPy3 does ~70 ns/(seek+read). OTOH if the file's opened in text mode, then CPython does ~5000 ns/(seek+read) (which seems a bit silly but not implausible), and PyPy3 requires ~18,000 ns/(seek+read), which seems to suggest something has gone wrong. Even weirder, I found that PyPy3's speed was stable for any individual file, but if I switched to a different file then sometimes the speed would change dramatically. Like `/etc/passwd` gives me ~18,000 ns/(seek+read), but `/etc/fstab` gives me ~6,700 ns/(seek+read), consistently. All the files I tried are plain ASCII, but maybe there's something weird about the pattern of newlines or something. Possibly this is expected because Python 3's IO stack is just too complicated or something, but I found it surprising that such a small simple loop would be slower than CPython. ```python import time #COUNT = 1000000 #f = open("/etc/passwd", "rb") COUNT = 100000 f = open("/etc/passwd", "rt") while True: start = time.monotonic() for _ in range(COUNT): f.seek(0) f.read(10) between = time.monotonic() for _ in range(COUNT): f.seek(0) end = time.monotonic() both = (between - start) / COUNT * 1e6 seek = (end - between) / COUNT * 1e6 read = both - seek print("{:.2f} ?s/(seek+read), {:.2f} ?s/seek, estimate ~{:.2f} ?s/read" .format(both, seek, read)) ``` From issues-reply at bitbucket.org Mon Aug 7 08:18:28 2017 From: issues-reply at bitbucket.org (Mihnea Saracin) Date: Mon, 07 Aug 2017 12:18:28 +0000 (UTC) Subject: [pypy-issue] Issue #2625: Ctypes cast does not work on string like objects (pypy/pypy) Message-ID: <20170807121828.22493.45099@celery-worker-108.ash1.bb-inf.net> New issue 2625: Ctypes cast does not work on string like objects https://bitbucket.org/pypy/pypy/issues/2625/ctypes-cast-does-not-work-on-string-like Mihnea Saracin: Running on PyPy, the attached script gives the following traceback, but on Cpython everything works fine. ``` #!python File "test_struct_struct.py", line 20, in s = cast(data, ptr)[0] File "/home/mihnea/Downloads/Issue1213/source_pypy/pypy/lib-python/2.7/ctypes/__init__.py", line 501, in cast return _cast_addr(obj, obj, typ) File "/home/mihnea/Downloads/Issue1213/source_pypy/pypy/lib_pypy/_ctypes/pointer.py", line 148, in _cast_addr % (type(obj),)) TypeError: cast() argument 1 must be a pointer, not ``` This script is part of ctypes/test/test_byteswap.py lines 196-220. From issues-reply at bitbucket.org Thu Aug 10 10:25:48 2017 From: issues-reply at bitbucket.org (Stuart Axon) Date: Thu, 10 Aug 2017 14:25:48 +0000 (UTC) Subject: [pypy-issue] =?utf-8?q?Issue_=232626=3A_invalid_conversion_from_?= =?utf-8?b?4oCYY29uc3QgY2hhcirigJkgdG8g4oCYY2hhciogaW4gY3l0aG9uIGJhc2Vk?= =?utf-8?q?_library_=28pypy/pypy=29?= Message-ID: <20170810142547.2449.25577@celery-worker-105.ash1.bb-inf.net> New issue 2626: invalid conversion from ?const char*? to ?char* in cython based library https://bitbucket.org/pypy/pypy/issues/2626/invalid-conversion-from-const-char-to-char Stuart Axon: Trying out pyimgui, a cython based binding to imgui, I found a couple of compile errors with pypy. https://github.com/swistakm/pyimgui This seems to be in unicode 16 decode functions and all complaining about "invalid conversion from ?const char*? to ?char*" ``` python setup.py install Compiling imgui/core.pyx because it changed. [1/1] Cythonizing imgui/core.pyx running install Checking .pth file support in /mnt/data/home/stu/.virtualenvs/tmp-faa2106f85151cc7/site-packages/ /mnt/data/home/stu/.virtualenvs/tmp-faa2106f85151cc7/bin/python -E -c pass TEST PASSED: /mnt/data/home/stu/.virtualenvs/tmp-faa2106f85151cc7/site-packages/ appears to support .pth files running bdist_egg running egg_info writing imgui.egg-info/PKG-INFO writing dependency_links to imgui.egg-info/dependency_links.txt writing requirements to imgui.egg-info/requires.txt writing top-level names to imgui.egg-info/top_level.txt reading manifest file 'imgui.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'imgui.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/imgui copying imgui/__init__.py -> build/lib.linux-x86_64-2.7/imgui creating build/lib.linux-x86_64-2.7/imgui/integrations copying imgui/integrations/opengl.py -> build/lib.linux-x86_64-2.7/imgui/integrations copying imgui/integrations/glfw.py -> build/lib.linux-x86_64-2.7/imgui/integrations copying imgui/integrations/__init__.py -> build/lib.linux-x86_64-2.7/imgui/integrations copying imgui/integrations/sdl2.py -> build/lib.linux-x86_64-2.7/imgui/integrations copying imgui/integrations/cocos2d.py -> build/lib.linux-x86_64-2.7/imgui/integrations copying imgui/integrations/pygame.py -> build/lib.linux-x86_64-2.7/imgui/integrations copying imgui/cimgui.pxd -> build/lib.linux-x86_64-2.7/imgui copying imgui/core.cpp -> build/lib.linux-x86_64-2.7/imgui copying imgui/core.h -> build/lib.linux-x86_64-2.7/imgui copying imgui/core.pyx -> build/lib.linux-x86_64-2.7/imgui copying imgui/enums.pxd -> build/lib.linux-x86_64-2.7/imgui running build_ext building 'imgui.core' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/imgui creating build/temp.linux-x86_64-2.7/imgui-cpp creating build/temp.linux-x86_64-2.7/config-cpp cc -pthread -DNDEBUG -O2 -fPIC -DPYIMGUI_CUSTOM_EXCEPTION -Iimgui-cpp -Iimgui -Iconfig-cpp -I/mnt/data/home/stu/.virtualenvs/tmp-faa2106f85151cc7/include -c imgui/core.cpp -o build/temp.linux-x86_64-2.7/imgui/core.o -includeconfig-cpp/py_imconfig.h imgui/core.cpp: In function ?PyObject* __Pyx_PyUnicode_DecodeUTF16(const char*, Py_ssize_t, const char*)?: imgui/core.cpp:1409:61: error: invalid conversion from ?const char*? to ?char*? [-fpermissive] return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); ^ In file included from /mnt/data/home/stu/.virtualenvs/tmp-faa2106f85151cc7/include/Python.h:141:0, from ./config-cpp/py_imconfig.h:14, from :0: /mnt/data/home/stu/.virtualenvs/tmp-faa2106f85151cc7/include/pypy_decl.h:886:31: note: initializing argument 1 of ?PyObject* PyPyUnicode_DecodeUTF16(char*, long int, const char*, int*)? #define PyUnicode_DecodeUTF16 PyPyUnicode_DecodeUTF16 ^ /mnt/data/home/stu/.virtualenvs/tmp-faa2106f85151cc7/include/pypy_decl.h:887:24: note: in expansion of macro ?PyUnicode_DecodeUTF16? PyAPI_FUNC(PyObject *) PyUnicode_DecodeUTF16(char *arg0, Signed arg1, const char *arg2, int *arg3); ^~~~~~~~~~~~~~~~~~~~~ imgui/core.cpp: In function ?PyObject* __Pyx_PyUnicode_DecodeUTF16LE(const char*, Py_ssize_t, const char*)?: imgui/core.cpp:1413:61: error: invalid conversion from ?const char*? to ?char*? [-fpermissive] return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); ^ In file included from /mnt/data/home/stu/.virtualenvs/tmp-faa2106f85151cc7/include/Python.h:141:0, from ./config-cpp/py_imconfig.h:14, from :0: /mnt/data/home/stu/.virtualenvs/tmp-faa2106f85151cc7/include/pypy_decl.h:886:31: note: initializing argument 1 of ?PyObject* PyPyUnicode_DecodeUTF16(char*, long int, const char*, int*)? #define PyUnicode_DecodeUTF16 PyPyUnicode_DecodeUTF16 ^ /mnt/data/home/stu/.virtualenvs/tmp-faa2106f85151cc7/include/pypy_decl.h:887:24: note: in expansion of macro ?PyUnicode_DecodeUTF16? PyAPI_FUNC(PyObject *) PyUnicode_DecodeUTF16(char *arg0, Signed arg1, const char *arg2, int *arg3); ^~~~~~~~~~~~~~~~~~~~~ imgui/core.cpp: In function ?PyObject* __Pyx_PyUnicode_DecodeUTF16BE(const char*, Py_ssize_t, const char*)?: imgui/core.cpp:1417:61: error: invalid conversion from ?const char*? to ?char*? [-fpermissive] return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); ^ In file included from /mnt/data/home/stu/.virtualenvs/tmp-faa2106f85151cc7/include/Python.h:141:0, from ./config-cpp/py_imconfig.h:14, from :0: /mnt/data/home/stu/.virtualenvs/tmp-faa2106f85151cc7/include/pypy_decl.h:886:31: note: initializing argument 1 of ?PyObject* PyPyUnicode_DecodeUTF16(char*, long int, const char*, int*)? #define PyUnicode_DecodeUTF16 PyPyUnicode_DecodeUTF16 ^ /mnt/data/home/stu/.virtualenvs/tmp-faa2106f85151cc7/include/pypy_decl.h:887:24: note: in expansion of macro ?PyUnicode_DecodeUTF16? PyAPI_FUNC(PyObject *) PyUnicode_DecodeUTF16(char *arg0, Signed arg1, const char *arg2, int *arg3); ^~~~~~~~~~~~~~~~~~~~~ error: command 'cc' failed with exit status 1 ``` From issues-reply at bitbucket.org Thu Aug 10 19:28:39 2017 From: issues-reply at bitbucket.org (Stuart Axon) Date: Thu, 10 Aug 2017 23:28:39 +0000 (UTC) Subject: [pypy-issue] Issue #2627: PyThreadState missing curexc_type, curexc_value. curexc_traceback (pypy/pypy) Message-ID: <20170810232839.25883.93859@celery-worker-109.ash1.bb-inf.net> New issue 2627: PyThreadState missing curexc_type, curexc_value. curexc_traceback https://bitbucket.org/pypy/pypy/issues/2627/pythreadstate-missing-curexc_type Stuart Axon: Attempting to build pygame, it appears there are a few missing members on PyThreadState: curexc_type, curexc_value. curexc_traceback https://github.com/pygame/pygame - ``` $ ?make install python setup.py install running install running bdist_egg running egg_info creating pygame.egg-info writing pygame.egg-info/PKG-INFO writing dependency_links to pygame.egg-info/dependency_links.txt writing top-level names to pygame.egg-info/top_level.txt writing manifest file 'pygame.egg-info/SOURCES.txt' reading manifest file 'pygame.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' no previously-included directories found matching '*/CVS' no previously-included directories found matching '*/*/CVS' writing manifest file 'pygame.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py copying lib/version.py -> build/lib.linux-x86_64-2.7/pygame running build_ext building 'pygame.pypm' extension cc -pthread -DNDEBUG -O2 -fPIC -D_REENTRANT -DENABLE_NEWBUF=0 -I/usr/X11R6/include -I/usr/include/SDL -I/usr/include -I/usr/include -I/mnt/data/home/stu/.virtualenvs/pypy-nightly/include -c src/pypm.c -o build/temp.linux-x86_64-2.7/src/pypm.o src/pypm.c: In function ?__Pyx_ErrRestore?: src/pypm.c:4991:22: error: ?PyThreadState {aka struct _ts}? has no member named ?curexc_type? tmp_type = tstate->curexc_type; ^~ src/pypm.c:4992:23: error: ?PyThreadState {aka struct _ts}? has no member named ?curexc_value? tmp_value = tstate->curexc_value; ^~ src/pypm.c:4993:20: error: ?PyThreadState {aka struct _ts}? has no member named ?curexc_traceback? tmp_tb = tstate->curexc_traceback; ^~ src/pypm.c:4994:11: error: ?PyThreadState {aka struct _ts}? has no member named ?curexc_type? tstate->curexc_type = type; ^~ src/pypm.c:4995:11: error: ?PyThreadState {aka struct _ts}? has no member named ?curexc_value? tstate->curexc_value = value; ^~ src/pypm.c:4996:11: error: ?PyThreadState {aka struct _ts}? has no member named ?curexc_traceback? tstate->curexc_traceback = tb; ^~ src/pypm.c: In function ?__Pyx_ErrFetch?: src/pypm.c:5004:19: error: ?PyThreadState {aka struct _ts}? has no member named ?curexc_type? *type = tstate->curexc_type; ^~ src/pypm.c:5005:20: error: ?PyThreadState {aka struct _ts}? has no member named ?curexc_value? *value = tstate->curexc_value; ^~ src/pypm.c:5006:17: error: ?PyThreadState {aka struct _ts}? has no member named ?curexc_traceback? *tb = tstate->curexc_traceback; ^~ src/pypm.c:5008:11: error: ?PyThreadState {aka struct _ts}? has no member named ?curexc_type? tstate->curexc_type = 0; ^~ src/pypm.c:5009:11: error: ?PyThreadState {aka struct _ts}? has no member named ?curexc_value? tstate->curexc_value = 0; ^~ src/pypm.c:5010:11: error: ?PyThreadState {aka struct _ts}? has no member named ?curexc_traceback? tstate->curexc_traceback = 0; ^~ error: command 'cc' failed with exit status 1 Makefile:10: recipe for target 'install' failed make: *** [install] Error 1 ``` From issues-reply at bitbucket.org Sat Aug 12 11:26:57 2017 From: issues-reply at bitbucket.org (Liran Haimovitch) Date: Sat, 12 Aug 2017 15:26:57 +0000 (UTC) Subject: [pypy-issue] Issue #2628: sys._current_frames cannot be used with inspect.getframeinfo (pypy/pypy) Message-ID: <20170812152656.40633.94318@celery-worker-109.ash1.bb-inf.net> New issue 2628: sys._current_frames cannot be used with inspect.getframeinfo https://bitbucket.org/pypy/pypy/issues/2628/sys_current_frames-cannot-be-used-with Liran Haimovitch: When calling sys._current_frames a dictionary with "__builtin__.fake_frame" values is returned. These objects cannot be properly used with the inspect module getframeinfo function as it tests the object type (inspect.py at 180). TracebackType and FrameType show up as "traceback" and "frame". From issues-reply at bitbucket.org Sun Aug 13 07:34:25 2017 From: issues-reply at bitbucket.org (Artur Siekielski) Date: Sun, 13 Aug 2017 11:34:25 +0000 (UTC) Subject: [pypy-issue] Issue #2629: SIGSEGV when mistyping __del__ for __delete__ in a property (pypy/pypy) Message-ID: <20170813113425.4372.8382@celery-worker-107.ash1.bb-inf.net> New issue 2629: SIGSEGV when mistyping __del__ for __delete__ in a property https://bitbucket.org/pypy/pypy/issues/2629/sigsegv-when-mistyping-__del__-for Artur Siekielski: The following code results in SIGSEGV (PyPy 5.8.0, Linux). Note that a property should define __delete__, not __del__. CPython gives a proper message. ``` #!python undefined = object() class cached_property(property): def __init__(self, func): self.__name__ = func.__name__ self.__module__ = func.__module__ self.__doc__ = func.__doc__ self.func = func def __set__(self, obj, value): obj.__dict__[self.__name__] = value def __get__(self, obj, type=None): if obj is None: return self value = obj.__dict__.get(self.__name__, undefined) if value is undefined: value = self.func(obj) obj.__dict__[self.__name__] = value return value def __del__(self, obj): print '__del__' class A(object): @cached_property def f(self): return 1 a = A() del a.f ``` From issues-reply at bitbucket.org Sun Aug 13 07:51:32 2017 From: issues-reply at bitbucket.org (Min RK) Date: Sun, 13 Aug 2017 11:51:32 +0000 (UTC) Subject: [pypy-issue] Issue #2630: In dists: libpypy-c is in bin/ instead of lib/ (pypy/pypy) Message-ID: <20170813115131.7928.99695@celery-worker-108.ash1.bb-inf.net> New issue 2630: In dists: libpypy-c is in bin/ instead of lib/ https://bitbucket.org/pypy/pypy/issues/2630/in-dists-libpypy-c-is-in-bin-instead-of Min RK: in *ix binary dists, the libpypy-c library is in the bin/ prefix instead of the lib/, so linkers don't find it without adding LDFLAGS=/path/to/pypy/bin, which is unusual. Seems like the dylib should just be moved to /lib/, unless I'm missing something. The homebrew recipe [patches this itself](https://github.com/Homebrew/homebrew-core/blob/7750a48d649d7766503250e7920bb68e6950f9d0/Formula/pypy3.rb#L109), but it would be nice if this were the default. From issues-reply at bitbucket.org Sun Aug 13 10:01:19 2017 From: issues-reply at bitbucket.org (GSPark) Date: Sun, 13 Aug 2017 14:01:19 +0000 (UTC) Subject: [pypy-issue] Issue #2631: numpy.array on pypy (pypy/pypy) Message-ID: <20170813140118.22077.57026@celery-worker-108.ash1.bb-inf.net> New issue 2631: numpy.array on pypy https://bitbucket.org/pypy/pypy/issues/2631/numpyarray-on-pypy GSPark: I installed pypy(python2.7) and tried to run it by creating the example below. (I need matrix calculation) However, When building from source, I met an error. " $ python ~/pypy/rpython/bin/rpython test.py " I asked you because I can not solve it for a few hours. If i enter "$ sudo pypy -c 'import numpy' ", no error will occur. -------------------------------------------------------------------------------- [translation:ERROR] AnnotatorError: object with a __call__ is not RPython: Processing block: block at 3[args_0] is a in (test:3)main containing the following operations: v2 = simple_call((function rpython_print_item), ('Hello World')) v3 = simple_call((function rpython_print_newline)) v4 = newlist((1), (2)) v5 = newlist((3), (4)) v6 = newlist((5), (6)) a_0 = newlist(v4, v5, v6) b_0 = simple_call((builtin_function_or_method array), a_0) v7 = getattr(b_0, ('T')) c_0 = simple_call((builtin_function_or_method dot), a_0, v7) v8 = str(c_0) v9 = str(v8) v10 = simple_call((function rpython_print_item), v9) v11 = simple_call((function rpython_print_newline)) --end-- [translation] start debugger... > /home/nvidia/pypy/rpython/annotator/bookkeeper.py(404)getdesc() -> raise AnnotatorError("%s: %r" % (msg, pyobj)) (Pdb+) -------------------------------------------------------------------------------- < test.py > import numpy as np def main(args): print "Hello World" a = [[1,2],[3,4],[5,6]] b = np.array(a) c = np.dot(a,b.T) print(str(c)) return 0 def target(*args): return main, None From issues-reply at bitbucket.org Mon Aug 14 16:30:44 2017 From: issues-reply at bitbucket.org (Frank Odignal) Date: Mon, 14 Aug 2017 20:30:44 +0000 (UTC) Subject: [pypy-issue] Issue #2632: dateutil: tz.tzwinlocal from datetime not working with pypy (pypy/pypy) Message-ID: <20170814203043.28639.62103@celery-worker-109.ash1.bb-inf.net> New issue 2632: dateutil: tz.tzwinlocal from datetime not working with pypy https://bitbucket.org/pypy/pypy/issues/2632/dateutil-tztzwinlocal-from-datetime-not Frank Odignal: When I try to use tz.tzwinlocal from datetime, I get the following error: ``` #!python Python 2.7.13 (c925e7381036, Jun 06 2017, 05:28:16) [PyPy 5.8.0 with MSC v.1500 32 bit] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>> from dateutil import tz >>>> x = tz.tzwinlocal() Traceback (most recent call last): File "", line 1, in File "c:\pypy2-v5.8.0-win32\site-packages\dateutil\tz\win.py", line 241, in __init__ keydict = valuestodict(tzlocalkey) File "c:\pypy2-v5.8.0-win32\site-packages\dateutil\tz\win.py", line 330, in valuestodict value = tz_res.name_from_string(value) File "c:\pypy2-v5.8.0-win32\site-packages\dateutil\tz\win.py", line 113, in name_from_string return self.load_name(offset) File "c:\pypy2-v5.8.0-win32\site-packages\dateutil\tz\win.py", line 82, in load_name nchar = self.LoadStringW(self._tzres._handle, offset, lpBuffer, 0) File "c:\pypy2-v5.8.0-win32\lib_pypy\_ctypes\function.py", line 349, in __call__ self._convert_args(argtypes, args, kwargs)) File "c:\pypy2-v5.8.0-win32\lib_pypy\_ctypes\function.py", line 577, in _convert_args raise ArgumentError(str(e)) ArgumentError: expected c_void_p instance instead of alt.WinDLL >>>> ``` Above code works fine with a standard Python 2.7.13 installation (Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32). My machine runs Windows Server 2008 R2 64-bit. From issues-reply at bitbucket.org Tue Aug 15 11:14:21 2017 From: issues-reply at bitbucket.org (Nick Malaguti) Date: Tue, 15 Aug 2017 15:14:21 +0000 (UTC) Subject: [pypy-issue] Issue #2633: Cannot import BeautifulSoup from bs4 on pypy3 5.8.0 (pypy/pypy) Message-ID: <20170815151421.5429.70847@celery-worker-109.ash1.bb-inf.net> New issue 2633: Cannot import BeautifulSoup from bs4 on pypy3 5.8.0 https://bitbucket.org/pypy/pypy/issues/2633/cannot-import-beautifulsoup-from-bs4-on Nick Malaguti: ``` $ docker run -it pypy:3-5.8.0 bash root at 11a1fb75b382:/# pip install beautifulsoup4 Collecting beautifulsoup4 Downloading beautifulsoup4-4.6.0-py3-none-any.whl (86kB) 100% |????????????????????????????????| 92kB 2.2MB/s Installing collected packages: beautifulsoup4 Successfully installed beautifulsoup4-4.6.0 root at 11a1fb75b382:/# pip install lxml Collecting lxml Downloading lxml-3.8.0.tar.gz (3.8MB) 100% |????????????????????????????????| 3.8MB 254kB/s Building wheels for collected packages: lxml Running setup.py bdist_wheel for lxml ... done Stored in directory: /root/.cache/pip/wheels/e2/52/c3/a7b7aa7dc1294d715fa6eb49d5c63e0d9713652fcc6a609857 Successfully built lxml Installing collected packages: lxml Successfully installed lxml-3.8.0 root at 11a1fb75b382:/# pypy3 Python 3.5.3 (a39af0be3a22, Jun 05 2017, 20:18:00) [PyPy 5.8.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: ``"ah, just in time documentation" (__ap__)'' >>>> from bs4 import BeautifulSoup Traceback (most recent call last): File "", line 1, in File "/usr/local/site-packages/bs4/__init__.py", line 35, in from .builder import builder_registry, ParserRejectedMarkup File "/usr/local/site-packages/bs4/builder/__init__.py", line 329, in from . import _lxml File "/usr/local/site-packages/bs4/builder/_lxml.py", line 11, in from lxml import etree File "src/lxml/xmlschema.pxi", line 22, in init lxml.etree (src/lxml/lxml.etree.c:231895) File "src/lxml/xpath.pxi", line 420, in lxml.etree.XPath.__init__ (src/lxml/lxml.etree.c:173999) File "src/lxml/xpath.pxi", line 150, in lxml.etree._XPathEvaluatorBase.set_context (src/lxml/lxml.etree.c:170398) File "src/lxml/xpath.pxi", line 66, in lxml.etree._XPathContext.set_context (src/lxml/lxml.etree.c:169176) File "src/lxml/extensions.pxi", line 255, in lxml.etree._BaseContext.registerLocalFunctions (src/lxml/lxml.etree.c:160400) AttributeError: 'dict' object has no attribute 'iteritems' >>>> ``` There is a similar issue #2498 that involved Cython. From issues-reply at bitbucket.org Wed Aug 16 01:04:09 2017 From: issues-reply at bitbucket.org (Nathaniel Smith) Date: Wed, 16 Aug 2017 05:04:09 +0000 (UTC) Subject: [pypy-issue] Issue #2634: datetime example where pypy3 is 30x slower (and pypy2 is 3x slower) (pypy/pypy) Message-ID: <20170816050409.4275.21033@celery-worker-107.ash1.bb-inf.net> New issue 2634: datetime example where pypy3 is 30x slower (and pypy2 is 3x slower) https://bitbucket.org/pypy/pypy/issues/2634/datetime-example-where-pypy3-is-30x-slower Nathaniel Smith: Test script adapted from gh16ito on IRC: ```python # -*- encoding: utf-8 -*- import time from datetime import datetime, timedelta def time_batch(batch_size, name, fn): start = time.time() for _ in range(batch_size): fn() end = time.time() print("{:.2f} ?s/{}".format((end - start) / batch_size * 1e6, name)) def test_func(): delta = timedelta(days=365+31+1, seconds=1+60+3600) dt = datetime(1900, 1, 1) for i in range(200): dt += delta def test_func_ctime(): delta = timedelta(days=365+31+1, seconds=1+60+3600) dt = datetime(1900, 1, 1) for i in range(200): dt += delta dt.ctime() if __name__ == "__main__": while True: time_batch(10000, "test_func", test_func) time_batch(10000, "test_func_ctime", test_func) ``` CPython 2.7: ~22 ?s/call CPython 3.6: ~16 ?s/call PyPy2 5.8: ~60 ?s/call PyPy3 5.8: ~480 ?s/call (after a long warm up period) From issues-reply at bitbucket.org Wed Aug 16 12:36:03 2017 From: issues-reply at bitbucket.org (Paul G) Date: Wed, 16 Aug 2017 16:36:03 +0000 (UTC) Subject: [pypy-issue] Issue #2635: datetime.replace always returns datetime.datetime in pypy3 (pypy/pypy) Message-ID: <20170816163603.31063.14613@celery-worker-106.ash1.bb-inf.net> New issue 2635: datetime.replace always returns datetime.datetime in pypy3 https://bitbucket.org/pypy/pypy/issues/2635/datetimereplace-always-returns Paul G: MWE: `demo_datetime_replace.py`: ``` #!python from datetime import datetime class SuperDatetime(datetime): pass if __name__ == "__main__": sdt0 = SuperDatetime(2017, 8, 1) sdt1 = sdt0.replace(2016, 8, 1) print(repr(sdt0)) print(repr(sdt1)) ``` ``` #! bash $ python2 demo_datetime_replace.py SuperDatetime(2017, 8, 1, 0, 0) SuperDatetime(2016, 8, 1, 0, 0) $ python3 demo_datetime_replace.py SuperDatetime(2017, 8, 1, 0, 0) SuperDatetime(2016, 8, 1, 0, 0) $ pypy demo_datetime_replace.py SuperDatetime(2017, 8, 1, 0, 0) SuperDatetime(2016, 8, 1, 0, 0) $ pypy3 demo_datetime_replace.py __main__.SuperDatetime(2017, 8, 1, 0, 0) datetime.datetime(2016, 8, 1, 0, 0) ``` It seems that `pypy3` is *also* the odd man out with respect to how `repr` is treated, but that's a separate and less important issue. It's not clear to me how much "`datetime.replace` returns the same class of object" is part of the Python spec, but it seems reasonable and it's definitely a shift in behavior. There's [something about subclasses of builtin types here](http://doc.pypy.org/en/latest/cpython_differences.html#subclasses-of-built-in-types), but it doesn't seem relevant to me, if I'm understanding it right. From issues-reply at bitbucket.org Fri Aug 18 10:55:06 2017 From: issues-reply at bitbucket.org (Armin Rigo) Date: Fri, 18 Aug 2017 14:55:06 +0000 (UTC) Subject: [pypy-issue] Issue #2636: sys.stderr cannot write big string on Windows (pypy/pypy) Message-ID: <20170818145505.13392.5698@celery-worker-105.ash1.bb-inf.net> New issue 2636: sys.stderr cannot write big string on Windows https://bitbucket.org/pypy/pypy/issues/2636/sysstderr-cannot-write-big-string-on Armin Rigo: On Windows, the following script fails with ``IOError: Not enough space: ''``. The same script works on CPython 2.7.10. I suspect it's Windows that gives nonsense but CPython works around it. ``` #!python import sys sys.stderr.write('x' * 0xffffff) ``` From issues-reply at bitbucket.org Sun Aug 20 05:17:36 2017 From: issues-reply at bitbucket.org (Omer Katz) Date: Sun, 20 Aug 2017 09:17:36 +0000 (UTC) Subject: [pypy-issue] Issue #2637: Cannot create a gRPC server with PyPy (pypy/pypy) Message-ID: <20170820091735.36497.34168@celery-worker-105.ash1.bb-inf.net> New issue 2637: Cannot create a gRPC server with PyPy https://bitbucket.org/pypy/pypy/issues/2637/cannot-create-a-grpc-server-with-pypy Omer Katz: This issue is present in PyPy2/3 5.8.0 and possibly previous versions which I haven't checked. When creating a gRPC server we get an RPython fatal error because CPyListStrategy_getstorage_copy is not implemented. You can reproduce this problem by installing grpc: ``` #!bash pip install grpcio ``` and running the following script: ``` #!python import grpc from concurrent import futures server = grpc.server(futures.ThreadPoolExecutor(max_workers=1)) server.start() ``` The code snippet above returns the following error: ``` #!text RPython traceback: File "pypy_interpreter.c", line 38711, in BuiltinCode4_fastcall_4 File "implement_2.c", line 12927, in fastfunc_descr_setslice_4 File "pypy_objspace_std_1.c", line 22711, in EmptyListStrategy_setslice File "pypy_module_cpyext_2.c", line 16832, in CPyListStrategy_getstorage_copy Fatal RPython error: NotImplementedError Aborted (core dumped) ``` From issues-reply at bitbucket.org Mon Aug 21 10:55:52 2017 From: issues-reply at bitbucket.org (chrys) Date: Mon, 21 Aug 2017 14:55:52 +0000 (UTC) Subject: [pypy-issue] Issue #2638: pypy3 UnicodeDecodeError on start interactive shell (pypy/pypy) Message-ID: <20170821145552.35676.66959@celery-worker-105.ash1.bb-inf.net> New issue 2638: pypy3 UnicodeDecodeError on start interactive shell https://bitbucket.org/pypy/pypy/issues/2638/pypy3-unicodedecodeerror-on-start chrys: Howdy, I pypy3 on my Archbox to use it. Its amazing! But for me it creates an trace at running pypy3 from bash. (but it still opens, and runs, so no crash at all). I mark is as minor since the application is still runnable. here is the trace trance (first line is my bashprompt mabye it has problems with the "?" somehow?): 16:38 [user at host~] ?$ pypy3 Python 3.5.3 (a37ecfe5f142bc971a86d17305cc5d1d70abec64, Jun 12 2017, 16:41:39) [PyPy 5.8.0-beta0 with GCC 7.1.1 20170528] on linux Type "help", "copyright", "credits" or "license" for more information. Traceback (most recent call last): File "/opt/pypy3/lib-python/3/site.py", line 430, in register_readline readline.read_history_file(history) File "/opt/pypy3/lib_pypy/pyrepl/readline.py", line 322, in read_history_file for line in f: File "/opt/pypy3/lib-python/3/codecs.py", line 321, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf8' codec can't decode byte 0xe2 in position 80: invalid continuation byte And now for something completely different: ``happy PyPy's year 2010!'' >>>> From issues-reply at bitbucket.org Wed Aug 23 04:12:20 2017 From: issues-reply at bitbucket.org (Nathaniel Smith) Date: Wed, 23 Aug 2017 08:12:20 +0000 (UTC) Subject: [pypy-issue] Issue #2639: PyPy3.5 should allow assigning to module object __class__ (pypy/pypy) Message-ID: <20170823081220.21566.56344@celery-worker-110.ash1.bb-inf.net> New issue 2639: PyPy3.5 should allow assigning to module object __class__ https://bitbucket.org/pypy/pypy/issues/2639/pypy35-should-allow-assigning-to-module Nathaniel Smith: I was trying to use [`metamodule`](https://github.com/njsmith/metamodule) on pypy3 5.8.0, but it doesn't work: unlike CPython, you can't assign to module object's `__class__` attribute. This is a narrow exception to the normal "`__class__` assignment is only for heap types" rule that was added in CPython 3.5 ? now the rule is "only heap types or modules". [CPython source.](https://github.com/python/cpython/blob/772d809a63f40fd35679da3fb115cdf7fa81bd20/Objects/typeobject.c#L3813-L3870) PyPy should implement this too so I can deprecate module attributes :-) From issues-reply at bitbucket.org Fri Aug 25 02:32:49 2017 From: issues-reply at bitbucket.org (kumarsantosh3295) Date: Fri, 25 Aug 2017 06:32:49 +0000 (UTC) Subject: [pypy-issue] Issue #2640: sandbox translation in ubnutu 16.04 LTS 64bit is failing (pypy/pypy) Message-ID: <20170825063248.40177.71050@celery-worker-107.ash1.bb-inf.net> New issue 2640: sandbox translation in ubnutu 16.04 LTS 64bit is failing https://bitbucket.org/pypy/pypy/issues/2640/sandbox-translation-in-ubnutu-1604-lts kumarsantosh3295: 1.First i have installed all the dependencies for pypy 2.Downloaded pypy from the latest pull from official pypy website 3.Then when i want to translate from pypy/pypy/goal directory to generate "pypy-c-sandbox" executable file,this is end with this following error [translation:info] 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] [platform:msg] Set platform with 'host' cc=None, using cc='gcc', version='Unknown' [translation:info] Translating target as defined by targetpypystandalone [translation:info] Error: File "/home/santo/pypy/rpython/translator/goal/translate.py", line 284, in main default_goal='compile') File "/home/santo/pypy/rpython/translator/driver.py", line 566, in from_targetspec spec = target(driver, args) File "targetpypystandalone.py", line 313, in target assert 0, ("--sandbox is not tested nor maintained. If you " [translation:ERROR] AssertionError: --sandbox is not tested nor maintained. If you really want to try it anyway, remove this line in pypy/goal/targetpypystandalone.py. [translation] start debugger... > /home/santo/pypy/pypy/goal/targetpypystandalone.py(313)target() -> assert 0, ("--sandbox is not tested nor maintained. If you " (Pdb+) From issues-reply at bitbucket.org Tue Aug 29 05:01:24 2017 From: issues-reply at bitbucket.org (SimonVM) Date: Tue, 29 Aug 2017 09:01:24 +0000 (UTC) Subject: [pypy-issue] Issue #2641: XML library incorrectly parsing files on Windows (pypy/pypy) Message-ID: <20170829090123.25887.75959@celery-worker-106.ash1.bb-inf.net> New issue 2641: XML library incorrectly parsing files on Windows https://bitbucket.org/pypy/pypy/issues/2641/xml-library-incorrectly-parsing-files-on SimonVM: pypy incorrectly parses XML files using the default xml.etree.ElementTree library. A minimal working example is given below. XML file "test.xml": ``` #!xml ``` Python file "test.py": ``` #!python import xml.etree.ElementTree as ET tree = ET.parse("test.xml") root = tree.getroot() print root.tag ``` Expected output of running `pypy test.py` is "root", actual output is "r". Other functions (such as findall) are also affected. This is an issue with latest version of PyPy, v5.8.0-win32 on 64-bit Windows 10. It runs correctly on Linux, as well as for Python v2.7.13. From issues-reply at bitbucket.org Thu Aug 31 12:12:40 2017 From: issues-reply at bitbucket.org (afteryu) Date: Thu, 31 Aug 2017 16:12:40 +0000 (UTC) Subject: [pypy-issue] Issue #2642: Deleting attributes in another module is significantly slower than CPython (pypy/pypy) Message-ID: <20170831161240.36053.67189@celery-worker-105.ash1.bb-inf.net> New issue 2642: Deleting attributes in another module is significantly slower than CPython https://bitbucket.org/pypy/pypy/issues/2642/deleting-attributes-in-another-module-is afteryu: I came across a performance regression on PyPy3 (v5.8.0-beta0) when I was doing some nasty namespace hacks. I tried to narrow the problem down, and found that PyPy3, when deleting attributes of another module, is significantly slower than CPython. Below is the test case I managed to come up with. In `test.py`: ```python import foo def benchmark(func): from time import perf_counter def inner(): start = perf_counter() for i in range(1000000): func() end = perf_counter() print(end - start) return inner @benchmark def add_del(): foo.bar = 'baz' del foo.bar if __name__ == '__main__': add_del() ``` Module `foo` is an empty file. Running `test.py` yields the following results: ``` $ pypy3 -V Python 3.5.3 (a37ecfe5f142bc971a86d17305cc5d1d70abec64, Jun 10 2017, 18:23:14) [PyPy 5.8.0-beta0 with GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] $ python3 -V Python 3.6.2 $ pypy3 test.py 1.1875620842911303 $ python3 test.py 0.3927199188619852 ``` Changing from `del foo.bar` to `delattr(foo, 'bar')` gives similar results. The problem disappears, however, if I were to delete an attribute of a class, or an item in a dictionary. Thanks a lot.