Fix errors Perforce post error when running under Python 3

Review Request #11061 — Created June 27, 2020 and updated

c0d3h4x0r
RBTools
release-1.0.x
rbtools
chipx86

Python 3 string must be encoded to bytes before being fed to p4.

Manually verified on Windows, Linux, and macOS that this resolves the error we were hitting when using Python 3.
Manually verified that this also still works fine for the same scenario when using Python 2.

Summary Author
Refine the previous fix.
Keith Kelly
Added encoding for the input for the perforce command
Chris Otey
Fix bad argument order.
Keith Kelly
Description From Last Updated

Hi Kelly. I saw your post on the pull request thread. We don't use GitHub for anything more than storing ...

chipx86chipx86
Checks run (2 succeeded)
flake8 passed.
JSHint passed.
chipx86
  1. 
      
  2. Hi Kelly.

    I saw your post on the pull request thread. We don't use GitHub for anything more than storing the source code repositories, so communication about a review request is best done here.

    I took a look at this last week and it we will be landing it shortly. It does conflict with some work we're doing that also addresses the same problem (fixed by moving the raw Popen() calls to use our common execute() method, adding the ability for raw input at the same time, since execute() knows about encoding differences), but I want to make sure you receive credit for the fix, so we'll be landing this first.

    As for why it appears to have not had any traction, it's just that we're not in release mode yet for the next patch release for RBTools (that will be coming up in about a week). We've also been busy between the 3.0.18 release, upcoming 4.0 beta, and taking care of some requirements from our support contract customers. It'll be in soon, though.

    1. It's Keith, actually -- Kelly is my last name. :)

      This is good news, because it means the private fork-and-build we had to do to unblock ourselves won't be putting us into a permanent state of having to maintain our own fork. That was my biggest concern.

      Thanks!

    2. Ack, I'm so sorry. Keith, my mistake.

      I definitely don't want you to have to maintain it indefinitely :) Next week is the goal. We've had it in testing with some customers, and things are looking stable so far, so I think we're good on a release.

      And I will make sure I get your name right on the release notes.

  3. 
      
Loading...