Fix "Issue 3787: "TypeError: must be char, not unicode" when installing reviewboard on windows."

Review Request #6983 — Created Feb. 27, 2015 and submitted

Information

Review Board
master
a28b28d...

Reviewers

Fix "Issue 3787: "TypeError: must be char, not unicode" when installing reviewboard on windows."

Reviewboard does not display the diff: "original - rev 2" correctly.
Please first have a look at the diff: "original - rev 1" to see the fixed problem.

What's the URL of the page containing the problem?
Reviewboard/cmdline/rbsite.py

What steps will reproduce the problem?
in windows command line:
1. easy_install reviewboard
2. rb-site install D:\reviewboard\www
reviewboard will propt for the following variables
1. Domain: "Domain"
2. Path: "/reviewboard/"
3. DB Name: "reviewboard"
4. DB Server: "domain"
5. DB User: "user"

What is the expected output? What do you see instead?
After step 2.5. the db password should be prompted
Instead the exception is thrown.

Please provide any additional information below.
Traceback (most recent call last):
  File "C:\Python27\Scripts\rb-site-script.py", line 9, in <module>
    load_entry_point('ReviewBoard==2.0.13', 'console_scripts', 'rb-site')()
  File "C:\Python27\lib\site-packages\reviewboard-2.0.13-py2.7.egg\reviewboard\cmdline\rbsite.py", line 1883, in main
    command.run()
  File "C:\Python27\lib\site-packages\reviewboard-2.0.13-py2.7.egg\reviewboard\cmdline\rbsite.py", line 1225, in run
    self.ask_database_login()
  File "C:\Python27\lib\site-packages\reviewboard-2.0.13-py2.7.egg\reviewboard\cmdline\rbsite.py", line 1438, in ask_database_login
    save_obj=site, save_var="db_pass")
  File "C:\Python27\lib\site-packages\reviewboard-2.0.13-py2.7.egg\reviewboard\cmdline\rbsite.py", line 942, in prompt_input
    temp_value = getpass.getpass(prompt)
  File "C:\Python27\lib\getpass.py", line 95, in win_getpass
    msvcrt.putch(c)
TypeError: must be char, not unicode

Verified execution in command line

Description From Last Updated

Col: 52 E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot

Col: 54 E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot

Col: 76 E231 missing whitespace after ','

reviewbotreviewbot

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

reviewbotreviewbot

Please sort these alphabetically.

daviddavid
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/cmdline/rbsite.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/cmdline/rbsite.py
    
    
  2. reviewboard/cmdline/rbsite.py (Diff revision 1)
     
     
    Show all issues
    Col: 52
     E251 unexpected spaces around keyword / parameter equals
    
  3. reviewboard/cmdline/rbsite.py (Diff revision 1)
     
     
    Show all issues
    Col: 54
     E251 unexpected spaces around keyword / parameter equals
    
  4. reviewboard/cmdline/rbsite.py (Diff revision 1)
     
     
    Show all issues
    Col: 76
     E231 missing whitespace after ','
    
  5. reviewboard/cmdline/rbsite.py (Diff revision 1)
     
     
    Show all issues
    Col: 80
     E501 line too long (86 > 79 characters)
    
  6. 
      
ST
ST
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/cmdline/rbsite.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/cmdline/rbsite.py
    
    
  2. 
      
ST
Chester
    1. Could you please modify the description to make it more clear?
    2. Please add how the problem rises and why it can be solved by the change.
    3. Would this change cause error(s) in other environments?
    4. You should probably add a unit test for the change.
    5. I also left some comments on the issue page.
    1. I do not know why it appears, but it is a common problem with getpass:
      * https://code.djangoproject.com/ticket/19807
      * https://code.djangoproject.com/ticket/22364
      * https://bitbucket.org/ZyX_I/gibiexport/issue/2/error-getting-password-on-windows

      I only have windows running and do not see a problem.

      Unfortunately, I'm no pro at python and never wanted to be one. But since there were a few problems I just wanted to fix and contribute every problem I stumpled across. Therefore, I do not know how to test this thing.

  1. 
      
ST
ST
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/cmdline/rbsite.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/cmdline/rbsite.py
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/cmdline/rbsite.py (Diff revision 3)
     
     
     
     
    Show all issues

    Please sort these alphabetically.

  3. 
      
ST
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/cmdline/rbsite.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/cmdline/rbsite.py
    
    
  2. 
      
ST
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (d5c710a)