Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Fix python3-ism with byte v. str #56

Closed
wants to merge 4 commits into from

Conversation

rustyhowell
Copy link

Also make the example in the README a bit more universal.

Also make the example in the README a bit more universal.
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@rustyhowell
Copy link
Author

I signed it!

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@coveralls
Copy link

coveralls commented Sep 12, 2017

Coverage Status

Coverage decreased (-0.9%) to 47.193% when pulling 5de7928 on rustyhowell:rhowell_python3 into cb4ae46 on google:master.

@fahhem
Copy link
Contributor

fahhem commented Jan 30, 2018

The tests failed because the % will convert a bytes string to "b\'<original string>\'", which isn't expected (and wrong). If you fix that, I'll merge it ASAP

@fahhem
Copy link
Contributor

fahhem commented Feb 26, 2018

Ping? Is this worth merging still?

The default value is a bytearray. So if the value is a str,
just convert it to a bytearray before continuing.

In py3, this converts unicode str to bytes. In py2, this converts
bytes to bytearray, which is then just joined back into bytes.
@rustyhowell
Copy link
Author

I believe this is fixed. You should be able to merge it.

@fahhem
Copy link
Contributor

fahhem commented Oct 4, 2018

Is this necessary with #128 merged in?

@rustyhowell
Copy link
Author

Probably not anymore. It looks like #128 has my changes in it.

@rustyhowell rustyhowell closed this Oct 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants