homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Strange behaviour of python cmd module. (Ignores slash)
Type: behavior Stage:
Components: Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: jsevilleja, peter.otten
Priority: normal Keywords:

Created on 2012年06月15日 07:41 by jsevilleja, last changed 2022年04月11日 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
shell.py jsevilleja, 2012年06月15日 07:41 the code i'm using
Messages (2)
msg162854 - (view) Author: (jsevilleja) Date: 2012年06月15日 07:41
I've used the code from here: http://stackoverflow.com/questions/5637124/tab-completion-in-pythons-raw-input/5638688#5638688 and it works. But I've used the same code in a class which inherits from cmd.Cmd, and the code doesn't works. Doing tests, I've noticed that if I do "put /", the argument text from "complete_put" method, skips '/' character. I don't know if this is a bug or my code is wrong, but it works with any other character, and I haven't found anything in the docs. Thanks.
msg162898 - (view) Author: Peter Otten (peter.otten) * Date: 2012年06月15日 13:59
Not a python bug. You are ommitting an important detail of the stackoverflow example in your code:
# we want to treat '/' as part of a word, so override the delimiters
readline.set_completer_delims(' \t\n;')
Please turn to the Python mailing list if you need more help.
History
Date User Action Args
2022年04月11日 14:57:31adminsetgithub: 59279
2012年06月15日 19:11:40ned.deilysetstatus: open -> closed
resolution: not a bug
2012年06月15日 13:59:20peter.ottensetnosy: + peter.otten
messages: + msg162898
2012年06月15日 07:41:31jsevillejacreate

AltStyle によって変換されたページ (->オリジナル) /