From issues-reply at bitbucket.org Mon Dec 3 10:16:33 2018 From: issues-reply at bitbucket.org (Daniel Herding) Date: Mon, 03 Dec 2018 15:16:33 +0000 (UTC) Subject: [pypy-issue] Issue #2924: int.to_bytes argument name "nbytes" should be "length" (pypy/pypy) Message-ID: <20181203151633.27471.80102@celery-worker-108.ash1.bb-inf.net> New issue 2924: int.to_bytes argument name "nbytes" should be "length" https://bitbucket.org/pypy/pypy/issues/2924/intto_bytes-argument-name-nbytes-should-be Daniel Herding: Our codebase contains code like this: int.to_bytes(1024, length=8, byteorder="big") Running the same code in Python 3.5.3 [PyPy 6.0.0 with GCC 6.2.0 20160901] on linux leads to: TypeError: to_bytes() got an unexpected keyword argument 'length' Running int.to_bytes() in PyPy shows: TypeError: to_bytes() missing 3 required positional arguments: 'self', 'nbytes', and 'byteorder' The following works in PyPy: int.to_bytes(1024, nbytes=8, byteorder="big") # Does not work in CPython or simply int.to_bytes(1024, 8, byteorder="big") # Also works in CPython Omitting the name of the positional argument is a possible workaround, which has been used by other people: https://github.com/LonamiWebs/Telethon/issues/833 However, it would be nice if PyPy accepted the standardized argument name "length" instead of "nbytes". From issues-reply at bitbucket.org Mon Dec 3 15:41:05 2018 From: issues-reply at bitbucket.org (Carl Friedrich Bolz-Tereick) Date: Mon, 03 Dec 2018 20:41:05 +0000 (UTC) Subject: [pypy-issue] Issue #2925: Don't use module dicts for function.__kw_defaults__ (pypy/pypy) Message-ID: <20181203204105.34955.55477@celery-worker-108.ash1.bb-inf.net> New issue 2925: Don't use module dicts for function.__kw_defaults__ https://bitbucket.org/pypy/pypy/issues/2925/dont-use-module-dicts-for Carl Friedrich Bolz-Tereick: It's not safe to use a module dict for the ``function.__kw_defaults__`` dictionary, because that will promote itself on reads, but every closure creates a new such dict. I suppose other uses of moduledict should be checked for the same problem. From issues-reply at bitbucket.org Wed Dec 5 04:42:39 2018 From: issues-reply at bitbucket.org (zhang yao) Date: Wed, 05 Dec 2018 09:42:39 +0000 (UTC) Subject: [pypy-issue] Issue #2926: pypy6.0 AssertionError if added --objspace-std-withprebuiltint option (pypy/pypy) Message-ID: <20181205094239.17395.41491@app-137.ash1.bb-inf.net> New issue 2926: pypy6.0 AssertionError if added --objspace-std-withprebuiltint option https://bitbucket.org/pypy/pypy/issues/2926/pypy60-assertionerror-if-added-objspace zhang yao: Hello, We are using pypy6.0 for our project, But when we turn on the withprebuiltin translation-option, there is a certain probability that a crash will occur. ``` #!python RPython traceback: File "rpython_jit_metainterp_10.c", line 43844, in send_bridge_to_backend File "rpython_jit_backend_x86_3.c", line 28386, in Assembler386_assemble_bridge File "rpython_jit_backend_x86.c", line 5467, in Assembler386__assemble File "rpython_jit_backend_x86.c", line 11251, in RegAlloc_walk_operations File "rpython_jit_backend_x86.c", line 36521, in RegAlloc_consider_jump File "rpython_jit_backend_x86_1.c", line 9786, in remap_frame_layout_mixed File "rpython_jit_backend_x86_1.c", line 30440, in remap_frame_layout File "rpython_jit_backend_x86_1.c", line 23989, in MachineCodeBlockWrapper_INSN_MOVSD File "rpython_jit_backend_x86.c", line 14167, in _missing_binary_insn Fatal RPython error: AssertionError ``` Aborted (core dumped) Then I have tried to summarize a simple piece of code, which is reproducible, running it will definitely crash immediately: ``` #!python ###################################### data = [ {"a": 0, "b": 1, "c": 2}, {"a": 0, "b": 1.0, "c": 2}, ] def GetTotalScore(score_map): totalScore = 0 for score in score_map.itervalues(): totalScore += score return totalScore def foo(): for d in data: GetTotalScore(d) while True: foo() ###################################### ``` PS: 1.My test enviroment and tools : OS : Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux C compiler: gcc 4.9.2 2.The versions of pypy I tested: 1)pypy 6.0.0 statble released 2)the official default branch src (hg updated to: changeset: 95388:c8b8ee6787e9, date:Fri Nov 30 16:20:08 2018 +0100) both of them cause the same crash. 3.My translation script: python ../../rpython/bin/rpython --opt=jit --verbose --make-jobs=16 targetpypystandalone --objspace-std-withprebuiltint 4.There is no problem without option: --objspace-std-withprebuiltint We only open this option for testing. 5.Following are similar examples, which are only a little different from the code above, but run well all, no crash occured, these maybe have some reference values for delevlop-team to find the problem. #non-crash-example1: ``` #!python data = [ {"a": 0, "b": 1, "c": 2.0}, #"c" value type modified as float {"a": 0, "b": 1.0, "c": 2.0}, #"c" value type modified as float ] def GetTotalScore(score_map): totalScore = 0 for score in score_map.itervalues(): totalScore += score return totalScore def foo(): for d in data: GetTotalScore(d) while True: foo() ``` #non-crash-example2: ``` #!python data = [ {"a": 0, "b": 1.0, "c": 2.0}, #"b" value type modified as float {"a": 0, "b": 1, "c": 2.0}, #"b" value type modified as int ] def GetTotalScore(score_map): totalScore = 0 for score in score_map.itervalues(): totalScore += score return totalScore def foo(): for d in data: GetTotalScore(d) while True: foo() ``` #non-crash-example3: ``` #!python [data = [ {"a": 0, "b": 1.0}, #item count modified {"a": 0, "b": 1}, #item count modified ] def GetTotalScore(score_map): totalScore = 0 for score in score_map.itervalues(): totalScore += score return totalScore def foo(): for d in data: GetTotalScore(d) while True: foo() ``` #non-crash-example4: ``` #!python data = [ {"a": 0, "b": 1.0, "c": 2.0}, {"a": 0, "b": 1, "c": 2.0}, ] def GetTotalScore(score_map): totalScore = 0.0 #modify init value type as float for score in score_map.itervalues(): totalScore += score return totalScore def foo(): for d in data: GetTotalScore(d) while True: foo() ``` #non-crash-example5: ``` #!python data = [ {"a": 0, "b": 1.0, "c": 2.0}, {"a": 0, "b": 1, "c": 2.0}, ] def GetTotalScore(score_map): totalScore = 0 for score in score_map.values():# modify walking target as list totalScore += score return totalScore def foo(): for d in data: GetTotalScore(d) while True: foo() ``` Think you. From issues-reply at bitbucket.org Wed Dec 5 04:45:07 2018 From: issues-reply at bitbucket.org (Armin Rigo) Date: Wed, 05 Dec 2018 09:45:07 +0000 (UTC) Subject: [pypy-issue] Issue #2927: "pip install --user" wrong directory on pypy3 (pypy/pypy) Message-ID: <20181205094507.7713.61917@celery-worker-112.ash1.bb-inf.net> New issue 2927: "pip install --user" wrong directory on pypy3 https://bitbucket.org/pypy/pypy/issues/2927/pip-install-user-wrong-directory-on-pypy3 Armin Rigo: >From an old pypy-dev mail by Neal Becker. If I do: ``pypy3 -m pip install --user six --verbose`` then I see it goes to ``/home/arigo/.local/lib/python3.5/site-packages``, which is the same directory as CPython 3.5. That's bogus, and also different from if I do the same on PyPy2---then it correctly goes to ``/home/arigo/.local/lib/pypy2.7/site-packages``. From issues-reply at bitbucket.org Fri Dec 7 23:46:34 2018 From: issues-reply at bitbucket.org (Manfred Moitzi) Date: Sat, 08 Dec 2018 04:46:34 +0000 (UTC) Subject: [pypy-issue] Issue #2928: invoking pypy3-v6.0.0 by tox on Windows 10 raises error (pypy/pypy) Message-ID: <20181208044633.4050.50936@celery-worker-111.ash1.bb-inf.net> New issue 2928: invoking pypy3-v6.0.0 by tox on Windows 10 raises error https://bitbucket.org/pypy/pypy/issues/2928/invoking-pypy3-v600-by-tox-on-windows-10 Manfred Moitzi: Setup of virtual pypy3 environment with tox on Windows 10 raises an error: - CPython 3.7.0 on Windows 10 - tox: 3.5.3 - virtualenv: 16.1.0 ``` #!text actionid: pypy3 msg: getenv cmdargs: "'c:\\python37\\python.exe' -m virtualenv --python 'C:\\pypy3-v6.0.0-win32\\pypy3.EXE' pypy3" Using base prefix 'C:\\pypy3-v6.0.0-win32' New pypy executable in D:\Source\ezdxf.git\.tox\pypy3\bin\pypy3.EXE Also creating executable in D:\Source\ezdxf.git\.tox\pypy3\bin\pypy.EXE Installing setuptools, pip, wheel... Complete output from command D:\Source\ezdxf.git\.tox\pypy3\bin\pypy3.EXE - setuptools pip wheel: RPython traceback: File "pypy_interpreter.c", line 42299, in BuiltinCode1_fastcall_1 File "pypy_module_posix.c", line 4913, in get_terminal_size Traceback (most recent call last): File "", line 27, in File "c:\python37\lib\site-packages\virtualenv_support\pip-18.1-py2.py3-none-any.whl\pip\_internal\__init__.py", line 64, in main cmd_name, cmd_args = parse_command(args) File "c:\python37\lib\site-packages\virtualenv_support\pip-18.1-py2.py3-none-any.whl\pip\_internal\cli\main_parser.py", line 58, in parse_command parser = create_main_parser() File "c:\python37\lib\site-packages\virtualenv_support\pip-18.1-py2.py3-none-any.whl\pip\_internal\cli\main_parser.py", line 28, in create_main_parser 'formatter': UpdatingDefaultsHelpFormatter(), File "c:\python37\lib\site-packages\virtualenv_support\pip-18.1-py2.py3-none-any.whl\pip\_internal\cli\parser.py", line 26, in __init__ kwargs['width'] = get_terminal_size()[0] - 2 File "c:\python37\lib\site-packages\virtualenv_support\pip-18.1-py2.py3-none-any.whl\pip\_internal\utils\compat.py", line 217, in get_terminal_size return tuple(shutil.get_terminal_size()) File "D:\Source\ezdxf.git\.tox\pypy3\lib-python\3\shutil.py", line 1078, in get_terminal_size size = os.get_terminal_size(sys.__stdout__.fileno()) SystemError: unexpected internal exception (please report a bug): ; internal traceback was dumped to stderr ---------------------------------------- ...Installing setuptools, pip, wheel...done. Traceback (most recent call last): File "c:\python37\lib\site-packages\virtualenv.py", line 2462, in main() File "c:\python37\lib\site-packages\virtualenv.py", line 762, in main symlink=options.symlink, File "c:\python37\lib\site-packages\virtualenv.py", line 1015, in create_environment install_wheel(to_install, py_executable, search_dirs, download=download) File "c:\python37\lib\site-packages\virtualenv.py", line 968, in install_wheel call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT) File "c:\python37\lib\site-packages\virtualenv.py", line 854, in call_subprocess raise OSError("Command {} failed with error code {}".format(cmd_desc, proc.returncode)) OSError: Command D:\Source\ezdxf.git\.tox\pypy3\bin\pypy3.EXE - setuptools pip wheel failed with error code 1 Running virtualenv with interpreter C:\pypy3-v6.0.0-win32\pypy3.EXE ``` From issues-reply at bitbucket.org Mon Dec 10 01:49:51 2018 From: issues-reply at bitbucket.org (Pavel Ivashkov) Date: Mon, 10 Dec 2018 06:49:51 +0000 (UTC) Subject: [pypy-issue] Issue #2929: Asserts are not removed with PYTHONOPTIMIZE (pypy/pypy) Message-ID: <20181210064951.12239.98001@celery-worker-109.ash1.bb-inf.net> New issue 2929: Asserts are not removed with PYTHONOPTIMIZE https://bitbucket.org/pypy/pypy/issues/2929/asserts-are-not-removed-with Pavel Ivashkov: When optimization flag set, `assert` should be removed: ``` -O : skip assert statements; also PYTHONOPTIMIZE=x -OO : remove docstrings when importing modules in addition to -O PYTHONOPTIMIZE If this is set to a non-empty string it is equivalent to specifying the -O option. If set to an integer, it is equivalent to specifying -O multiple times. ``` Actual result: ``` $ pypy3 -O Python 3.5.3 (fdd60ed87e941677e8ea11acf9f1819466521bf2, Jul 30 2018, 08:59:51) [PyPy 6.0.0 with GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>> __debug__ False >>>> assert False Traceback (most recent call last): File "", line 1, in AssertionError ``` What was expected: ``` $ python3 -O Python 3.7.0 (default, Jun 28 2018, 05:55:06) [Clang 9.1.0 (clang-902.0.39.2)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> __debug__ False >>> assert False >>> ``` From issues-reply at bitbucket.org Tue Dec 11 06:46:07 2018 From: issues-reply at bitbucket.org (mattip) Date: Tue, 11 Dec 2018 11:46:07 +0000 (UTC) Subject: [pypy-issue] Issue #2930: memoryview(ctypes.Structure) does not produce the correct format string (pypy/pypy) Message-ID: <20181211114607.11207.7511@celery-worker-111.ash1.bb-inf.net> New issue 2930: memoryview(ctypes.Structure) does not produce the correct format string https://bitbucket.org/pypy/pypy/issues/2930/memoryview-ctypesstructure-does-not mattip: The following passes on CPython, fails on PyPy (`mv.format` is `B`) ``` class Struct(Structure): _fields_ = [('a', c_int16)] Struct3 = 3 * Struct c_array = (2 * Struct3)( Struct3(Struct(a=1), Struct(a=2), Struct(a=3)), Struct3(Struct(a=4), Struct(a=5), Struct(a=6)) ) mv = memoryview(c_array) assert mv.format == 'T{ New issue 2931: PyPy3.5 Stable Unable to Install -SystemError: unexpected internal exception https://bitbucket.org/pypy/pypy/issues/2931/pypy35-stable-unable-to-install Michael Peacock: Using PyPy3.5 Stable pip 18.1 setuptools 40.6.3 Windows 10 Build 17134 (1803) Unable to install some packages, feel like I've tried everything and can't seem to find anything on the problem I'm getting, Quick bug query to the Cryptography Github told me it looked like a PyPy issue and best to open an issue here. Tested packages: Bcrypt, Cryptography ``` C:\Users\Michael>pip install cryptography Collecting cryptography Using cached https://files.pythonhosted.org/packages/f3/39/d3904df7c56f8654691c4ae1bdb270c1c9220d6da79bd3b1fbad91afd0e1/cryptography-2.4.2.tar.gz Installing build dependencies ... error Complete output from command c:\users\michael\appdata\local\programs\python\pypy3\pypy3.exe -m pip install --ignore-installed --no-user --prefix C:\Users\Michael\AppData\Local\Temp\pip-build-env-jkco8raq --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=18.5 wheel "cffi>=1.7,!=1.11.3; python_implementation != 'PyPy'": RPython traceback: File "pypy_interpreter.c", line 42299, in BuiltinCode1_fastcall_1 File "pypy_module_posix.c", line 4913, in get_terminal_size Traceback (most recent call last): File "c:\users\michael\appdata\local\programs\python\pypy3\lib-python\3\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\michael\appdata\local\programs\python\pypy3\lib-python\3\runpy.py", line 85, in _run_code exec(code, run_globals) File "c:\users\michael\appdata\local\programs\python\pypy3\site-packages\pip\__main__.py", line 19, in sys.exit(_main()) File "c:\users\michael\appdata\local\programs\python\pypy3\site-packages\pip\_internal\__init__.py", line 64, in main cmd_name, cmd_args = parse_command(args) File "c:\users\michael\appdata\local\programs\python\pypy3\site-packages\pip\_internal\cli\main_parser.py", line 58, in parse_command parser = create_main_parser() File "c:\users\michael\appdata\local\programs\python\pypy3\site-packages\pip\_internal\cli\main_parser.py", line 28, in create_main_parser 'formatter': UpdatingDefaultsHelpFormatter(), File "c:\users\michael\appdata\local\programs\python\pypy3\site-packages\pip\_internal\cli\parser.py", line 26, in __init__ kwargs['width'] = get_terminal_size()[0] - 2 File "c:\users\michael\appdata\local\programs\python\pypy3\site-packages\pip\_internal\utils\compat.py", line 217, in get_terminal_size return tuple(shutil.get_terminal_size()) File "c:\users\michael\appdata\local\programs\python\pypy3\lib-python\3\shutil.py", line 1078, in get_terminal_size size = os.get_terminal_size(sys.__stdout__.fileno()) SystemError: unexpected internal exception (please report a bug): ; internal traceback was dumped to stderr ---------------------------------------- Command "c:\users\michael\appdata\local\programs\python\pypy3\pypy3.exe -m pip install --ignore-installed --no-user --prefix C:\Users\Michael\AppData\Local\Temp\pip-build-env-jkco8raq --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=18.5 wheel "cffi>=1.7,!=1.11.3; python_implementation != 'PyPy'"" failed with error code 1 in None ``` From issues-reply at bitbucket.org Wed Dec 12 12:12:10 2018 From: issues-reply at bitbucket.org (Omer Katz) Date: Wed, 12 Dec 2018 17:12:10 +0000 (UTC) Subject: [pypy-issue] Issue #2932: PyPy crashes when calling Py_INCREF in tp_dealloc (pypy/pypy) Message-ID: <20181212171210.12779.72950@celery-worker-109.ash1.bb-inf.net> New issue 2932: PyPy crashes when calling Py_INCREF in tp_dealloc https://bitbucket.org/pypy/pypy/issues/2932/pypy-crashes-when-calling-py_incref-in Omer Katz: This is related to #2637. When a grpc server is destroyed we have a code path that calls Py_INCREF. See https://github.com/grpc/grpc/blob/master/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi#L99 While that's being fixed in the Cython extension itself, I was still wondering if it's possible to support this kind of behaviour since it does work on CPython. Furthermore, the error message does not pinpoint which object is being destroyed: ``` RPython traceback: File "pypy_module_pypyjit.c", line 182, in portal_12 File "pypy_interpreter_2.c", line 34215, in handle_bytecode__AccessDirect_None File "pypy_interpreter_2.c", line 47248, in dispatch_bytecode__AccessDirect_None *** Invalid usage of a dying CPython object *** cpyext, the emulation layer, detected that while it is calling an object's tp_dealloc, the C code calls back a function that tries to recreate the PyPy version of the object. Usually it means that tp_dealloc calls some general PyXxx() API. It is a dangerous and potentially buggy thing to do: even in CPython the PyXxx() function could, in theory, cause a reference to the object to be taken and stored somewhere, for an amount of time exceeding tp_dealloc itself. Afterwards, the object will be freed, making that reference point to garbage. >>> PyPy could contain some workaround to still work if you are lucky, but it is not done so far; better fix the bug in the CPython extension. ``` It could be useful to know which type of object is destroyed to aid debugging. From issues-reply at bitbucket.org Thu Dec 20 08:31:40 2018 From: issues-reply at bitbucket.org (Ilya Dubnov) Date: Thu, 20 Dec 2018 13:31:40 +0000 (UTC) Subject: [pypy-issue] Issue #2933: pandas installation fails on pypy2 running on windows (pypy/pypy) Message-ID: <20181220133139.17886.68444@app-147.ash1.bb-inf.net> New issue 2933: pandas installation fails on pypy2 running on windows https://bitbucket.org/pypy/pypy/issues/2933/pandas-installation-fails-on-pypy2-running Ilya Dubnov: I'm trying to install pandas on pypy 2.7 (v6.0.0) running on windows for a while, I'm getting errors of the following: pandas\_libs\algos.c(117018) : error C2065: 'PyIntegerArrType_Type' : undeclared identifier pandas\_libs\algos.c(117071) : error C2065: 'PyFloatingArrType_Type' : undeclared identifier pandas\_libs\algos.c(117124) : error C2065: 'PyComplexFloatingArrType_Type' : undeclared identifier ... full output is attached. From issues-reply at bitbucket.org Sat Dec 29 07:33:03 2018 From: issues-reply at bitbucket.org (Stefano Rivera) Date: Sat, 29 Dec 2018 12:33:03 +0000 (UTC) Subject: [pypy-issue] Issue #2934: Interactive shell imports code.py from . (pypy/pypy) Message-ID: <20181229123303.40794.16465@celery-worker-108.ash1.bb-inf.net> New issue 2934: Interactive shell imports code.py from . https://bitbucket.org/pypy/pypy/issues/2934/interactive-shell-imports-codepy-from Stefano Rivera: Because of nested imports inside the the interactive console code, the import of the `code` module is done after `site.py` has put `.` early in `sys.path`. This means that if you have a `code.py` in your current directory, with e.g. some Python3 code in it, `print('a', end=' ')`, the REPL just crashes. ``` $ pypy Python 2.7.13 (6.0.0+dfsg-3+b1, Oct 10 2018, 09:33:53) [PyPy 6.0.0 with GCC 8.2.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. Traceback (most recent call last): File "/usr/lib/pypy/lib_pypy/_pypy_interact.py", line 42, in interactive_console run_multiline_interactive_console(mainmodule, future_flags=future_flags) File "/usr/lib/pypy/lib_pypy/pyrepl/simple_interact.py", line 47, in run_multiline_interactive_console import code File "code.py", line 1 print('a', end='bar') ^ SyntaxError: invalid syntax (expected ')') ```