From issues-reply at bitbucket.org Fri Jan 2 00:48:41 2015 From: issues-reply at bitbucket.org (Anthony Sottile) Date: Thu, 01 Jan 2015 23:48:41 -0000 Subject: [pypy-issue] Issue #1952: pypy3 2.4.0 incorrect tokenization of unicode literal (pypy/pypy) Message-ID: <20150101234841.6537.41438@app01.ash-private.bitbucket.org> New issue 1952: pypy3 2.4.0 incorrect tokenization of unicode literal https://bitbucket.org/pypy/pypy/issue/1952/pypy3-240-incorrect-tokenization-of Anthony Sottile: Simple testcase: ``` # -*- coding: UTF-8 -*- from __future__ import unicode_literals import io import tokenize test = '# -*- coding: UTF-8 -*-\nu"""???"""' for ( token_type, token_str, _, _, _ ) in tokenize.generate_tokens(io.StringIO(test).readline): print('{0} - {1!r}'.format(tokenize.tok_name[token_type], token_str)) ``` Output under pypy3 (2.4.0): ``` $ pypy3 --version Python 3.2.5 (b2091e973da6, Oct 19 2014, 18:29:55) [PyPy 2.4.0 with GCC 4.6.3] $ pypy3 test.py COMMENT - '# -*- coding: UTF-8 -*-' NL - '\n' NAME - 'u' STRING - '"""???"""' ENDMARKER - '' ``` Output under CPython3.3 (3.3.6) / CPython3.4 (3.4.0): ``` $ python3.3 test.py COMMENT - '# -*- coding: UTF-8 -*-' NL - '\n' STRING - 'u"""???"""' ENDMARKER - '' ``` Note that this does match the output under CPython3.2, but seems wrong as pypy3 supports unicode prefix literals From issues-reply at bitbucket.org Fri Jan 2 21:20:09 2015 From: issues-reply at bitbucket.org (Simon B.) Date: Fri, 02 Jan 2015 20:20:09 -0000 Subject: [pypy-issue] Issue #1953: PyPy3 2.4.0 - IDLE (pypy/pypy) Message-ID: <20150102202009.20748.58236@app01.ash-private.bitbucket.org> New issue 1953: PyPy3 2.4.0 - IDLE https://bitbucket.org/pypy/pypy/issue/1953/pypy3-240-idle Simon B.: # Using IDLE with PyPy3 2.4.0 # When typing in IDLE under PyPy3 (2.4.0) lots of errors are shown in the console (TypeError: String does not support the buffer interface) , after pressing enter, the program hangs forever. To fix: change line 442 in lib_pypy/_tkinter/app.py from if '\x00' in s: to if b'\x00' in s: From issues-reply at bitbucket.org Tue Jan 6 00:59:18 2015 From: issues-reply at bitbucket.org (Angus Griffith) Date: Mon, 05 Jan 2015 23:59:18 -0000 Subject: [pypy-issue] Issue #1954: ExternalCompilationInfo fails to translate (pypy/pypy) Message-ID: <20150105235918.12899.61326@app10.ash-private.bitbucket.org> New issue 1954: ExternalCompilationInfo fails to translate https://bitbucket.org/pypy/pypy/issue/1954/externalcompilationinfo-fails-to-translate Angus Griffith: I can't get a simple rffi example to translate on my system. Whenever I create an ExternalCompilationInfo instance the translation fails with ``` text [translation:ERROR] Exception: A function calling locals() is not RPython. Note that if you're translating code outside the PyPy repository, a likely cause is that py.test's --assert=rewrite mode is getting in the way. You should copy the file pytest.ini from the root of the PyPy repository into your own project. ``` I've copied pytest.ini but it doesn't change anything. I've attached a minimal example that reproduces the error on my system and the full output when trying to translate it. System info: * `Linux desktop 3.17.6-1-ARCH #1 SMP PREEMPT Sun Dec 7 23:43:32 UTC 2014 x86_64 GNU/Linux` * PyPy-2.4.0 * CPython 2.7.9-1 From issues-reply at bitbucket.org Wed Jan 7 16:51:21 2015 From: issues-reply at bitbucket.org (Stuart Axon) Date: Wed, 07 Jan 2015 15:51:21 -0000 Subject: [pypy-issue] Issue #1955: Segfault on running program (pypy/pypy) Message-ID: <20150107155121.25950.15460@app11.ash-private.bitbucket.org> New issue 1955: Segfault on running program https://bitbucket.org/pypy/pypy/issue/1955/segfault-on-running-program Stuart Axon: I'm running pypy 2.4.0 on Ubuntu Utopic. Running the pypy works OK (though it outputs 'trusty' weirdly): $ ?pypy Python 2.7.8 (2.4.0+dfsg-1~ppa2+trusty, Sep 25 2014, 04:35:04) [PyPy 2.4.0 with GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>> Running my program in it gives a segfault: $ ?sbot Segmentation fault If I run in CPython then things are OK $ ?sbot usage: usage: sbot [options] inputfile.bot [args] [-h] [-o FILE] [-w] [-f] [-t TITLE] [-s] [-dv] [-p SERVERPORT] [-r REPEAT] [-g GRAMMAR] [-c] [-v VARS] script [script_args] usage: sbot [options] inputfile.bot [args]: error: too few arguments I got this out of gdb: gdb -ex r --args `which pypy` `which sbot` GNU gdb (Ubuntu 7.8-1ubuntu4) 7.8.0.20141001-cvs Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /mnt/data/home/stu/.virtualenvs/shoebot-pgi-pypy/bin/pypy...(no debugging symbols found)...done. Starting program: /mnt/data/home/stu/.virtualenvs/shoebot-pgi-pypy/bin/pypy /mnt/data/home/stu/.virtualenvs/shoebot-pgi-pypy/bin/sbot [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x00007fffecdb686e in std::_Rb_tree >, std::_Select1st > >, std::less, std::allocator > > >::_M_get_insert_unique_pos(std::string const&) () from /usr/lib/x86_64-linux-gnu/libprotobuf.so.8 (gdb) Running bt to get the full stacktrace: #0 0x00007fffecdb686e in std::_Rb_tree >, std::_Select1st > >, std::less, std::allocator > > >::_M_get_insert_unique_pos(std::string const&) () from /usr/lib/x86_64-linux-gnu/libprotobuf.so.8 #1 0x00007fffecdb6ad1 in std::_Rb_tree >, std::_Select1st > >, std::less, std::allocator > > >::_M_insert_unique(std::pair > const&) () from /usr/lib/x86_64-linux-gnu/libprotobuf.so.8 #2 0x00007fffecdb7864 in google::protobuf::SimpleDescriptorDatabase::DescriptorIndex >::AddFile(google::protobuf::FileDescriptorProto const&, std::pair) () from /usr/lib/x86_64-linux-gnu/libprotobuf.so.8 #3 0x00007fffecdb410b in google::protobuf::EncodedDescriptorDatabase::Add(void const*, int) () from /usr/lib/x86_64-linux-gnu/libprotobuf.so.8 #4 0x00007fffecd7b40a in google::protobuf::DescriptorPool::InternalAddGeneratedFile(void const*, int) () from /usr/lib/x86_64-linux-gnu/libprotobuf.so.8 #5 0x00007fffed24da62 in mir::protobuf::wire::protobuf_AddDesc_mir_5fprotobuf_5fwire_2eproto() () from /usr/lib/x86_64-linux-gnu/libmircommon.so.2 #6 0x00007ffff7dea13a in call_init (l=, argc=argc at entry=2, argv=argv at entry=0x7fffffffdbf8, env=env at entry=0x7fffffffdc10) at dl-init.c:78 #7 0x00007ffff7dea223 in call_init (env=, argv=, argc=, l=) at dl-init.c:36 #8 _dl_init (main_map=main_map at entry=0x307cf20, argc=2, argv=0x7fffffffdbf8, env=0x7fffffffdc10) at dl-init.c:126 #9 0x00007ffff7deec6e in dl_open_worker (a=a at entry=0x7fffffff9938) at dl-open.c:577 #10 0x00007ffff7de9ff4 in _dl_catch_error (objname=objname at entry=0x7fffffff9928, errstring=errstring at entry=0x7fffffff9930, mallocedp=mallocedp at entry=0x7fffffff9920, operate=operate at entry=0x7ffff7dee990 , args=args at entry=0x7fffffff9938) at dl-error.c:187 #11 0x00007ffff7dee3ab in _dl_open (file=0x40db880 "libgtk-3.so.0", mode=-2147483391, caller_dlopen=, nsid=-2, argc=2, argv=0x7fffffffdbf8, env=0x7fffffffdc10) at dl-open.c:661 #12 0x00007ffff7bd702b in dlopen_doit (a=a at entry=0x7fffffff9b50) at dlopen.c:66 #13 0x00007ffff7de9ff4 in _dl_catch_error (objname=0x335eec0, errstring=0x335eec8, mallocedp=0x335eeb8, operate=0x7ffff7bd6fd0 , args=0x7fffffff9b50) at dl-error.c:187 #14 0x00007ffff7bd762d in _dlerror_run ( operate=operate at entry=0x7ffff7bd6fd0 , args=args at entry=0x7fffffff9b50) at dlerror.c:163 #15 0x00007ffff7bd70c1 in __dlopen (file=, mode=) at dlopen.c:87 #16 0x00007ffff25d2942 in g_module_open () from /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 #17 0x00007ffff27e8775 in g_typelib_symbol () from /usr/lib/libgirepository-1.0.so.1 #18 0x00007ffff27e2af7 in g_registered_type_info_get_g_type () from /usr/lib/libgirepository-1.0.so.1 #19 0x00007ffff6e72afe in ffi_call_unix64 () from /usr/lib/x86_64-linux-gnu/libffi.so.6 #20 0x00007ffff6e72568 in ffi_call () from /usr/lib/x86_64-linux-gnu/libffi.so.6 #21 0x000000000050bc97 in ?? () #22 0x000000000129dee2 in ?? () #23 0x00000000010e2b3c in ?? () #24 0x00000000010e4f48 in ?? () #25 0x0000000000844886 in ?? () #26 0x0000000000841d8b in ?? () #27 0x0000000000711ae6 in ?? () #28 0x0000000000bd6cbe in ?? () #29 0x00000000007325db in ?? () #30 0x000000000073ca98 in ?? () #31 0x000000000073f275 in ?? () #32 0x0000000000b98bce in ?? () #33 0x0000000000fd88a1 in ?? () #34 0x0000000000517354 in ?? () #35 0x0000000000e851b0 in ?? () #36 0x0000000000e858b4 in ?? () #37 0x0000000000e85dc0 in ?? () #38 0x0000000000e8b97d in ?? () #39 0x0000000000e8bcc8 in ?? () #40 0x0000000000e8c081 in ?? () #41 0x0000000000e8c9f3 in ?? () #42 0x0000000000e97ac8 in ?? () #43 0x00000000010267c4 in ?? () #44 0x0000000001026b51 in ?? () #45 0x0000000000fd87de in ?? () #46 0x000000000072605f in ?? () #47 0x000000000072647d in ?? () #48 0x0000000000bd6cbe in ?? () #49 0x00000000006ec6f5 in ?? () #50 0x000000000073295e in ?? () #51 0x000000000073c835 in ?? () #52 0x000000000073f275 in ?? () #53 0x0000000000b98bce in ?? () #54 0x0000000000fd88a1 in ?? () #55 0x000000000072605f in ?? () #56 0x000000000072647d in ?? () #57 0x0000000000bd8721 in ?? () #58 0x0000000000d0833b in ?? () #59 0x000000000073c1ad in ?? () #60 0x000000000073f275 in ?? () #61 0x0000000000b98bce in ?? () #62 0x0000000000fd88a1 in ?? () #63 0x000000000072605f in ?? () #64 0x000000000072647d in ?? () #65 0x000000000073295e in ?? () #66 0x000000000073c835 in ?? () #67 0x000000000073f275 in ?? () #68 0x0000000000b98bce in ?? () #69 0x0000000000fd88a1 in ?? () #70 0x000000000072605f in ?? () #71 0x000000000072647d in ?? () #72 0x0000000000bd80c6 in ?? () #73 0x0000000000a4bc99 in ?? () #74 0x0000000000a4d5fe in ?? () #75 0x0000000000a4ee68 in ?? () #76 0x0000000000711ae6 in ?? () #77 0x00000000007325db in ?? () #78 0x000000000073c835 in ?? () #79 0x000000000073f275 in ?? () #80 0x0000000000b98bce in ?? () #81 0x0000000000fd88a1 in ?? () #82 0x000000000072605f in ?? () #83 0x000000000072647d in ?? () #84 0x000000000073295e in ?? () #85 0x000000000073c835 in ?? () #86 0x000000000073f275 in ?? () #87 0x0000000000b98bce in ?? () #88 0x0000000000fd88a1 in ?? () #89 0x000000000072605f in ?? () #90 0x000000000072647d in ?? () #91 0x000000000073295e in ?? () #92 0x000000000073c835 in ?? () #93 0x000000000073f275 in ?? () #94 0x0000000000b98bce in ?? () #95 0x0000000000fd88a1 in ?? () #96 0x000000000072605f in ?? () #97 0x000000000072647d in ?? () #98 0x0000000000bd80c6 in ?? () #99 0x000000000078e74b in ?? () #100 0x00000000004696b9 in ?? () #101 0x0000000000711ae6 in ?? () #102 0x000000000073295e in ?? () #103 0x000000000073c835 in ?? () #104 0x000000000073f275 in ?? () #105 0x0000000000b98bce in ?? () #106 0x0000000000fd88a1 in ?? () #107 0x000000000072605f in ?? () #108 0x000000000072647d in ?? () #109 0x0000000000bd80c6 in ?? () #110 0x000000000073c1ad in ?? () #111 0x000000000073f275 in ?? () #112 0x0000000000b98bce in ?? () #113 0x0000000000fd88a1 in ?? () #114 0x000000000072605f in ?? () #115 0x000000000072647d in ?? () #116 0x0000000000a48f0b in ?? () #117 0x0000000000a49a83 in ?? () #118 0x0000000000a4c8e2 in ?? () #119 0x0000000000a4ceab in ?? () #120 0x0000000000a4d633 in ?? () #121 0x0000000000a4ee68 in ?? () #122 0x0000000000711ae6 in ?? () #123 0x00000000007325db in ?? () #124 0x000000000073c835 in ?? () #125 0x000000000073f275 in ?? () #126 0x0000000000b98bce in ?? () #127 0x0000000000fd88a1 in ?? () #128 0x000000000072605f in ?? () #129 0x000000000072647d in ?? () #130 0x0000000000bfda9e in ?? () #131 0x000000000073cdbe in ?? () #132 0x000000000073f275 in ?? () #133 0x0000000000b98bce in ?? () #134 0x0000000000fd88a1 in ?? () #135 0x000000000072605f in ?? () #136 0x000000000072647d in ?? () #137 0x00000000006dc0de in ?? () #138 0x0000000000bfce3c in ?? () #139 0x0000000000a4c8ff in ?? () #140 0x0000000000a4d236 in ?? () #141 0x0000000000a4d633 in ?? () #142 0x0000000000a4ee68 in ?? () #143 0x0000000000711ae6 in ?? () #144 0x00000000006e26b4 in ?? () #145 0x0000000000734085 in ?? () #146 0x000000000073c246 in ?? () #147 0x000000000073f275 in ?? () #148 0x0000000000b98bce in ?? () #149 0x0000000000fd88a1 in ?? () #150 0x000000000072605f in ?? () #151 0x000000000072647d in ?? () #152 0x0000000000a48f0b in ?? () #153 0x0000000000a49a83 in ?? () #154 0x0000000000a4c8e2 in ?? () #155 0x0000000000a4ceab in ?? () #156 0x0000000000a4d633 in ?? () #157 0x0000000000a4f274 in ?? () #158 0x0000000000711ae6 in ?? () #159 0x00000000006e26b4 in ?? () #160 0x0000000000734085 in ?? () #161 0x000000000073c246 in ?? () #162 0x000000000073f275 in ?? () #163 0x0000000000b98bce in ?? () #164 0x0000000000fd88a1 in ?? () #165 0x000000000072605f in ?? () #166 0x000000000072647d in ?? () #167 0x0000000000a48f0b in ?? () #168 0x0000000000a49a83 in ?? () #169 0x0000000000a49c08 in ?? () #170 0x0000000000a4c8e2 in ?? () #171 0x0000000000a4ceab in ?? () #172 0x0000000000a4d633 in ?? () #173 0x0000000000a4f274 in ?? () #174 0x0000000000711ae6 in ?? () #175 0x00000000006e26b4 in ?? () #176 0x0000000000734085 in ?? () #177 0x000000000073c246 in ?? () #178 0x000000000073f275 in ?? () #179 0x0000000000b98bce in ?? () ---Type to continue, or q to quit--- #180 0x0000000000fd88a1 in ?? () #181 0x000000000072605f in ?? () #182 0x000000000072647d in ?? () #183 0x0000000000a48f0b in ?? () #184 0x0000000000a49a83 in ?? () #185 0x0000000000a49c08 in ?? () #186 0x0000000000a4c8e2 in ?? () #187 0x0000000000a4ceab in ?? () #188 0x0000000000a4d633 in ?? () #189 0x0000000000a4f274 in ?? () #190 0x0000000000711ae6 in ?? () #191 0x00000000006e26b4 in ?? () #192 0x0000000000734085 in ?? () #193 0x000000000073c246 in ?? () #194 0x000000000073f275 in ?? () #195 0x0000000000b98bce in ?? () #196 0x0000000000fd88a1 in ?? () #197 0x000000000072605f in ?? () #198 0x000000000072647d in ?? () #199 0x0000000000733604 in ?? () #200 0x000000000073b7f6 in ?? () #201 0x000000000073f275 in ?? () #202 0x0000000000b98bce in ?? () #203 0x0000000000fd88a1 in ?? () #204 0x000000000072605f in ?? () #205 0x000000000072647d in ?? () #206 0x00000000007325db in ?? () #207 0x000000000073cb9c in ?? () #208 0x000000000073f275 in ?? () #209 0x0000000000b98bce in ?? () #210 0x0000000000fd88a1 in ?? () #211 0x000000000072605f in ?? () #212 0x000000000072647d in ?? () #213 0x00000000007325db in ?? () #214 0x000000000073ca98 in ?? () #215 0x000000000073f275 in ?? () #216 0x0000000000b98bce in ?? () #217 0x0000000000fd88a1 in ?? () #218 0x000000000072605f in ?? () #219 0x000000000072647d in ?? () #220 0x00000000007325db in ?? () #221 0x000000000073cb15 in ?? () ---Type to continue, or q to quit--- #222 0x000000000073f275 in ?? () #223 0x0000000000b98bce in ?? () #224 0x0000000000fd88a1 in ?? () #225 0x000000000072605f in ?? () #226 0x000000000072647d in ?? () #227 0x00000000006dc0de in ?? () #228 0x00000000006505e5 in ?? () #229 0x0000000001297aa5 in ?? () #230 0x00007ffff5c05ec5 in __libc_start_main (main=0x413710, argc=2, argv=0x7fffffffdbf8, init=, fini=, rtld_fini=, stack_end=0x7fffffffdbe8) at libc-start.c:287 #231 0x000000000041373e in ?? () From issues-reply at bitbucket.org Thu Jan 8 19:29:59 2015 From: issues-reply at bitbucket.org (Claire Charron) Date: Thu, 08 Jan 2015 18:29:59 -0000 Subject: [pypy-issue] Issue #1956: clock() has odd timing (pypy/pypy) Message-ID: <20150108182959.17769.59266@app13.ash-private.bitbucket.org> New issue 1956: clock() has odd timing https://bitbucket.org/pypy/pypy/issue/1956/clock-has-odd-timing Claire Charron: cross-post from Stack Overflow: https://stackoverflow.com/questions/27829225/why-is-pypys-clock-so-imprecise See the following code: ``` from time import clock from random import randint times = [] for _ in range(10): start = clock() sum(i * i for i in range(randint(1000000, 2000000))) # waste time end = clock() times.append(int((end - start) * 1000000)) for t in times: print(t, "?s") ``` If you run it, you'll notice that clock() is only accurate to about 1/30th of a second. This isn't sufficient for any kind of timing. From issues-reply at bitbucket.org Thu Jan 8 22:15:48 2015 From: issues-reply at bitbucket.org (Benjamen Keroack) Date: Thu, 08 Jan 2015 21:15:48 -0000 Subject: [pypy-issue] Issue #1957: PyPy3: TypeError: Incorrect exception message (pypy/pypy) Message-ID: <20150108211548.3414.49863@app08.ash-private.bitbucket.org> New issue 1957: PyPy3: TypeError: Incorrect exception message https://bitbucket.org/pypy/pypy/issue/1957/pypy3-typeerror-incorrect-exception Benjamen Keroack: Given the following test code: ``` #!python def pxn_qxn(*, p, q, **kwargs): return p + q pxn_qxn(p = 1) ``` CPython 3.4.2 produces the following error: ``` #!bash TypeError: pxn_qxn() missing 1 required keyword-only argument: 'q' ``` PyPy3 2.4.0 produces the following incorrect error string: ``` #!bash TypeError: pxn_qxn() takes no arguments (1 given) ``` This is incorrect (the function takes arguments). From issues-reply at bitbucket.org Fri Jan 9 00:09:15 2015 From: issues-reply at bitbucket.org (Benjamen Keroack) Date: Thu, 08 Jan 2015 23:09:15 -0000 Subject: [pypy-issue] Issue #1958: Documentation: Installing PyPy: pip instructions incorrect (pypy/pypy) Message-ID: <20150108230915.26782.20730@app08.ash-private.bitbucket.org> New issue 1958: Documentation: Installing PyPy: pip instructions incorrect https://bitbucket.org/pypy/pypy/issue/1958/documentation-installing-pypy-pip Benjamen Keroack: The instructions on how to manually install pip here is incorrect: http://pypy.readthedocs.org/en/latest/install.html#installing-pypy http://python-distribute.org/distribute_setup.py is a dead link (python-distribute.org now is squatted and appears to host malware) It should be replaced with the following: - Download and execute: https://bootstrap.pypa.io/ez_setup.py The following link still works so it can stay: https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py I consider this a pretty serious documentation bug since currently the only way to get PyPy3 pip installed on Ubuntu 14.04 is to do so manually. The current docs resulted in quite a bit of frustration for me. From issues-reply at bitbucket.org Sat Jan 10 17:45:22 2015 From: issues-reply at bitbucket.org (Ionel Maries Cristian) Date: Sat, 10 Jan 2015 16:45:22 -0000 Subject: [pypy-issue] Issue #1959: Zipimport issue: unorderable types: str <= int (pypy/pypy) Message-ID: <20150110164522.18489.52338@app06.ash-private.bitbucket.org> New issue 1959: Zipimport issue: unorderable types: str <= int https://bitbucket.org/pypy/pypy/issue/1959/zipimport-issue-unorderable-types-str-int Ionel Maries Cristian: ``` Traceback (most recent call last): File "", line 1, in File "pip/__init__.py", line 13, in from pip.utils import get_installed_distributions, get_prog File "pip/utils/__init__.py", line 14, in import zipfile File "/home/ionel/pypy3-2.4.0-linux64/lib-python/3/zipfile.py", line 60, in sizeEndCentDir = struct.calcsize(structEndArchive) File "/home/ionel/pypy3-2.4.0-linux64/lib_pypy/_struct.py", line 294, in calcsize num,i = getNum(fmt,i) File "/home/ionel/pypy3-2.4.0-linux64/lib_pypy/_struct.py", line 276, in getNum while ('0'<= cur ) and ( cur <= '9'): TypeError: unorderable types: str <= int ``` Could the zip be broken?! This is the zip: https://pypi.python.org/packages/py2.py3/p/pip/pip-6.0.6-py2.py3-none-any.whl From issues-reply at bitbucket.org Sat Jan 10 19:45:34 2015 From: issues-reply at bitbucket.org (Jim Witschey) Date: Sat, 10 Jan 2015 18:45:34 -0000 Subject: [pypy-issue] Issue #1960: print_function behavior different from CPython on file=None (pypy/pypy) Message-ID: <20150110184534.2985.19450@app11.ash-private.bitbucket.org> New issue 1960: print_function behavior different from CPython on file=None https://bitbucket.org/pypy/pypy/issue/1960/print_function-behavior-different-from Jim Witschey: The [documentation for the `print` function](https://docs.python.org/3/library/functions.html?highlight=print#print) states: > The `file` argument must be an object with a write(string) method; if it is not present or None, sys.stdout will be used. In CPython, this behavior holds: ``` bash $ python2.7 -c "from __future__ import print_function ; print('test', file=None)" test ``` but it does not in PyPy: ``` bash $ pypy -c "from __future__ import print_function ; print('test', file=None)" ``` (It's hard to show the absence of something -- note that this doesn't print anything.) This behavior is implemented correctly in pypy3: ``` bash $ pypy3 -c "print('test', file=None)" test ``` Version information: ``` bash $ pypy --version Python 2.7.8 (a980ebb26592ed26706cd33a4e05eb45b5d3ea09, Oct 21 2014, 20:15:33) [PyPy 2.4.0 with GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] $ python2.7 --version Python 2.7.9 ``` From issues-reply at bitbucket.org Wed Jan 14 12:09:48 2015 From: issues-reply at bitbucket.org (Armin Rigo) Date: Wed, 14 Jan 2015 11:09:48 -0000 Subject: [pypy-issue] Issue #1961: Fix errno handling (pypy/pypy) Message-ID: <20150114110948.8513.63877@app11.ash-private.bitbucket.org> New issue 1961: Fix errno handling https://bitbucket.org/pypy/pypy/issue/1961/fix-errno-handling Armin Rigo: The handling of errno (and GetLastError on Windows) is fragile. There are cases that can go wrong. For example, cffi's getwinerror() on Windows tends to return 0 instead of the real error when the code in question happens to be traced. The issue is that in this case, a lot more occurs, and the LastError is overwritten with the value of some unrelated function call from the tracing. But the same problem can occur anywhere: a major GC for example could trigger it. Instead, we should have a way to save the errno/LastError around a particular function call, which would work at a very low level --- in the section of code that is not protected by the GIL. It would either use some RPython global (thread-local) location, or maybe better, work with an explicitly-provided pointer to a structure containing the saved value(s). Responsible: arigo From issues-reply at bitbucket.org Fri Jan 16 21:06:20 2015 From: issues-reply at bitbucket.org (Ben Longbons) Date: Fri, 16 Jan 2015 20:06:20 -0000 Subject: [pypy-issue] Issue #1962: default encoding for cpython2 is ascii since 2.5, not latin1 anymore (pypy/pypy) Message-ID: <20150116200620.22016.95291@app12.ash-private.bitbucket.org> New issue 1962: default encoding for cpython2 is ascii since 2.5, not latin1 anymore https://bitbucket.org/pypy/pypy/issue/1962/default-encoding-for-cpython2-is-ascii Ben Longbons: The following code: ``` #!python print u'?' ``` Under pypy 2.4.0 produces ouput: `??` Under cpython 2.7 fails with: `SyntaxError: Non-ASCII character '\xc3' in file enc.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details` What the user most likely wanted was to add `# coding: utf-8` The relevant section is: ``` Phases Implementation of steps 1 and 2 above were completed in 2.3, except for changing the default encoding to "ascii". The default encoding was set to "ascii" in version 2.5. ``` From issues-reply at bitbucket.org Sat Jan 17 00:44:54 2015 From: issues-reply at bitbucket.org (Dave Watola) Date: Fri, 16 Jan 2015 23:44:54 -0000 Subject: [pypy-issue] Issue #1963: Assertion failure in OptimizingVisitor.visit_Name (pypy/pypy) Message-ID: <20150116234454.27283.17186@app04.ash-private.bitbucket.org> New issue 1963: Assertion failure in OptimizingVisitor.visit_Name https://bitbucket.org/pypy/pypy/issue/1963/assertion-failure-in Dave Watola: Using version 2.4 of pypy, the very simple test case attached crashes with ``` #! RPython traceback: File "pypy_interpreter_pycompiler.c", line 1567, in PythonAstCompiler__compile_ast File "pypy_interpreter_astcompiler_ast_1.c", line 20718, in Module_mutate_over File "pypy_interpreter_astcompiler_ast_2.c", line 10177, in ASTVisitor__mutate_sequence File "pypy_interpreter_astcompiler_ast_1.c", line 45287, in Assign_mutate_over File "pypy_interpreter_astcompiler_ast_2.c", line 10177, in ASTVisitor__mutate_sequence File "pypy_interpreter_astcompiler_ast_1.c", line 53781, in List_mutate_over File "pypy_interpreter_astcompiler_ast_2.c", line 10177, in ASTVisitor__mutate_sequence File "pypy_interpreter_astcompiler_optimize.c", line 252, in OptimizingVisitor_visit_Name Fatal RPython error: AssertionError Abort (core dumped) ``` This test case uses macropy, which adjusts AST representation using an import hook. The crash occurs during compilation -- there is no runtime code in this case. Aside from this issue, macropy seems to work correctly with pypy. All seems well with the proposed fix below. It is not clear what is triggering this optimization, because the original and final ASTs involved do not use "None", I was able to eliminate the problem by editing OptimizingVisitor.visit_Name in pypy/interpreter/astcompiler/optimize.py and changing the guard condition on the "if" statement to include the assertion condition would provide a correct solution. i.e. ``` #!python if name.id=="None" and name.ctx ==ast.Load ``` (and then eliminate the assertion). This appears to be a safe and correct change, but I have no familiarity with the pypy code base and thought that someone else should evaluate the situation. From issues-reply at bitbucket.org Sat Jan 17 12:30:39 2015 From: issues-reply at bitbucket.org (Christoph Reiter) Date: Sat, 17 Jan 2015 11:30:39 -0000 Subject: [pypy-issue] Issue #1964: pypy3: bytes() prefers __int__ over __bytes__ (pypy/pypy) Message-ID: <20150117113039.25753.87711@app11.ash-private.bitbucket.org> New issue 1964: pypy3: bytes() prefers __int__ over __bytes__ https://bitbucket.org/pypy/pypy/issue/1964/pypy3-bytes-prefers-__int__-over-__bytes__ Christoph Reiter: ``` #!python class Foo(object): def __int__(self): return 0 def __bytes__(self): return str(0).encode("utf-8") assert bytes(Foo()) == b"0" # returns b"" on pypy3 ``` From issues-reply at bitbucket.org Tue Jan 20 04:59:42 2015 From: issues-reply at bitbucket.org (Mike Kaplinskiy) Date: Tue, 20 Jan 2015 03:59:42 -0000 Subject: [pypy-issue] Issue #1965: Greenlets on OSX Yosemite segfault (pypy/pypy) Message-ID: <20150120035942.25003.76329@app06.ash-private.bitbucket.org> New issue 1965: Greenlets on OSX Yosemite segfault https://bitbucket.org/pypy/pypy/issue/1965/greenlets-on-osx-yosemite-segfault Mike Kaplinskiy: Looks like it's heap corruption. Something as simple as: ``` #!python from greenlet import greenlet, getcurrent def switch_back(): getcurrent().parent.switch() i = 0 while True: greenlet(switch_back).switch() if i % 100 == 0: print i i += 1 ``` GDB says the crash happens at malloc, which seems to be heap corruption. ``` #0 0x00007fff8526cffa in szone_malloc_should_clear () from /usr/lib/system/libsystem_malloc.dylib #1 0x00007fff8526c877 in malloc_zone_malloc () from /usr/lib/system/libsystem_malloc.dylib #2 0x00007fff8526b395 in malloc () from /usr/lib/system/libsystem_malloc.dylib #3 0x00000001010d7555 in g_save_state () from /Users/mkaplinskiy/pypy-hg/libpypy-c.dylib #4 0x00000001010d746e in slp_switch () from /Users/mkaplinskiy/pypy-hg/libpypy-c.dylib #5 0x0000000100000000 in ?? () #6 0x00000001054131c0 in ?? () #7 0x00000000ffffffff in ?? () #8 0x000000010495bd30 in ?? () #9 0x0000000103f41570 in ?? () #10 0x0000000100204970 in pypy_g_BuiltinActivation_UwS_W_Continulet__run () from /Users/mkaplinskiy/pypy-hg/libpypy-c.dylib #11 0x00000001010d7518 in stacklet_switch () from /Users/mkaplinskiy/pypy-hg/libpypy-c.dylib ... ``` From issues-reply at bitbucket.org Mon Jan 26 17:44:20 2015 From: issues-reply at bitbucket.org (JakobKrainz) Date: Mon, 26 Jan 2015 16:44:20 -0000 Subject: [pypy-issue] Issue #1966: When run in a chroot, pypy will sometimes fail to import builtin modules (pypy/pypy) Message-ID: <20150126164420.3749.98041@app11.ash-private.bitbucket.org> New issue 1966: When run in a chroot, pypy will sometimes fail to import builtin modules https://bitbucket.org/pypy/pypy/issue/1966/when-run-in-a-chroot-pypy-will-sometimes JakobKrainz: When running in a chroot where $HOME is not set and /etc/passwd does not contain an entry for the current UID, pypy 2.4.0 will fail to import some builtin modules. More precisely, the script ``` #!python a = raw_input() b = raw_input() n = a.count("x") for x in range(n + 4): if eval(a, dict(x=x)) != eval(b, dict(x=x)): print "NOT EQUIVALENT" exit() print "EQUIVALENT" ``` will produce the following output: ``` 'import site' failed Traceback (most recent call last): File "app_main.py", line 75, in run_toplevel File "K.py", line 9, in exit() NameError: global name 'exit' is not defined ``` Adding the current user to /etc/passwd or setting $HOME fixes this. From issues-reply at bitbucket.org Wed Jan 28 08:21:07 2015 From: issues-reply at bitbucket.org (Andrey Churin) Date: Wed, 28 Jan 2015 07:21:07 -0000 Subject: [pypy-issue] Issue #1967: python property support in RPython (pypy/pypy) Message-ID: <20150128072107.25774.14063@app12.ash-private.bitbucket.org> New issue 1967: python property support in RPython https://bitbucket.org/pypy/pypy/issue/1967/python-property-support-in-rpython Andrey Churin: Hi! I've implemented property support for rpython. Maybe you will be interested.