From issues-reply at bitbucket.org Tue Jun 2 10:37:15 2015 From: issues-reply at bitbucket.org (Christian Clauss) Date: Tue, 02 Jun 2015 08:37:15 -0000 Subject: [pypy-issue] Issue #2055: Website main page says Python 2.7.8 but since pypy 2.5.1 it should say Python 2.7.9 (pypy/pypy) Message-ID: <20150602083715.21848.19354@app10.ash-private.bitbucket.org> New issue 2055: Website main page says Python 2.7.8 but since pypy 2.5.1 it should say Python 2.7.9 https://bitbucket.org/pypy/pypy/issue/2055/website-main-page-says-python-278-but Christian Clauss: http://pypy.org says Python 2.7.8 but http://morepypy.blogspot.fr/2015/03/pypy-251-released.html says Python 2.7.9 From issues-reply at bitbucket.org Tue Jun 2 17:41:56 2015 From: issues-reply at bitbucket.org (Alex Gaynor) Date: Tue, 02 Jun 2015 15:41:56 -0000 Subject: [pypy-issue] Issue #2056: Upgrade stdlib to 2.7.10 (pypy/pypy) Message-ID: <20150602154156.1089.61132@app06.ash-private.bitbucket.org> New issue 2056: Upgrade stdlib to 2.7.10 https://bitbucket.org/pypy/pypy/issue/2056/upgrade-stdlib-to-2710 Alex Gaynor: From issues-reply at bitbucket.org Thu Jun 4 10:05:50 2015 From: issues-reply at bitbucket.org (Bing Cai) Date: Thu, 04 Jun 2015 08:05:50 -0000 Subject: [pypy-issue] Issue #2057: couldn't install pyobjc via peppy (pypy/pypy) Message-ID: <20150604080550.9115.32612@app07.ash-private.bitbucket.org> New issue 2057: couldn't install pyobjc via peppy https://bitbucket.org/pypy/pypy/issue/2057/couldnt-install-pyobjc-via-peppy Bing Cai: I just try to install pyobjc or pyobjc-core via pip or easy_install under pypy's env, but just got the following error(same issue also happened when using "pypy setup.py install" to install pyobjc or pyobjc-core): sudo ./easy_install pyobjc-core Searching for pyobjc-core Reading https://pypi.python.org/simple/pyobjc-core/ Best match: pyobjc-core 3.0.4 Downloading https://pypi.python.org/packages/source/p/pyobjc-core/pyobjc-core-3.0.4.tar.gz#md5=6baaa0d2533cc9c26ad9f889ca9ecb01 Processing pyobjc-core-3.0.4.tar.gz Writing /tmp/easy_install-_lcDWq/pyobjc-core-3.0.4/setup.cfg Running pyobjc-core-3.0.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_lcDWq/pyobjc-core-3.0.4/egg-dist-tmp-8I030w Traceback (most recent call last): File "/app_main.py", line 75, in run_toplevel File "./easy_install", line 9, in load_entry_point('setuptools==17.0', 'console_scripts', 'easy_install')() File "build/bdist.macosx-10.10-x86_64/egg/setuptools/command/easy_install.py", line 2254, in main distclass=DistributionWithoutHelpCommands, **kw File "/Users/bcai/Downloads/pypy-2.6.0-osx64/lib-python/2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/Users/bcai/Downloads/pypy-2.6.0-osx64/lib-python/2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/Users/bcai/Downloads/pypy-2.6.0-osx64/lib-python/2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "build/bdist.macosx-10.10-x86_64/egg/setuptools/command/easy_install.py", line 380, in run self.easy_install(spec, not self.no_deps) File "build/bdist.macosx-10.10-x86_64/egg/setuptools/command/easy_install.py", line 629, in easy_install return self.install_item(spec, dist.location, tmpdir, deps) File "build/bdist.macosx-10.10-x86_64/egg/setuptools/command/easy_install.py", line 659, in install_item dists = self.install_eggs(spec, download, tmpdir) File "build/bdist.macosx-10.10-x86_64/egg/setuptools/command/easy_install.py", line 842, in install_eggs return self.build_and_install(setup_script, setup_base) File "build/bdist.macosx-10.10-x86_64/egg/setuptools/command/easy_install.py", line 1070, in build_and_install self.run_setup(setup_script, setup_base, args) File "build/bdist.macosx-10.10-x86_64/egg/setuptools/command/easy_install.py", line 1056, in run_setup run_setup(setup_script, args) File "build/bdist.macosx-10.10-x86_64/egg/setuptools/sandbox.py", line 240, in run_setup raise File "/Users/bcai/Downloads/pypy-2.6.0-osx64/lib-python/2.7/contextlib.py", line 35, in __exit__ self.gen.throw(type, value, traceback) File "build/bdist.macosx-10.10-x86_64/egg/setuptools/sandbox.py", line 193, in setup_context yield File "/Users/bcai/Downloads/pypy-2.6.0-osx64/lib-python/2.7/contextlib.py", line 35, in __exit__ self.gen.throw(type, value, traceback) File "build/bdist.macosx-10.10-x86_64/egg/setuptools/sandbox.py", line 164, in save_modules saved_exc.resume() File "build/bdist.macosx-10.10-x86_64/egg/setuptools/sandbox.py", line 139, in resume compat.reraise(type, exc, self._tb) File "build/bdist.macosx-10.10-x86_64/egg/setuptools/sandbox.py", line 152, in save_modules yield saved File "build/bdist.macosx-10.10-x86_64/egg/setuptools/sandbox.py", line 193, in setup_context yield File "build/bdist.macosx-10.10-x86_64/egg/setuptools/sandbox.py", line 237, in run_setup DirectorySandbox(setup_dir).run(runner) File "build/bdist.macosx-10.10-x86_64/egg/setuptools/sandbox.py", line 267, in run return func() File "build/bdist.macosx-10.10-x86_64/egg/setuptools/sandbox.py", line 236, in runner _execfile(setup_script, ns) File "build/bdist.macosx-10.10-x86_64/egg/setuptools/sandbox.py", line 46, in _execfile exec(code, globals, locals) File "/tmp/easy_install-_lcDWq/pyobjc-core-3.0.4/setup.py", line 93, in TypeError: 'NoneType' object is not iterable what I did: 1:download latest release peppy tar and extract to a local folder 2:Go to the pypy folder and run './bin/pypy ''path to pip and setuptools folder"/setup.py install' to install setuptools and pip 3:Go to the pypy folder and run './bin/easy_install pyobjc-core' to install pyobjc-core Result: the error above happened please just let me know if you need more info From issues-reply at bitbucket.org Fri Jun 5 01:12:21 2015 From: issues-reply at bitbucket.org (Kevin Ednalino) Date: Thu, 04 Jun 2015 23:12:21 -0000 Subject: [pypy-issue] Issue #2058: tkinter TypeError (pypy/pypy) Message-ID: <20150604231221.13443.31829@app12.ash-private.bitbucket.org> New issue 2058: tkinter TypeError https://bitbucket.org/pypy/pypy/issue/2058/tkinter-typeerror Kevin Ednalino: Using pypy3 Linux 64-bit: ``` #!python 3.2.5 (b2091e973da69152b3f928bfaabd5d2347e6df46, Nov 18 2014, 20:15:54) [PyPy 2.4.0 with GCC 4.9.2] ``` The exception: ``` #!python Exception in Tkinter callback Traceback (most recent call last): File "/opt/pypy3/lib-python/3/tkinter/__init__.py", line 1455, in __call__ args = self.subst(*args) File "/opt/pypy3/lib-python/3/tkinter/__init__.py", line 1193, in _substitute try: e.focus = getboolean(f) File "/opt/pypy3/lib_pypy/_tkinter/app.py", line 442, in getboolean if '\x00' in s: TypeError: 'str' does not support the buffer interface ``` This happens when using virtual events (through a widget's bind method). The function where the error occurs: ``` #!python def getboolean(self, s): if isinstance(s, int): return s s = s.encode('utf-8') if '\x00' in s: raise TypeError v = tkffi.new("int*") res = tklib.Tcl_GetBoolean(self.interp, s, v) if res == tklib.TCL_ERROR: self.raiseTclError() return bool(v[0]) ``` The issue appears to be that *s* is a bytes object, so making *'\x00'* a bytes object fixes the issue: ``` #!python if b'\x00' in s: ``` Or another solution would be to check before encoding. As far as I know, there are a couple other methods in the same class that have a similar pattern and would probably raise an exception also. From issues-reply at bitbucket.org Fri Jun 5 03:20:39 2015 From: issues-reply at bitbucket.org (tinloaf) Date: Fri, 05 Jun 2015 01:20:39 -0000 Subject: [pypy-issue] Issue #2059: json not usable inside sandbox (pypy/pypy) Message-ID: <20150605012039.1358.87504@app02.ash-private.bitbucket.org> New issue 2059: json not usable inside sandbox https://bitbucket.org/pypy/pypy/issue/2059/json-not-usable-inside-sandbox tinloaf: Hi, if I run a script that imports json inside a sandbox, this happens: ``` #!shell tinloaf at janeway sandbox % python2 ./pypy_interact.py --tmp=/tmp/ship ../goal/pypy-c start_ship.py 'import site' failed Traceback (most recent call last): File "/app_main.py", line 75, in run_toplevel File "start_ship.py", line 1, in from computer import ship_computer File "/tmp/computer.py", line 1, in from lcars import LCARS File "/tmp/lcars.py", line 1, in import json File "/bin/lib-python/2.7/json/__init__.py", line 114, in from .decoder import JSONDecoder File "/bin/lib-python/2.7/json/decoder.py", line 5, in import struct File "/bin/lib-python/2.7/struct.py", line 1, in from _struct import * ImportError: No module named _struct [Subprocess exit code: 1] ``` It looks like json needs some lowlevel C module, and that is not properly imported into the sandbox? From issues-reply at bitbucket.org Sun Jun 7 16:50:35 2015 From: issues-reply at bitbucket.org (Mohammed Fukeeslum) Date: Sun, 07 Jun 2015 14:50:35 -0000 Subject: [pypy-issue] Issue #2060: Non sse2 backend crashing (pypy/pypy) Message-ID: <20150607145035.2560.20928@app08.ash-private.bitbucket.org> New issue 2060: Non sse2 backend crashing https://bitbucket.org/pypy/pypy/issue/2060/non-sse2-backend-crashing Mohammed Fukeeslum: Hi, Before I get to the issue itself let me point that documentation regarding 32bit build process on non-sse2 machines needs updating in two respects: -the script doesn't check for sse2 so you're still naively building a wrong binary -with 2gb of ram the only practical solution is to use about 1.5 gb swap via zram Now, with --jit-backend=x86-without-sse2 option, pypy builds fine and even starts ok but still crashes while executing an actual script with SIGILL. From issues-reply at bitbucket.org Mon Jun 8 09:08:12 2015 From: issues-reply at bitbucket.org (Catstyle Lee) Date: Mon, 08 Jun 2015 07:08:12 -0000 Subject: [pypy-issue] Issue #2061: ctypes.py_object use weakref.ref which is rejecting dict (pypy/pypy) Message-ID: <20150608070812.20373.80793@app06.ash-private.bitbucket.org> New issue 2061: ctypes.py_object use weakref.ref which is rejecting dict https://bitbucket.org/pypy/pypy/issue/2061/ctypespy_object-use-weakrefref-which-is Catstyle Lee: this is not the same as under CPython2.7.9 i am writing a script that mainly using multiprocessing to do huge calculation for speed reason i have precalculated some factors as dict i want to share the dict(~900MB) within processes, manager.dict() use too much mem(i have no idea why) so i decide to use ctypes; but it complain `TypeError: cannot create weak reference to 'dict' object`, at https://bitbucket.org/pypy/pypy/src/76611312113ea3ba08c89bc40dca460949743d1b/lib_pypy/_ctypes/primitive.py?at=default#cl-56 it runs well under CPython2.7.9, should it have the same behavior? From issues-reply at bitbucket.org Mon Jun 8 18:49:27 2015 From: issues-reply at bitbucket.org (Markus Holtermann) Date: Mon, 08 Jun 2015 16:49:27 -0000 Subject: [pypy-issue] Issue #2062: Inconsistency in __repr__ for date/time/datetime to CPython (pypy/pypy) Message-ID: <20150608164927.667.51576@app02.ash-private.bitbucket.org> New issue 2062: Inconsistency in __repr__ for date/time/datetime to CPython https://bitbucket.org/pypy/pypy/issue/2062/inconsistency-in-__repr__-for-date-time Markus Holtermann: Refs https://code.djangoproject.com/ticket/24779 CPython's `__repr__` for `datetime.date`, `datetime.time` and `datetime.datetime` does not include the leading `datetime.` part. However, PyPy does. Instead of adding a workaround in Django to mitigate this issue I'd rather see PyPy following CPython's standard. From issues-reply at bitbucket.org Wed Jun 10 01:19:58 2015 From: issues-reply at bitbucket.org (Yichao Yu) Date: Tue, 09 Jun 2015 23:19:58 -0000 Subject: [pypy-issue] Issue #2063: PyPy3 trunk build failure with gcc 5.1 and debug info enabled (pypy/pypy) Message-ID: <20150609231958.5994.99990@app02.ash-private.bitbucket.org> New issue 2063: PyPy3 trunk build failure with gcc 5.1 and debug info enabled https://bitbucket.org/pypy/pypy/issue/2063/pypy3-trunk-build-failure-with-gcc-51-and Yichao Yu: As discussed with @mjacob on the IRC. Currently the pypy3 trunk compilation is failing with gcc and debug info enabled `-g`. Quoting @mjacob's comment on IRC ``` mjacob: yuyichao: the file generated by asmgcc contains a line containing "file 1 ..." which gcc doesn't like ``` I've seen similar result on the ArchLinuxCN buildbot for pypy(2) trunk so it might not be limited to the pypy3 trunk. (Although I haven't verified). It is very likely that this is only for asmgcc and I'm testing with shallowstack now. From issues-reply at bitbucket.org Thu Jun 11 15:13:40 2015 From: issues-reply at bitbucket.org (Alexander Pruss) Date: Thu, 11 Jun 2015 13:13:40 -0000 Subject: [pypy-issue] Issue #2064: socket not flushed on script exit (pypy/pypy) Message-ID: <20150611131340.16825.11751@app14.ash-private.bitbucket.org> New issue 2064: socket not flushed on script exit https://bitbucket.org/pypy/pypy/issue/2064/socket-not-flushed-on-script-exit Alexander Pruss: I don't know if this is a bug or just a difference from cpython, but outgoing data in sockets doesn't seem to be flushed when a script exits with pypy, but is flushed with cpython, in both cases under Windows. This causes problems with the Minecraft api library for Python. From issues-reply at bitbucket.org Sun Jun 14 17:47:04 2015 From: issues-reply at bitbucket.org (lesshaste) Date: Sun, 14 Jun 2015 15:47:04 -0000 Subject: [pypy-issue] Issue #2065: Relatively simple code much slower in pypy than cpython (pypy/pypy) Message-ID: <20150614154704.25221.69046@app08.ash-private.bitbucket.org> New issue 2065: Relatively simple code much slower in pypy than cpython https://bitbucket.org/pypy/pypy/issue/2065/relatively-simple-code-much-slower-in-pypy lesshaste: As discussed on IRC, I have some relatively simple code that is much slowed in pypy than cpython. On my computer here are the timings cpython: 38 seconds pypy 2.6: 81 seconds The attached code is simply run with python Mitch-2shifts.py From issues-reply at bitbucket.org Tue Jun 16 09:38:14 2015 From: issues-reply at bitbucket.org (David Wilson) Date: Tue, 16 Jun 2015 07:38:14 -0000 Subject: [pypy-issue] Issue #2066: ctypes.BigEndianStructure does not appear to swap byte order on PyPy (pypy/pypy) Message-ID: <20150616073814.22091.26664@app12.ash-private.bitbucket.org> New issue 2066: ctypes.BigEndianStructure does not appear to swap byte order on PyPy https://bitbucket.org/pypy/pypy/issue/2066/ctypesbigendianstructure-does-not-appear David Wilson: When run on a little endian machine, the output of the following script differs between CPython and PyPy: ```` import sys import ctypes FIELDS = [ ('n', ctypes.c_uint16) ] class Native(ctypes.Structure): _fields_ = FIELDS class Big(ctypes.BigEndianStructure): _fields_ = FIELDS class Little(ctypes.LittleEndianStructure): _fields_ = FIELDS def dostruct(c): ba = ctypes.create_string_buffer(ctypes.sizeof(c)) ms = c.from_buffer(ba) ms.n = 0xff00 return repr(ba[:]) print 'Native', dostruct(Native) print 'Big', dostruct(Big) print 'Little', dostruct(Little) if sys.byteorder == 'little': assert dostruct(Native) == dostruct(Little) elif sys.byteorder == 'big': assert dostruct(Native) == dostruct(Big) else: assert 0, 'typo' ```` On CPython, we see that the byte order of `Big` is swapped: ```` python p2.py Native '\x00\xff' Big '\xff\x00' Little '\x00\xff' ```` Whereas on PyPy 2.6.0 it is not the case: ```` Native '\x00\xff' Big '\x00\xff' Little '\x00\xff' ```` From issues-reply at bitbucket.org Thu Jun 18 14:23:41 2015 From: issues-reply at bitbucket.org (Thomas Mangin) Date: Thu, 18 Jun 2015 12:23:41 -0000 Subject: [pypy-issue] Issue #2067: socket.inet_pton small bug on failure ValueError does not contain the right string (pypy/pypy) Message-ID: <20150618122341.15363.63160@app04.ash-private.bitbucket.org> New issue 2067: socket.inet_pton small bug on failure ValueError does not contain the right string https://bitbucket.org/pypy/pypy/issue/2067/socketinet_pton-small-bug-on-failure Thomas Mangin: # python Python 2.7.10 (default, Jun 1 2015, 09:44:56) [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> socket.inet_ntop(socket.AF_INET6,'') Traceback (most recent call last): File "", line 1, in ValueError: invalid length of packed IP address string # pypy Python 2.7.9 (295ee98b69288471b0fcf2e0ede82ce5209eb90b, Jun 02 2015, 18:26:45) [PyPy 2.6.0 with GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>> import socket >>>> socket.inet_ntop(socket.AF_INET6,'') Traceback (most recent call last): File "", line 1, in ValueError: From issues-reply at bitbucket.org Mon Jun 22 13:56:49 2015 From: issues-reply at bitbucket.org (Smiley Barry) Date: Mon, 22 Jun 2015 11:56:49 -0000 Subject: [pypy-issue] Issue #2068: "os.uname" missing in PyPy (pypy/pypy) Message-ID: <20150622115649.11645.39239@app05.ash-private.bitbucket.org> New issue 2068: "os.uname" missing in PyPy https://bitbucket.org/pypy/pypy/issue/2068/osuname-missing-in-pypy Smiley Barry: I'm using `os.uname` to check which platform I'm running on -- Windows or Linux -- and on PyPy the function doesn't exist. Many other modules also use this in CPython, why doesn't it exist here? From issues-reply at bitbucket.org Mon Jun 22 16:26:28 2015 From: issues-reply at bitbucket.org (liuzhenhai) Date: Mon, 22 Jun 2015 14:26:28 -0000 Subject: [pypy-issue] Issue #2069: pypy(version 2.6) can not recognize and jit the cffi function without lib.xxxfunction calling way (pypy/pypy) Message-ID: <20150622142628.16192.816@app03.ash-private.bitbucket.org> New issue 2069: pypy(version 2.6) can not recognize and jit the cffi function without lib.xxxfunction calling way https://bitbucket.org/pypy/pypy/issue/2069/pypy-version-26-can-not-recognize-and-jit liuzhenhai: it seems that pypy(version 2.6) can not recognize and jit the cffi function without lib.xxxfunction calling way. Here is the code. ``` #!python from cffi import FFI ffi=FFI() ffi.cdef(''' int add(int a, int b); ''') ffi.set_source('_my_test',''' int add(int a, int b){ return a+b; } ''') ffi.compile() from _my_test import ffi,lib %timeit lib.add(1,2) add=lib.add %timeit add(1,2) # slower than lib.add(1,2) about 6x ``` Responsible: arigo From issues-reply at bitbucket.org Wed Jun 24 20:02:39 2015 From: issues-reply at bitbucket.org (Sam McDermott) Date: Wed, 24 Jun 2015 18:02:39 -0000 Subject: [pypy-issue] Issue #2070: unable to build matplotlib with pypy 2.6.0 (pypy/pypy) Message-ID: <20150624180239.14913.4584@app09.ash-private.bitbucket.org> New issue 2070: unable to build matplotlib with pypy 2.6.0 https://bitbucket.org/pypy/pypy/issue/2070/unable-to-build-matplotlib-with-pypy-260 Sam McDermott: First of all, I'm new to PyPy, but I am intrigued by the performance reports; I'm repeatedly multiplying lots of big arrays right now, and CPython has seemed to hit a wall that PyPy could have some native advantages with. A factor of few speedup is really appealing. To get started, I need a few python modules that are available on pip, but I've had trouble getting them to install correctly with PyPy. The problem appears to trace back to issues with matplotlib installation. When installing from source, I get ``` #!bash In file included from src/ft2font_wrapper.cpp:3: src/file_compat.h:7:10: fatal error: 'numpy/ndarrayobject.h' file not found #include "numpy/ndarrayobject.h" ^ 1 error generated. In file included from src/ft2font_wrapper.cpp:3: ``` Then another similar error?is generated, followed by "failed with exit status 1." I haven't seen anything too recent regarding matplotlib on the website, but if there are any known bugs or fixes, they would be most welcome! (I am listing this as a minor bug since I'm new here, but maybe it is bigger or smaller than that!) Thanks for any help, Sam From issues-reply at bitbucket.org Thu Jun 25 03:18:09 2015 From: issues-reply at bitbucket.org (Andrew Dalke) Date: Thu, 25 Jun 2015 01:18:09 -0000 Subject: [pypy-issue] Issue #2071: file.readinto() uses too much memory (pypy/pypy) Message-ID: <20150625011809.29857.35298@app13.ash-private.bitbucket.org> New issue 2071: file.readinto() uses too much memory https://bitbucket.org/pypy/pypy/issue/2071/filereadinto-uses-too-much-memory Andrew Dalke: I am using CFFI to read a file containing 7 GB of uint64_t data. I use ffi.new() to allocate the space, then readinto() the pre-allocated buffer, as suggested by the CFFI documentation. (Note: the docstring for readinto says "Undocumented. Don't use this; it may go away".) It appears that something internal to readinto makes a copy of the input because the readinto() ends up running out of memory on my 16 GB box, which has 15 GB free. I am able to reproduce the problem using the array module, so it is not some oddity of the CFFI implementation. Here is an example of what causes a problem on my machine: ``` #!python >>>> import array >>>> a=array.array("c", s) >>>> a.extend(s) >>>> a.extend(s) # do some cleanup, to be on the safe side. >>>> del s >>>> import gc >>>> gc.collect() 0 # Read ~6GB from a file with >7GB in it >>>> len(a) 6442450944 >>>> filename = "pubchem.14" >>>> import os >>>> os.path.getsize(filename) 7662345264 >>>> infile = open(filename, "rb") # Currently, virtual memory size = 8.87 GB >>>> infile.readinto(a) ^CTerminated # I killed it when the virtual memory was at 14 GB and still growing ``` From issues-reply at bitbucket.org Sun Jun 28 23:37:32 2015 From: issues-reply at bitbucket.org (lac) Date: Sun, 28 Jun 2015 21:37:32 -0000 Subject: [pypy-issue] Issue #2072: readline.parse_and_bind fails silently on 2.7 (pypy/pypy) Message-ID: <20150628213732.26588.89034@app07.ash-private.bitbucket.org> New issue 2072: readline.parse_and_bind fails silently on 2.7 https://bitbucket.org/pypy/pypy/issue/2072/readlineparse_and_bind-fails-silently-on lac: In the command interpreter type: import readline readline.parse_and_bind('Control-tab: "import"') Then type control-tab on the next line. readline should insert import. PyPy 2.7.9 (2.5.1+dfsg-1, Mar 27 2015, 19:45:43) doesn't. There is an alternative syntax. readline.parse_and_bind(r'"\C-\t": "import"') This doesn't work either. Note that CPython Python 2.7.9 (default, Mar 1 2015, 12:57:24) has bugs over this also, but different ones. readline.parse_and_bind(r'"\C-\t": "import"') in CPython does nothing. readline.parse_and_bind('Control-tab: "import"') works but if you then do readline.parse_and_bind('tab: "raise"') both tab and control-tab will be set to insert "raise" by CPython. There seems to be no way to bind control-tab and tab to different things in CPython. This bug was discovered by Steve D'Aprano in CPython 2.7. He will probably make a CPython bug report about it soon.