GNU bug report logs -
#27154
25.2; python.el shell does not respect getpass.getpass prompt
Previous Next
Reported by: Diego Fernandez <difernan <at> redhat.com>
Date: Tue, 30 May 2017 21:10:01 UTC
Severity: normal
Found in version 25.2
Fixed in version 26.1
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 27154 in the body.
You can then email your comments to 27154 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#27154
; Package
emacs
.
(Tue, 30 May 2017 21:10:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Diego Fernandez <difernan <at> redhat.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 30 May 2017 21:10:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
1. Start emacs
2. M-x run-python
3. from getpass import getpass; getpass()
4. Type in anything
This displays what the user is typing in the shell, but the expected
behavior is that the text should not be echoed.
In GNU Emacs 25.2.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.22.12)
of 2017-05-02 built on buildhw-09.phx2.fedoraproject.org
Windowing system distributor 'Fedora Project', version 11.0.11903000
System Description: Fedora release 26 (Twenty Six)
Configured using:
'configure --build=x86_64-redhat-linux-gnu
--host=x86_64-redhat-linux-gnu --program-prefix=
--disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
--bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
--datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
--libexecdir=/usr/libexec --localstatedir=/var
--sharedstatedir=/var/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-
png
--with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3
--with-gpm=no --with-xwidgets --with-modules
build_alias=x86_64-redhat-linux-gnu host_alias=x86_64-redhat-linux-gnu
'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
--param=ssp-buffer-size=4 -grecord-gcc-switches
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic'
LDFLAGS=-Wl,-z,relro
PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS
NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES XWIDGETS
Important settings:
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
Major mode: Lisp Interaction
Minor modes in effect:
global-company-mode: t
company-mode: t
helm-mode: t
electric-pair-mode: t
show-paren-mode: t
rainbow-delimiters-mode: t
keyfreq-autosave-mode: t
keyfreq-mode: t
helm-adaptive-mode: t
projectile-mode: t
yas-global-mode: t
yas-minor-mode: t
pyvenv-mode: t
global-magit-file-mode: t
diff-auto-refine-mode: t
magit-auto-revert-mode: t
global-git-commit-mode: t
async-bytecomp-package-mode: t
shell-dirtrack-mode: t
global-pyenv-mode: t
global-flycheck-mode: t
flycheck-mode: t
global-semanticdb-minor-mode: t
global-semantic-idle-scheduler-mode: t
global-semantic-idle-local-symbol-highlight-mode: t
semantic-mode: t
global-subword-mode: t
subword-mode: t
override-global-mode: t
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
global-visual-line-mode: t
visual-line-mode: t
transient-mark-mode: t
Recent messages:
[sml] sml/theme set to dark
Turning on magit-auto-revert-mode...done
[pyenv] using custard
Starting Emacs daemon.
When done with this frame, type C-x 5 0
.emacs.d/elpa/helm-20170527.2302/helm-elisp.el: ‘dont-compile’ is an
obsolete macro (as of 24.4).
Quit
delete-backward-char: Text is read-only
condition-case: Start a Python process first with ‘M-x run-python’ or
‘’.
Shell native completion is disabled, using fallback
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug sendmail winner helm-command helm-elisp
helm-eval edebug powerline powerline-separators color powerline-themes
smart-mode-line-dark-theme smart-mode-line rich-minority
tango-dark-theme ignoramus cl company-statistics company-oddmuse
company-capf company-files company-etags company-gtags
company-dabbrev-code company-dabbrev company-cmake company-xcode
company-clang company-eclim company-nxml company-bbdb company-semantic
company-template company-tern dash-functional tern url-http tls gnutls
url-auth url-gw company-web-html company-web-jade company-web
company-css company-yasnippet company cc-mode cc-fonts cc-guess cc-
menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs helm-mode helm-ag
elec-pair paren rainbow-delimiters python-docstring keyfreq
helm-projectile helm-files image-dired dired-x dired-aux ffap helm-tags
helm-bookmark helm-adaptive helm-info bookmark pp helm-external helm-
net
browse-url xml url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap helm-buffers
helm-grep derived helm-regexp helm-utils helm-locate helm-help
helm-types helm helm-source eieio-compat helm-multi-match helm-lib
projectile ibuf-ext ibuffer django-snippets pig-snippets
angular-snippets yasnippet highlight-indentation elpy pyvenv
elpy-profile elpy-django s elpy-refactor python ido grep compile files-
x
etags xref project ac-html-bootstrap web-completion-data sudo-edit
magit-obsolete magit-blame magit-stash magit-bisect magit-remote
magit-commit magit-sequence magit-notes magit-worktree magit-branch
magit-files magit-refs magit-status magit magit-repos magit-apply
magit-wip magit-log magit-diff smerge-mode diff-mode magit-core
magit-autorevert autorevert filenotify magit-process magit-margin
magit-mode magit-git magit-section magit-popup git-commit magit-utils
crm log-edit message idna dired rfc822 mml mml-sec epg mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums
mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log with-
editor
async-bytecomp async tramp-sh docker-tramp tramp-cache tramp
tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
format-spec advice server pyenv systemd url-parse auth-source gnus-util
mm-util help-fns mail-prsvr password-cache url-vars thingatpt conf-mode
edmacro kmacro coffee-mode comint ansi-color ring flycheck json map
subr-x semantic/db-mode semantic/db eieio-base cl-seq semantic/idle
semantic/format ezimage semantic/tag-ls semantic/find semantic/ctxt
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw eieio eieio-core mode-local find-func cedet cap-words
superword subword time-date auto-package-update cl-macs dash session
cus-edit cus-start cus-load wid-edit use-package diminish bind-key
easy-mmode finder-inf rx info package epg-config seq byte-opt gv
bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs
pcase cl-lib mule-util tooltip eldoc electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar
dnd
fontset image regexp-opt fringe tabulated-list newcomment elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame
cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote dbusbind inotify
dynamic-setting system-font-setting font-render-setting xwidget-
internal
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)
Memory information:
((conses 16 586847 61993)
(symbols 48 48907 702)
(miscs 40 319 1191)
(strings 32 125248 19987)
(string-bytes 1 4108554)
(vectors 16 73746)
(vector-slots 8 1243261 11328)
(floats 8 1471 394)
(intervals 56 769 1059)
(buffers 976 25))
--
Diego Fernandez - 爱国
Senior Software Engineer
CEE Analytics (& Diagnostics)
IRC: aiguofer on #gss, #customer-platform, #cee, or #wabash
*Please make your CEE Analytics requests here
<https://operations.cee.redhat.com/#/requests/analytics>!*
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#27154
; Package
emacs
.
(Wed, 31 May 2017 18:36:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 27154 <at> debbugs.gnu.org (full text, mbox):
Diego Fernandez wrote:
> 1. Start emacs
> 2. M-x run-python
> 3. from getpass import getpass; getpass()
> 4. Type in anything
>
> This displays what the user is typing in the shell, but the expected
> behavior is that the text should not be echoed.
Try:
emacs -Q --eval "(add-hook 'inferior-python-mode-hook (lambda () (push
'comint-watch-for-password-prompt comint-output-filter-functions)))" -f run-python
I have no idea whether your usage is common enough that this should be the
default.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#27154
; Package
emacs
.
(Wed, 31 May 2017 18:47:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 27154 <at> debbugs.gnu.org (full text, mbox):
Glenn Morris wrote:
> emacs -Q --eval "(add-hook 'inferior-python-mode-hook (lambda () (push
> 'comint-watch-for-password-prompt comint-output-filter-functions)))"
> -f run-python
Sorry, add-hook would be better than push.
> I have no idea whether your usage is common enough that this should be the
> default.
I see comint-watch-for-password-prompt was taken out a few years ago (a6dc66a),
for performance reasons, https://debbugs.gnu.org/16875 . Though from the
numbers quoted there, it doesn't look like it was causing any problem.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#27154
; Package
emacs
.
(Wed, 31 May 2017 19:09:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 27154 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Ahh, great thanks! that works for me.
It still seems to me that the default behavior should respect password
prompts, but I can easily just add this to my init.el :)
On Wed, May 31, 2017 at 2:46 PM, Glenn Morris <rgm <at> gnu.org> wrote:
> Glenn Morris wrote:
>
> > emacs -Q --eval "(add-hook 'inferior-python-mode-hook (lambda () (push
> > 'comint-watch-for-password-prompt comint-output-filter-functions)))"
> > -f run-python
>
> Sorry, add-hook would be better than push.
>
> > I have no idea whether your usage is common enough that this should be
> the
> > default.
>
> I see comint-watch-for-password-prompt was taken out a few years ago
> (a6dc66a),
> for performance reasons, https://debbugs.gnu.org/16875 . Though from the
> numbers quoted there, it doesn't look like it was causing any problem.
>
--
Diego Fernandez - 爱国
Senior Software Engineer
CEE Analytics (& Diagnostics)
IRC: aiguofer on #gss, #customer-platform, #cee, or #wabash
*Please make your CEE Analytics requests here
<https://operations.cee.redhat.com/#/requests/analytics>!*
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#27154
; Package
emacs
.
(Wed, 31 May 2017 19:42:01 GMT)
Full text and
rfc822 format available.
Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 31.05.2017 21:08, Diego Fernandez wrote:
> Ahh, great thanks! that works for me.
>
> It still seems to me that the default behavior should respect password
> prompts, but I can easily just add this to my init.el :)
>
Hmm, not working here - see attachment.
Also when typing the password, it is not echoed. Just dots appear in
minibuffer. BTW
comint-watch-for-password-prompt was already in comint mode - another
add-hook seems redundant.
Looks like the inconvenient results from Python itself - see
outside-emacs.png
[Message part 2 (text/html, inline)]
[passwd.png (image/png, attachment)]
[outside-emacs.png (image/png, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#27154
; Package
emacs
.
(Wed, 31 May 2017 23:47:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 27154 <at> debbugs.gnu.org (full text, mbox):
Glenn Morris <rgm <at> gnu.org> writes:
> I see comint-watch-for-password-prompt was taken out a few years ago (a6dc66a),
> for performance reasons, https://debbugs.gnu.org/16875 . Though from the
> numbers quoted there, it doesn't look like it was causing any problem.
Yeah, it looks like it was just a casualty of over zeolous streamlining.
Andreas Röhler <andreas.roehler <at> easy-emacs.de> writes:
> Hmm, not working here - see attachment.
>
> Also when typing the password, it is not echoed. Just dots appear in
> minibuffer.
That means it's working.
> BTW comint-watch-for-password-prompt was already in comint mode -
> another add-hook seems redundant.
Yeah, the problem is that python-mode removes it.
> Looks like the inconvenient results from Python itself - see outside-emacs.png
Sure, the filter isn't supposed to prevent your python program from
printing passwords.
Reply sent
to
Glenn Morris <rgm <at> gnu.org>
:
You have taken responsibility.
(Sat, 03 Jun 2017 00:08:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Diego Fernandez <difernan <at> redhat.com>
:
bug acknowledged by developer.
(Sat, 03 Jun 2017 00:08:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 27154-done <at> debbugs.gnu.org (full text, mbox):
Version: 26.1
>> I see comint-watch-for-password-prompt was taken out a few years ago
>> (a6dc66a),
>> for performance reasons, https://debbugs.gnu.org/16875 . Though from the
>> numbers quoted there, it doesn't look like it was causing any problem.
>
> Yeah, it looks like it was just a casualty of over zeolous streamlining.
I've put it back in 182912c.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 01 Jul 2017 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 7 years and 349 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.