Message190716
>>> getpass.getpass('Password: ', open('/dev/stdout', 'w'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/serhiy/py/cpython/Lib/getpass.py", line 72, in unix_getpass
passwd = _raw_input(prompt, stream, input=input)
File "/home/serhiy/py/cpython/Lib/getpass.py", line 143, in _raw_input
stream.write(bytes(prompt, tty_encoding))
TypeError: must be str, not bytes
It seems that you are moving in the wrong direction. No need to test explicitly for stdout/stderr/etc, the code should work with arbitrary text stream. |
|
Date |
User |
Action |
Args |
2013-06-06 14:32:39 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, pitrou, benjamin.peterson, stutzbach, alex, nikratio, hynek, vajrasky |
2013-06-06 14:32:39 | serhiy.storchaka | set | messageid: <1370529159.64.0.556954939527.issue18116@psf.upfronthosting.co.za> |
2013-06-06 14:32:39 | serhiy.storchaka | link | issue18116 messages |
2013-06-06 14:32:39 | serhiy.storchaka | create | |
|