Don't try asking for username/password when input is not a terminal

Review Request #7956 — Created Feb. 11, 2016 and submitted

Information

VZ
RBTools
master

Reviewers

This fixes a mysterious "hang" when running rbt using native Windows Python in
a Cygwin terminal emulator such as MinTTY: in this case, password entry doesn't
work correctly and even the prompt is not displayed.


I'm submitting this after wasting half an hour trying to diagnose the problem with "rbt post hanging" before realizing what it was really due to. This may seem to be an unusual case, but it's not the first time I run into it and IMHO it can't make things worse.

Also a question: there is very similar code in utils/users.py which I didn't modify as I don't quite understand when exactly it is used and so couldn't test it. But it probably should be modified in the same way, shouldn't it? Or, perhaps, it could be refactored to reuse the same code in both places?

Ran it from a "normal" DOS window and from MinTTY and got the expected prompt in the former case and the expected error in the latter.

Description From Last Updated

Col: 80 E501 line too long (82 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (82 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (82 > 79 characters)

reviewbotreviewbot

Col: 1 E101 indentation contains mixed spaces and tabs

reviewbotreviewbot

Col: 1 W191 indentation contains tabs

reviewbotreviewbot

Col: 1 W191 indentation contains tabs

reviewbotreviewbot

Col: 2 E101 indentation contains mixed spaces and tabs

reviewbotreviewbot

Col: 1 W191 indentation contains tabs

reviewbotreviewbot

Col: 2 E101 indentation contains mixed spaces and tabs

reviewbotreviewbot

Col: 1 W191 indentation contains tabs

reviewbotreviewbot

Col: 2 E101 indentation contains mixed spaces and tabs

reviewbotreviewbot

Col: 1 W191 indentation contains tabs

reviewbotreviewbot

Col: 2 E101 indentation contains mixed spaces and tabs

reviewbotreviewbot

Col: 1 W191 indentation contains tabs

reviewbotreviewbot

Col: 2 E101 indentation contains mixed spaces and tabs

reviewbotreviewbot

Col: 1 W191 indentation contains tabs

reviewbotreviewbot

Col: 2 E101 indentation contains mixed spaces and tabs

reviewbotreviewbot

Col: 1 E101 indentation contains mixed spaces and tabs

reviewbotreviewbot

flushed

brenniebrennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/commands/__init__.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/commands/__init__.py
    
    
  2. rbtools/commands/__init__.py (Diff revision 1)
     
     
    Show all issues
    Col: 80
     E501 line too long (82 > 79 characters)
    
  3. rbtools/commands/__init__.py (Diff revision 1)
     
     
    Show all issues
    Col: 80
     E501 line too long (82 > 79 characters)
    
  4. rbtools/commands/__init__.py (Diff revision 1)
     
     
    Show all issues
    Col: 80
     E501 line too long (82 > 79 characters)
    
  5. 
      
VZ
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/commands/__init__.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/commands/__init__.py
    
    
  2. rbtools/commands/__init__.py (Diff revision 2)
     
     
    Show all issues
    Col: 1
     E101 indentation contains mixed spaces and tabs
    
  3. rbtools/commands/__init__.py (Diff revision 2)
     
     
    Show all issues
    Col: 1
     W191 indentation contains tabs
    
  4. rbtools/commands/__init__.py (Diff revision 2)
     
     
    Show all issues
    Col: 1
     W191 indentation contains tabs
    
  5. rbtools/commands/__init__.py (Diff revision 2)
     
     
    Show all issues
    Col: 2
     E101 indentation contains mixed spaces and tabs
    
  6. rbtools/commands/__init__.py (Diff revision 2)
     
     
    Show all issues
    Col: 1
     W191 indentation contains tabs
    
  7. rbtools/commands/__init__.py (Diff revision 2)
     
     
    Show all issues
    Col: 2
     E101 indentation contains mixed spaces and tabs
    
  8. rbtools/commands/__init__.py (Diff revision 2)
     
     
    Show all issues
    Col: 1
     W191 indentation contains tabs
    
  9. rbtools/commands/__init__.py (Diff revision 2)
     
     
    Show all issues
    Col: 2
     E101 indentation contains mixed spaces and tabs
    
  10. rbtools/commands/__init__.py (Diff revision 2)
     
     
    Show all issues
    Col: 1
     W191 indentation contains tabs
    
  11. rbtools/commands/__init__.py (Diff revision 2)
     
     
    Show all issues
    Col: 2
     E101 indentation contains mixed spaces and tabs
    
  12. rbtools/commands/__init__.py (Diff revision 2)
     
     
    Show all issues
    Col: 1
     W191 indentation contains tabs
    
  13. rbtools/commands/__init__.py (Diff revision 2)
     
     
    Show all issues
    Col: 2
     E101 indentation contains mixed spaces and tabs
    
  14. rbtools/commands/__init__.py (Diff revision 2)
     
     
    Show all issues
    Col: 1
     W191 indentation contains tabs
    
  15. rbtools/commands/__init__.py (Diff revision 2)
     
     
    Show all issues
    Col: 2
     E101 indentation contains mixed spaces and tabs
    
  16. rbtools/commands/__init__.py (Diff revision 2)
     
     
    Show all issues
    Col: 1
     E101 indentation contains mixed spaces and tabs
    
  17. 
      
VZ
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        rbtools/commands/__init__.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        rbtools/commands/__init__.py
    
    
  2. 
      
brennie
  1. 
      
  2. rbtools/commands/__init__.py (Diff revision 3)
     
     
    Show all issues

    flushed

    1. Oops, thanks for noticing.

  3. 
      
VZ
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/commands/__init__.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/commands/__init__.py
    
    
  2. 
      
david
  1. I'm going to push this with a couple small changes (one of which to add the same fix to utils/users.py). Thanks!

  2. 
      
VZ
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.7.x (105f415)