R. David Murray added the comment:
This issue should have gone back to being a release blocker after the alpha
release to fix the tab-as-indent issue, but obviously that didn't happen (I
forgot about it myself). Please open a new issue requesting a fix for this bug
(that tab doesn't work as
David Beazley added the comment:
Funny thing, this feature breaks the interactive interpreter in the most basic
way on OS X systems. For example, the tab key won't even work to indent. You
can't even type the most basic programs into the interactive interpreter. For
example:
for i in
Roundup Robot added the comment:
New changeset 69c451851c71 by R David Murray in branch 'default':
whatsnew: sys.__interactivehook__. (#5845)
http://hg.python.org/cpython/rev/69c451851c71
--
___
Python tracker rep...@bugs.python.org
Jason R. Coombs added the comment:
Added issue20411, revealed in 3.4b2.
--
nosy: +jason.coombs
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Serhiy Storchaka added the comment:
What is the status of this issue?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
___
Antoine Pitrou added the comment:
I would say it's now closed. If there's some fine tuning needed, separate
issues should be opened.
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
Xavier de Gaye added the comment:
There is a backward compatibility issue with changeset d5ef330bac50
that enables tab-completion in the interactive interpreter by default.
When a user is not aware of this new feature and has been implementing
up to now her/his PYTHONSTARTUP file with the first
Antoine Pitrou added the comment:
When a user is not aware of this new feature and has been implementing
up to now her/his PYTHONSTARTUP file with the first example given in
python 3.3 documentation at
http://docs.python.org/3/library/readline.html?highlight=readline#example
then each
Antoine Pitrou added the comment:
Attaching patch to only load history file if no history exists.
--
keywords: -needs review
resolution: - fixed
Added file: http://bugs.python.org/file31914/rl_history_guard.patch
___
Python tracker
Roundup Robot added the comment:
New changeset 687dd81cee3b by Antoine Pitrou in branch 'default':
Issue #5845: In site.py, only load readline history from ~/.python_history if
no history has been read already. This avoids double writes to the history
file at shutdown.
Xavier de Gaye added the comment:
The patch fixes the problem on my setup. A very minor glitch: after
manually emptying or removing the PYTHONSTARTUP history file, the
history is loaded with the content of ~/.python_history on the next
session.
--
Antoine Pitrou added the comment:
The patch fixes the problem on my setup. A very minor glitch: after
manually emptying or removing the PYTHONSTARTUP history file, the
history is loaded with the content of ~/.python_history on the next
session.
Yes, the only way to know if a history file
Serhiy Storchaka added the comment:
Do you know that the readline module first force rebind of TAB to insert-tab?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Larry Hastings added the comment:
This issue seems to have stalled. But it's still marked as a release blocker,
which means I can't release Python 3.4a1 in two days if this issue is still
open.
One of three things will happen:
1) This issue is marked closed.
2) This issue is downgraded from
Steven D'Aprano added the comment:
On 31/07/13 17:14, Larry Hastings wrote:
IMO the optimal solution is that tab preceded by only whitespace indents, and
tab preceded by any non-whitespace character attempts to complete. Can we
goad readline into behaving this way?
Yes we can. Attached
Martin v. Löwis added the comment:
If R. David agrees (assuming no patch is coming forward), it could be degrated
to deferred-blocker, and the alpha phases could be used to see how annoyed
people are with tab not working.
--
___
Python tracker
R. David Murray added the comment:
Yeah, deferred blocker is fine with me.
--
priority: release blocker - deferred blocker
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Changes by anatoly techtonik techto...@gmail.com:
--
nosy: +techtonik
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
___
Python-bugs-list
Mark Dickinson added the comment:
On OS X 10.6, I now get the following message at interpreter startup:
iwasawa:cpython mdickinson$ ./python.exe
Python 3.4.0a0 (default:d5ef330bac50, May 6 2013, 13:05:57)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type help, copyright, credits or license
Mark Dickinson added the comment:
More information: readline.read_init_file() produced the same traceback before
this commit, so all that's changed is that we're now calling this at
interpreter startup. It looks like I'm using the system libedit:
iwasawa:cpython mdickinson$ otool -L
Mark Dickinson added the comment:
So I'm failing to find any documentation for libedit, but it looks as though
this error occurs if rl_read_init_file fails to find an .editrc file in the
appropriate place. If I create an empty .editrc file in my home directory, the
error disappears. (Having
Antoine Pitrou added the comment:
So I'm failing to find any documentation for libedit, but it looks as
though this error occurs if rl_read_init_file fails to find an
.editrc file in the appropriate place. If I create an empty .editrc
file in my home directory, the error disappears.
Mark Dickinson added the comment:
The attached fixes the issue for me. I'm not sure whether the try / except
should only be done on Apple, though. What's the behaviour on Linux if there's
no .inputrc file?
--
Added file: http://bugs.python.org/file30148/issue5845_osx_fix.patch
Antoine Pitrou added the comment:
The attached fixes the issue for me. I'm not sure whether the try /
except should only be done on Apple, though. What's the behaviour
on Linux if there's no .inputrc file?
Everything works fine under Linux (as usual :-)).
There's no need to restrict the
Steven D'Aprano added the comment:
I'm not able to test the patch at the moment, but since it essentially just
uses the recipe in the docs, I expect it will have the same side-effect.
Namely, it prevents you using the tab key to indent in the interactive
interpreter.
Now I don't know if I'm
Antoine Pitrou added the comment:
Now I don't know if I'm missing something painfully obvious, but
having to bang out space-space-space-space for every indent is
surely not going to be a win for usability ;-) Even if I am missing
something, surely so will a lot of other users.
What *looks*
Roundup Robot added the comment:
New changeset 82e92da929eb by Mark Dickinson in branch 'default':
Issue #5845: avoid an exception at startup on OS X if no .editrc file exists.
http://hg.python.org/cpython/rev/82e92da929eb
--
___
Python tracker
Mark Dickinson added the comment:
Applied the OS X fix; reclosing.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
R. David Murray added the comment:
The tab-doesn't-indent still needs to be fixed before 3.4 is released.
--
nosy: +larry
priority: normal - release blocker
resolution: fixed -
status: closed - open
___
Python tracker rep...@bugs.python.org
Antoine Pitrou added the comment:
The tab-doesn't-indent still needs to be fixed before 3.4 is
released.
I don't really understand why this would be a release blocker?
The interpreter prompt is a convenience, we don't guarantee
compatibility like with stdlib APIs.
--
R. David Murray added the comment:
It is a release blocker because it is a major usability regression.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
R. David Murray added the comment:
Just to be clear how important I consider this, I would advocate for backing
out this patch rather than releasing 3.4 with a broken tab key at the
interactive prompt. But I'd rather have the patch *and* a working tab key.
--
R. David Murray added the comment:
Well, post it to python-dev and see what reaction you get :)
I could be wrong, but I don't think I am (obviously).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
Antoine Pitrou added the comment:
It is a release blocker because it is a major usability regression.
Really? You can press the space key to indent, it works as well
as the tab key...
--
___
Python tracker rep...@bugs.python.org
Ronald Oussoren added the comment:
I expect that a lot of users use the tab key to indent in the repl (as well as
in editors, smart enough editors can convert the tab presses to spaces)
--
___
Python tracker rep...@bugs.python.org
Antoine Pitrou added the comment:
Well, post it to python-dev and see what reaction you get :)
I'm not interested in python-dev reactions here. For this
kind of issue, we'll have hundreds of messages for and against
the change without any useful content.
The commit adds an often-requested
Antoine Pitrou added the comment:
I expect that a lot of users use the tab key to indent in the repl
(as well as in editors, smart enough editors can convert the tab
presses to spaces)
The interpreter prompt is not a text editor at all. You can misuse
it as one, but that's a loss of time and
Alexander Belopolsky added the comment:
I am in AP's camp on the tab issue, but I think we can preserve tab inserts
tab behavior at the continuation prompt. I don't like indent at beginning of
line. I have rlcompleter enabled in Python 2.6 and i get the following when I
press tab:
Python
Antoine Pitrou added the comment:
Take it with a large grain of Internet salt, but Ezio pointed me to the
following reactions:
http://www.reddit.com/r/Python/comments/1dq7sh/python_repl_finally_gets_tab_completion_by_default/
--
___
Python tracker
Tshepang Lekhonkhobe added the comment:
Also made it to the front-page of Hacker News[1], with better quality comments
than the reddit thread.
[1] https://news.ycombinator.com/item?id=5658062
--
___
Python tracker rep...@bugs.python.org
Roundup Robot added the comment:
New changeset d5ef330bac50 by Antoine Pitrou in branch 'default':
Issue #5845: Enable tab-completion in the interactive interpreter by default,
thanks to a new sys.__interactivehook__.
http://hg.python.org/cpython/rev/d5ef330bac50
--
nosy: +python-dev
Antoine Pitrou added the comment:
End-users will hopefully rejoice :)
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
___
Changes by Antoine Pitrou pit...@free.fr:
Added file: http://bugs.python.org/file30098/c43e264256e4.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Antoine Pitrou added the comment:
In the spirit of pushing this forward, here is an updated patch using the
sys.__interactivehook__ approach. I didn't add any tests since it doesn't seem
very easy to write any.
If nobody objects, I would like to commit this soon.
--
Added file:
Changes by Giampaolo Rodola' g.rod...@gmail.com:
--
nosy: +giampaolo.rodola
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
___
Changes by Florent Xicluna florent.xicl...@gmail.com:
--
nosy: +flox
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
___
Python-bugs-list
Changes by Tshepang Lekhonkhobe tshep...@gmail.com:
--
nosy: +tshepang
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
___
Python-bugs-list
Changes by Tshepang Lekhonkhobe tshep...@gmail.com:
--
versions: +Python 3.4 -Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Changes by Steven D'Aprano steve+pyt...@pearwood.info:
--
nosy: +stevenjd
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
___
Éric Araujo mer...@netwok.org added the comment:
FTR, I tried checking sys.ps1 instead of argv but it’s the same problem.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
___
Python-bugs-list
Antoine Pitrou pit...@free.fr added the comment:
It's more useful to have a hook called when entering interactive mode,
rather than a flag
that's set from the beginning:
We already have such a hook: $PYTHONSTARTUP
$PYTHONSTARTUP doesn't work with -i
--
Éric Araujo mer...@netwok.org added the comment:
Easily detecting interactive mode is of general interest for
customization.
Thanks for the feedback. We could open a feature request for that, and/or ask
python-ideas.
What if C also set sys.flags.interactive in python mode, or exposed
Cherniavsky Beni b...@google.com added the comment:
On Tue, Sep 6, 2011 at 17:54, Antoine Pitrou rep...@bugs.python.org wrote:
It covers the user's desire customization very well (esp. if it worked with
-i).
sys.__interactivehook__ has the benefit of being cleanly settable from
python code.
But
Cherniavsky Beni b...@google.com added the comment:
[sorry, html mail was bad idea]
On Tue, Sep 6, 2011 at 17:54, Antoine Pitrou rep...@bugs.python.org wrote:
Éric Araujo mer...@netwok.org added the comment:
It's more useful to have a hook called when entering interactive mode,
rather than
Changes by Éric Araujo mer...@netwok.org:
Removed file: http://bugs.python.org/file23108/unnamed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Changes by Éric Araujo mer...@netwok.org:
--
Removed message: http://bugs.python.org/msg143617
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Éric Araujo mer...@netwok.org added the comment:
sys.__interactivehook__ has the benefit of being cleanly settable from python
code.
But it might well be a YAGNI idea.
I’ll ask python-dev about that. For the moment, I prefer the idea of a new
sys.interactive attribute (boolean).
Éric Araujo mer...@netwok.org added the comment:
We can’t just decide to enable completion by checking “'readline' in
sys.modules” in site, because it always returns False. site is imported in
Python/pythonrun.c, and I guess that Modules/main.c is run afterwards. More
importantly, I think
Cherniavsky Beni b...@google.com added the comment:
Easily detecting interactive mode is of general interest for customization.
1. What if C also set sys.flags.interactive in python mode,
or exposed sys.flags.implicit_interactive (but with better name)?
2. It's more useful to have a hook
Changes by Éric Araujo mer...@netwok.org:
Removed file: http://bugs.python.org/file21399/fix-5845.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Éric Araujo mer...@netwok.org added the comment:
Updated patch (not using Mercurial, looks like I haven’t enough bandwidth to
push all those changesets).
--
Added file: http://bugs.python.org/file22936/fix-5845.diff
___
Python tracker
Antoine Pitrou pit...@free.fr added the comment:
Interestingly, there's already the following code in Modules/main.c:
if ((Py_InspectFlag || (command == NULL filename == NULL module ==
NULL))
isatty(fileno(stdin))) {
PyObject *v;
v =
Antoine Pitrou pit...@free.fr added the comment:
Updated patch (not using Mercurial, looks like I haven’t enough
bandwidth to push all those changesets).
I think there's a bug in the way you are detecting interactive mode:
$ ./python -c import sys; print(sys.stdin.isatty())
True
--
Éric Araujo mer...@netwok.org added the comment:
Ned, does readline.read_init_file() with libedit?
--
versions: -Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Ned Deily n...@acm.org added the comment:
readline.read_init_file() does work with libedit. The directives read have to
be in libedit format.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
Changes by Éric Araujo mer...@netwok.org:
--
hgrepos: +9
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
___
Python-bugs-list mailing list
Changes by Éric Araujo mer...@netwok.org:
--
keywords: +patch
Added file: http://bugs.python.org/file21397/a5bded1b8db4.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Changes by Éric Araujo mer...@netwok.org:
Added file: http://bugs.python.org/file21398/c43e264256e4.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Éric Araujo mer...@netwok.org added the comment:
Please ignore the generated patches, left here for Martin’s benefit, and review
the manually attached fix-5845.diff.
I have used read_init_file instead of hard-coding tab (it’s anyway the default
for readline).
I may have repeated the same
Changes by Martin v. Löwis mar...@v.loewis.de:
Removed file: http://bugs.python.org/file21398/c43e264256e4.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Changes by Martin v. Löwis mar...@v.loewis.de:
Added file: http://bugs.python.org/file21401/c43e264256e4.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Changes by Éric Araujo mer...@netwok.org:
Added file: http://bugs.python.org/file21402/d1cbf0347eb4.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Changes by Éric Araujo mer...@netwok.org:
Removed file: http://bugs.python.org/file21397/a5bded1b8db4.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Changes by Éric Araujo mer...@netwok.org:
Removed file: http://bugs.python.org/file21401/c43e264256e4.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Changes by Éric Araujo mer...@netwok.org:
Removed file: http://bugs.python.org/file21402/d1cbf0347eb4.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
R. David Murray rdmur...@bitdance.com added the comment:
for what it is worth, I am +1 on having completion and history file work by
default. The sqlite3 command line does this, for example. I think it is what
unix user expect nowadays, and I think it is reasonable.
Looking at my home
Éric Araujo mer...@netwok.org added the comment:
Okay, that’s one question answered. Still to solve: How to bind the right key?
(“But perhaps tab isn’t the right key to bind. I think inputrc could set it to
something different, perhaps shell rc files too. Is there an API to get this
setting,
Antoine Pitrou pit...@free.fr added the comment:
I think TAB is the key expected by most people, so let's make it the default.
As for the location, site.py is an adequate one IMO.
--
components: +Library (Lib) -Interpreter Core
versions: +Python 3.2
Ned Deily n...@acm.org added the comment:
Keep in bind that there the Python readline module may be linked to either GNU
readline or the BSD editline (libedit) library and they have different command
strings. Note the warning here:
http://docs.python.org/dev/py3k/library/readline.html
Ned Deily n...@acm.org added the comment:
Keep in mind that the Python readline module may be linked to either GNU
readline or the BSD editline (libedit) library and they have different command
strings. Note the warning here:
http://docs.python.org/dev/py3k/library/readline.html
Here's a
Changes by Ned Deily n...@acm.org:
--
Removed message: http://bugs.python.org/msg123702
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
___
Ned Deily n...@acm.org added the comment:
Nosying Martin: any Windows installer concerns?
--
nosy: +loewis
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
Martin v. Löwis mar...@v.loewis.de added the comment:
There is no readline support on Windows at all, so I don't think the Windows
installer can be affected. I'm uncertain what the proposed change to Python is
at this point, though.
--
___
Python
Changes by Alexander Belopolsky belopol...@users.sourceforge.net:
--
nosy: +belopolsky
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
___
Changes by lesmana lesm...@gmx.de:
--
nosy: +lesmana
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
___
___
Python-bugs-list mailing list
Antoine Pitrou pit...@free.fr added the comment:
He, adding completion is also something I find myself adding on every
box on which I use Python...
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
Éric Araujo mer...@netwok.org added the comment:
What would be the right place for this to happen? I first thought of
site.py, but -S would then turn off readline support. Does it have to be
done somewhere in C land?
But perhaps tab isn’t the right key to bind. I think inputrc could set
it to
New submission from Cherniavsky Beni c...@users.sf.net:
An interactive prompt should offer working completion out-of-the-box,
without requiring every Python user on earth to create a $PYTHONSTARTUP
with '''import readline; readline.parse_and_bind(tab: complete)'''.
Note that it should work not
Changes by Cherniavsky Beni c...@users.sf.net:
--
components: +Interpreter Core
type: - feature request
versions: +Python 2.7, Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5845
91 matches
Mail list logo