1

Like the title says I am tryin gto use the getpass library with sublime text (and SublimeREPL.) When I run a simple piece of code, I get nothing but a blank screen in the sublime terminal and the REPL terminal. Is there any way to get getpass to work with sublime text? I ran the same code in powershell python and it worked just fine.

import getpass
psswd = getpass.getpass(prompt = 'Password:')
Xantium
  • 11,201
  • 10
  • 62
  • 89

1 Answers1

0

No. Sublime text provides the basic terminal functions, not an actual complete terminal.

Because some of the essential components of terminals are not reproduced in REPL or Sublime You cannot run getpass correctly from them.

You are best off sticking with the CMD or PowerShell.

Likewise for the Python IDLE:

>>> import getpass
>>> psswd = getpass.getpass(prompt = 'Password:')

    Warning (from warnings module):
      File "C:\Users\Simon\AppData\Local\Programs\Python\Python36-32\lib\getpass.py", line 100
        return fallback_getpass(prompt, stream)
    GetPassWarning: Can not control echo on the terminal.
    Warning: Password input may be echoed.
    Password:

The Python documentation warns you of this:

If echo free input is unavailable getpass() falls back to printing a warning message to stream and reading from sys.stdin and issuing a GetPassWarning.

https://docs.python.org/3/library/getpass.html

Xantium
  • 11,201
  • 10
  • 62
  • 89