[py2.py3] add function to coerce strings to six.binary_type#16
[py2.py3] add function to coerce strings to six.binary_type#16anthrotype wants to merge 2 commits intotarruda:masterfrom
Conversation
python-autopxd already requires six, but the new `ensure_binary` function is only in the git repo and hasn't been released to PyPI yet, so I temporarily copied it here. The source comes from: benjaminp/six#204 It's a trivial function (every py2.py3 project has its own way to do the same thing). Fixes tarruda#12 Supersedes tarruda#3
|
(sorry for the typos, pressed the button too early ;) |
|
I'm using UTF-8 as default encoding, which is also the one implied by the line in 2018 I think it's ok to assume that text files will be encoded in utf-8. If we really care, we could add an |
on py2, stdout is a bytes stream, on py3 it is a unicode text stream
|
Hello, I used your nice fix in https://github.com/gabrieldemarmiesse/python-autopxd2. |
|
@gabrieldemarmiesse thanks, but why did you have to fork? Is the upstream project unmaintained? @tarruda maybe you could add @gabrieldemarmiesse as a collaborator if you don't have time to maintain this any more, so he could give you a hand? |
|
It seems there are quite a few unresolved issues in this repo. That's why I assumed it wasn't maintained. But I have the time to maintain it if I am a colaborator. I would then drop the fork. |
This patch is required to run python-autopxd on python3, as well as to python2.7 when a header file contains some non-ascii character.
python-autopxd already requires six, however the new
ensure_binaryfunction is currently only in the six git repository and hasn't been released to PyPI yet, therefore I temporarily copied it here.The source comes from: benjaminp/six#204
It's a trivial function (every py2.py3 project has its own way to do the same thing).
Fixes #12
Supersedes #3