* bug#27154: 25.2; python.el shell does not respect getpass.getpass prompt
@ 2017-05-30 20:50 Diego Fernandez
2017-05-31 18:35 ` Glenn Morris
0 siblings, 1 reply; 7+ messages in thread
From: Diego Fernandez @ 2017-05-30 20:50 UTC (permalink / raw)
To: 27154
[-- Attachment #1: Type: text/plain, Size: 8051 bytes --]
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>!*
[-- Attachment #2: Type: text/html, Size: 10228 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#27154: 25.2; python.el shell does not respect getpass.getpass prompt
2017-05-30 20:50 bug#27154: 25.2; python.el shell does not respect getpass.getpass prompt Diego Fernandez
@ 2017-05-31 18:35 ` Glenn Morris
2017-05-31 18:46 ` Glenn Morris
0 siblings, 1 reply; 7+ messages in thread
From: Glenn Morris @ 2017-05-31 18:35 UTC (permalink / raw)
To: Diego Fernandez; +Cc: 27154
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#27154: 25.2; python.el shell does not respect getpass.getpass prompt
2017-05-31 18:35 ` Glenn Morris
@ 2017-05-31 18:46 ` Glenn Morris
2017-05-31 19:08 ` Diego Fernandez
2017-05-31 23:48 ` npostavs
0 siblings, 2 replies; 7+ messages in thread
From: Glenn Morris @ 2017-05-31 18:46 UTC (permalink / raw)
To: Diego Fernandez; +Cc: 27154
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#27154: 25.2; python.el shell does not respect getpass.getpass prompt
2017-05-31 18:46 ` Glenn Morris
@ 2017-05-31 19:08 ` Diego Fernandez
2017-05-31 19:54 ` Andreas Röhler
2017-05-31 23:48 ` npostavs
1 sibling, 1 reply; 7+ messages in thread
From: Diego Fernandez @ 2017-05-31 19:08 UTC (permalink / raw)
To: Glenn Morris; +Cc: 27154
[-- Attachment #1: Type: text/plain, Size: 1095 bytes --]
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@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>!*
[-- Attachment #2: Type: text/html, Size: 1805 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#27154: 25.2; python.el shell does not respect getpass.getpass prompt
2017-05-31 19:08 ` Diego Fernandez
@ 2017-05-31 19:54 ` Andreas Röhler
0 siblings, 0 replies; 7+ messages in thread
From: Andreas Röhler @ 2017-05-31 19:54 UTC (permalink / raw)
To: 27154
[-- Attachment #1.1: Type: text/plain, Size: 530 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 1258 bytes --]
[-- Attachment #2: passwd.png --]
[-- Type: image/png, Size: 125513 bytes --]
[-- Attachment #3: outside-emacs.png --]
[-- Type: image/png, Size: 86364 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#27154: 25.2; python.el shell does not respect getpass.getpass prompt
2017-05-31 18:46 ` Glenn Morris
2017-05-31 19:08 ` Diego Fernandez
@ 2017-05-31 23:48 ` npostavs
2017-06-03 0:07 ` Glenn Morris
1 sibling, 1 reply; 7+ messages in thread
From: npostavs @ 2017-05-31 23:48 UTC (permalink / raw)
To: Glenn Morris; +Cc: 27154, Diego Fernandez
Glenn Morris <rgm@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@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.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-06-03 0:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-30 20:50 bug#27154: 25.2; python.el shell does not respect getpass.getpass prompt Diego Fernandez
2017-05-31 18:35 ` Glenn Morris
2017-05-31 18:46 ` Glenn Morris
2017-05-31 19:08 ` Diego Fernandez
2017-05-31 19:54 ` Andreas Röhler
2017-05-31 23:48 ` npostavs
2017-06-03 0:07 ` Glenn Morris
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.