• 
      

    Fix Issue 3789: "UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 92: ordinal not in range(128)" sending an email on Windows

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

    Information

    Review Board
    master
    516bce8...

    Reviewers

    Fix Issue 3789: "UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 92: ordinal not in range(128)" sending an email on Windows.

    Problem is that the windows exception text can contain Umlauts, which brakes the logging.

    This way of error logging of exceptions is used in many classes of RB.

    Someone should refactor all these occurences, becuase they might not be save!

    Testing in Application

    Description From Last Updated

    local variable 'e' is assigned to but never used

    reviewbotreviewbot

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

    reviewbotreviewbot

    Col: 23 E128 continuation line under-indented for visual indent

    reviewbotreviewbot

    Col: 23 E128 continuation line under-indented for visual indent

    reviewbotreviewbot

    Col: 27 E126 continuation line over-indented for hanging indent

    reviewbotreviewbot

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

    reviewbotreviewbot

    Col: 9 E124 closing bracket does not match visual indentation

    reviewbotreviewbot
    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/notifications/email.py
      
      
      
      Tool: Pyflakes
      Processed Files:
          reviewboard/notifications/email.py
      
      
    2. reviewboard/notifications/email.py (Diff revision 1)
       
       
      Show all issues
       local variable 'e' is assigned to but never used
      
    3. reviewboard/notifications/email.py (Diff revision 1)
       
       
      Show all issues
      Col: 80
       E501 line too long (83 > 79 characters)
      
    4. reviewboard/notifications/email.py (Diff revision 1)
       
       
      Show all issues
      Col: 23
       E128 continuation line under-indented for visual indent
      
    5. reviewboard/notifications/email.py (Diff revision 1)
       
       
      Show all issues
      Col: 23
       E128 continuation line under-indented for visual indent
      
    6. 
        
    ST
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/notifications/email.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/notifications/email.py
      
      
    2. reviewboard/notifications/email.py (Diff revision 2)
       
       
      Show all issues
      Col: 27
       E126 continuation line over-indented for hanging indent
      
    3. reviewboard/notifications/email.py (Diff revision 2)
       
       
      Show all issues
      Col: 80
       E501 line too long (83 > 79 characters)
      
    4. 
        
    ST
    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/notifications/email.py
      
      
      
      Tool: Pyflakes
      Processed Files:
          reviewboard/notifications/email.py
      
      
    2. 
        
    david
    1. I don't actually see any substantive changes in your diff.

      1. You have to look at the diff between original and Rev 1.
        There you see that an error is logged were the Exception is concatinated to the Message string.

        When the exception contains non-encoded chars (e.g. ö,ä,ü) the UnicodeDecodeError is thrown.

        To fix this logger.error is replaced by logger.exception. More important the exception is removed from the error message. (Will be logged automatically by logger.exception (https://docs.python.org/2/library/logging.html)

        I hope it is now clearer.
        -Stefan

      2. As people noted in one of your other changes, we need the diff between orig and the latest to be your full change (rbt patch can't apply interdiffs). Please post the diff between master and your branch tip.

    2. 
        
    ST
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/notifications/email.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/notifications/email.py
      
      
    2. reviewboard/notifications/email.py (Diff revision 4)
       
       
      Show all issues
      Col: 9
       E124 closing bracket does not match visual indentation
      
    3. 
        
    ST
    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/notifications/email.py
      
      
      
      Tool: Pyflakes
      Processed Files:
          reviewboard/notifications/email.py
      
      
    2. 
        
    david
    1. Ship It!
    2. 
        
    ST
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-2.0.x (41e81a7)