From Joshua at bitbucket.org Mon May 6 17:10:19 2019 From: Joshua at bitbucket.org (Joshua at bitbucket.org) Date: Mon, 06 May 2019 21:10:19 +0000 (UTC) Subject: [pypy-issue] Issue #3012: io.IncrementalNewlineDecoder.newlines behaves differently than CPython's (pypy/pypy) Message-ID: <20190506211018.7981.83543@app-137.ash1.bb-inf.net> New issue 3012: io.IncrementalNewlineDecoder.newlines behaves differently than CPython's https://bitbucket.org/pypy/pypy/issues/3012/ioincrementalnewlinedecodernewlines Joshua Oreman: When io.IncrementalNewlineDecoder in translate mode is fed input one character at a time, it does correctly translate ?\\r\\n? sequences to ?\\n?, but does not record ?\\r\\n? in its newlines attribute \(which I understand is intended to represent the newline sequences that were encountered in the input\). Reproducer: ``` import io import codecs info = codecs.lookup("utf-8") inner_decoder = info.incrementaldecoder("strict") outer_decoder = io.IncrementalNewlineDecoder(inner_decoder, True) msg = b"The quick brown fox jumps over the lazy dog.\r\n\n\r\r\n\n" decoded = "" for ch in msg: decoded += outer_decoder.decode(bytes([ch])) decoded += outer_decoder.decode(b"", final=True) assert decoded == "The quick brown fox jumps over the lazy dog.\n\n\n\n\n" assert set(outer_decoder.newlines) == {"\r", "\n", "\r\n"} ``` This passes on CPython but fails on PyPy-3.6 v7.1.1: on the last line, outer\_decoder.newlines contains ?\\r? and ?\\n? but not ?\\r\\n?. There is no issue in non-translating mode; the newlines property does wind up containing all three sequences in that case. From Milton at bitbucket.org Mon May 6 21:56:18 2019 From: Milton at bitbucket.org (Milton at bitbucket.org) Date: Tue, 07 May 2019 01:56:18 +0000 (UTC) Subject: [pypy-issue] Issue #3013: os.rename crashes rpython when you pass in a byte string filename (pypy/pypy) Message-ID: <20190507015618.21113.93232@app-137.ash1.bb-inf.net> New issue 3013: os.rename crashes rpython when you pass in a byte string filename https://bitbucket.org/pypy/pypy/issues/3013/osrename-crashes-rpython-when-you-pass-in Milton Thomas: To reproduce: ``` import os os.rename( bytes("a", "utf8"), bytes("b", "utf8")) ``` result: ``` RPython traceback: File "implement_8.c", line 402, in BuiltinActivation_UwS_ObjSpace_W_Root_W_Root_kwo_3 File "pypy_module_posix.c", line 18574, in dispatch__star_0_2 Fatal RPython error: AssertionError ``` Discovered this because a library in the wild opened a file in read-binary mode and pulled the file path out as bytes. Works in CPython 3.7.3. OS is Windows 10, PyPy version is PyPy3.6 7.1.1. From Jason at bitbucket.org Tue May 14 18:32:47 2019 From: Jason at bitbucket.org (Jason at bitbucket.org) Date: Tue, 14 May 2019 22:32:47 +0000 (UTC) Subject: [pypy-issue] Issue #3014: JIT Issue inlining `struct.unpack(' New issue 3014: JIT Issue inlining `struct.unpack(' 274639514178723874 {'field_count': 0, 'affected_rows': 0, 'insert_id': 0, 'status_flag': 3480, 'warning_count': 0, 'info_msg': u'Records: 0 Duplicates: 0 Warnings: 0'} bytearray(b'.\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00&Records: 0 Duplicates: 0 Warnings: 0') Unpacks to: (46, 256) ``` You can see that protocol.py's `parse_ok` method gets a `status_flag` of `3480`, while performing the same unpacking on the same data in this function gets a value of `46` \(which is what CPython gets too\). \*\*Running with `--jit off` solves the problem and lets the tests complete successfully. Also, just running with `--jit inlining=0` solves the problem too.\*\* How can I help with this? I imagine you?ll want a JIT log of some sort? From dholth at bitbucket.org Fri May 17 10:01:31 2019 From: dholth at bitbucket.org (dholth at bitbucket.org) Date: Fri, 17 May 2019 14:01:31 +0000 (UTC) Subject: [pypy-issue] Issue #3015: black crashes on pypy 7 with 'PosixPath' does not support the buffer interface (pypy/pypy) Message-ID: <20190517140131.9750.9619@celery-worker-112.ash1.bb-inf.net> New issue 3015: black crashes on pypy 7 with 'PosixPath' does not support the buffer interface https://bitbucket.org/pypy/pypy/issues/3015/black-crashes-on-pypy-7-with-posixpath Daniel Holth: [https://github.com/python/black/issues/780](https://github.com/python/black/issues/780) black complains when running under pypy 7 but seems to work anyway. The error is `error: cannot format x.py: 'PosixPath' does not support the buffer interface` From piotrjurkiewicz at bitbucket.org Sat May 18 17:05:17 2019 From: piotrjurkiewicz at bitbucket.org (piotrjurkiewicz at bitbucket.org) Date: Sat, 18 May 2019 21:05:17 +0000 (UTC) Subject: [pypy-issue] Issue #3016: AttributeError: 'memoryview' object has no attribute 'obj' (pypy/pypy) Message-ID: <20190518210517.38549.98481@celery-worker-108.ash1.bb-inf.net> New issue 3016: AttributeError: 'memoryview' object has no attribute 'obj' https://bitbucket.org/pypy/pypy/issues/3016/attributeerror-memoryview-object-has-no Piotr Jurkiewicz: Apparently there is no attribute `obj` in `memoryview`, which points to the underlying object of the `memoryview`. ``` Traceback (most recent call last): File "/usr/lib/pypy3/lib-python/3/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib/pypy3/lib-python/3/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/jurkiew/flow_stats/flow_stats/convert.py", line 50, in File "/home/jurkiew/flow_stats/flow_stats/convert.py", line 46, in main File "/home/jurkiew/flow_stats/flow_stats/convert.py", line 26, in convert for flow in reader(file): File "/home/jurkiew/flow_stats/flow_stats/lib/io.py", line 158, in read_arrays obj = mv.obj AttributeError: 'memoryview' object has no attribute 'obj' ``` From JanB42 at bitbucket.org Wed May 22 08:54:45 2019 From: JanB42 at bitbucket.org (JanB42 at bitbucket.org) Date: Wed, 22 May 2019 12:54:45 +0000 (UTC) Subject: [pypy-issue] Issue #3017: PyPy3.6 v7.1.1 Datetime Module ValueError: Invalid argument (pypy/pypy) Message-ID: <20190522125445.37571.46402@celery-worker-110.ash1.bb-inf.net> New issue 3017: PyPy3.6 v7.1.1 Datetime Module ValueError: Invalid argument https://bitbucket.org/pypy/pypy/issues/3017/pypy36-v711-datetime-module-valueerror JanB: I used PyPy3.5 v7.0 together with the openpyxl module and it worked fine. After switching to PyPy3.6 v7.1.1 I get the attached ValueError with the last three lines pointing to the Python3 Datetime module. I am rather unexperienced, is this an PyPy issue or does it have something to do with the openpyxl module? From Jan at bitbucket.org Sun May 26 00:06:44 2019 From: Jan at bitbucket.org (Jan at bitbucket.org) Date: Sun, 26 May 2019 04:06:44 +0000 (UTC) Subject: [pypy-issue] Issue #3018: numpy.array_equal behaves differently from python3 when comparing ctype types (pypy/pypy) Message-ID: <20190526040644.1526.83438@app-137.ash1.bb-inf.net> New issue 3018: numpy.array_equal behaves differently from python3 when comparing ctype types https://bitbucket.org/pypy/pypy/issues/3018/numpyarray_equal-behaves-differently-from Jan Vesely: ```python Python 3.6.1 (784b254d669919c872a505b807db8462b6140973, Apr 21 2019, 14:47:54) [PyPy 7.1.1-beta0 with GCC 8.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``PyPy is vast, and contains multitudes'' >>>> import ctypes >>>> import numpy >>>> a = ctypes.c_int(1) >>>> numpy.array_equal(a, True) False >>>> numpy.array_equal(a, 1) False ``` vs. ``` Python 3.6.5 (default, Feb 24 2019, 17:47:37) [GCC 8.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import numpy >>> import ctypes >>> a = ctypes.c_int(1) >>> numpy.array_equal(a, 1) True >>> numpy.array_equal(a, True) True ``` Both instances are running numpy-1.15.4 From Andrew at bitbucket.org Sun May 26 14:13:26 2019 From: Andrew at bitbucket.org (Andrew at bitbucket.org) Date: Sun, 26 May 2019 18:13:26 +0000 (UTC) Subject: [pypy-issue] Issue #3020: Error Code Handling in Multiprocessing Tests (pypy/pypy) Message-ID: <20190526181325.17663.71238@celery-worker-112.ash1.bb-inf.net> New issue 3020: Error Code Handling in Multiprocessing Tests https://bitbucket.org/pypy/pypy/issues/3020/error-code-handling-in-multiprocessing Andrew Lawrence: There is some behavior of error codes that I cannot explain in test\_multiprocessing\_spawn.py. When running the tests lib-python\\3\\test\\test\_multiprocessing\_spawn.py WithManagerTestLock.test\_lock WithProcessesTestBarrier.test\_barrier on Windows the error code leaks from test\_lock into test\_barrier causing test\_barrier to fail. In CPython the error codes do not leak between the tests like this. ? I have also noticed that doing p \_winapi.GetLastError\(\) from pdb inside WithProcessesTestBarrier.test\_barrier in CPython produces the error code from the previous test but print\(\_winapi.GetLastError\(\)\) in the test itself does not result in the error. Also inserting the following code into \_test\_multiprocessing.py results in different behaviour on both CPython and windows when running test\_multiprocessing\_spawn.py WithManagerTestLock.test\_lock ``` class ManagerMixin(object): def tearDownClass(cls): import ctypes ctypes.windll.kernel32.SetLastError(996) print(_winapi.GetLastError()) print(ctypes.windll.kernel32.GetLastError()) ``` The final print statement produces 0 in CPython and 996 in PyPy