Fix up a handful of issues running RBTools on Python 3.

Review Request #9554 — Created Jan. 30, 2018 and submitted

Information

RBTools
master
b366fb3...

Reviewers

This change fixes up a variety of small things that were breaking:

  • Many unit tests were writing binary data to files opened with 'w',
    which doesn't work anymore.
  • The SVN client was applying a binary regex to unicode data. This one
    was just a mistake when I did the unicode conversions.
  • There was a typo in the perforce path detection (use of the name
    pattern instead of p)
  • The command-line logging was exploding because list2cmdline isn't
    written in such a way that it can deal with mixed unicode and
    bytestrings in command lines. The rest of subprocess is fine, it's
    just the logging, so I've changed it to pass in all of that as a
    unicode string.

This change also includes a couple small changes I had made to the
mercurial code trying to massage it into working before I realized how
little Python 3 support hg actually has. I've disabled that part of the
test suite for now.

Ran unit tests.

Description From Last Updated

Why do we do this when the following is clearer and more concise? class Author(object): fullname = 'name' email = …

brenniebrennie

This is perfectly fine, but there's also a handy six.PY3 constant we could use. Nice thing about that is it's …

chipx86chipx86

Given that we're duplicating this, I feel like it'd be a good opportunity to have a utility function of some …

chipx86chipx86
brennie
  1. 
      
  2. rbtools/clients/tests/test_git.py (Diff revision 1)
     
     
     
     
     
     
     
     

    Why do we do this when the following is clearer and more concise?

    class Author(object):
        fullname = 'name'
        email = 'email'
    
    1. I really don't know. Investigating that seemed out of scope for this change.

  3. 
      
david
chipx86
  1. 
      
  2. rbtools/clients/tests/test_mercurial.py (Diff revision 2)
     
     

    This is perfectly fine, but there's also a handy six.PY3 constant we could use. Nice thing about that is it's easily greppable.

  3. rbtools/commands/__init__.py (Diff revision 2)
     
     
     
     
     
     

    Given that we're duplicating this, I feel like it'd be a good opportunity to have a utility function of some sort.

  4. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (1daa626)
Loading...