getpass.getpass on Windows

864 views
Skip to first unread message

Doug Bonar

unread,
Mar 4, 2013, 8:33:51 AM3/4/13
to spyd...@googlegroups.com
import getpass
getpass.getpass()

hangs Spyder (2.1.11) when running on Windows.  Googling around, it seems to be a known problem, but I wasn't able to find any workaround.  Is there a fix / patch?  If not, it there a suggested alternative way to get user entered passwords?

Thanks,

Carlos Córdoba

unread,
Mar 5, 2013, 11:33:34 AM3/5/13
to spyd...@googlegroups.com
I'm sorry but I think there is no alternative or workaround for using
getpass because it seems to need a real terminal to do its job.

Here is some advice that could help you:

http://stackoverflow.com/questions/4826732/how-to-redirect-data-to-a-getpass-like-password-input

Cheers,
Carlos

El 04/03/13 08:33, Doug Bonar escribió:
> --
> You received this message because you are subscribed to the Google
> Groups "spyder" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to spyderlib+...@googlegroups.com.
> To post to this group, send email to spyd...@googlegroups.com.
> Visit this group at http://groups.google.com/group/spyderlib?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Doug Bonar

unread,
Mar 5, 2013, 1:50:19 PM3/5/13
to spyd...@googlegroups.com
Thanks,

What I will likely do is put a text input dialog into the ExternalPythonShell class and pass the given password down to the external shell.   Pretty ugly, but I think I can make it work. 

On a related note, is there any thought of adding a hook to ExternalPythonShell.send_to_process so that new commands can be added w/o replicating the logic of the method?  Assuming I do go with a dialog box widget, it would be nice to be able to have a shell command, e.g. %password, which popped up the dialog and then passed the response down to the external shell wrapped in something more specific than 'evalsc' .  (Obviously, I would have to add the new external shell command in my startup script).

Doug
Reply all
Reply to author
Forward
0 new messages