Skip to content

Commit

Permalink
move getpass import inside try/except for win32 support
Browse files Browse the repository at this point in the history
  • Loading branch information
bitprophet authored and ploxiln committed Nov 27, 2018
1 parent 35ee4f3 commit 722b38f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fabric/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def _get_system_username():
"""
Obtain name of current system user, which will be default connection user.
"""
import getpass
username = None
try:
import getpass
username = getpass.getuser()
# getpass.getuser supported on both Unix and Windows systems.
# getpass.getuser may call pwd.getpwuid which in turns may raise KeyError
Expand Down
3 changes: 3 additions & 0 deletions sites/www/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Changelog
`~fabric.contrib.files.upload_template` when backing up the target file,
preventing issues on simpler remote shells. Patch courtesy of Paul
Chakravarti.
* :bug:`983` Move a ``getpass`` import inside a Windows-oriented
``try``/``except ImportError`` so password prompting is less likely to
explode on certain systems. Thanks to ``@dongweiming`` for the patch.
* :support:`- backported` Update packaging metadata so wheel archives include
the ``LICENSE`` file.
* :release:`1.14.0 <2017-08-25>`
Expand Down

0 comments on commit 722b38f

Please sign in to comment.