-
-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for Mach-O using byte strings to allow case of non unicode chars #635
Check for Mach-O using byte strings to allow case of non unicode chars #635
Conversation
I have a further patch that gets If you want I can roll the addition of |
That is my patch. It was untested and I forget to declare this. In the issue #529 I requested tests but no one answered. As you use mac, if you find it better to revert the patch and you fix the issue, I even prefer it. |
I actually had #529 and had a different fix. Rather than not decoding I did this instead
Here I assume that if we can't decode it is not Mach-O. Which fixes #529 in my case I am not sure what the original case was. We have two choice
Which would you prefer? |
I reverted my patch. Please send your patch, your approach is ok to me, the option 2. |
I have made this pull request work as indicated in option 2. Fixes #529 |
Actually I am thinking of an option 3. Use str everywhere except when testing for Mach-O this will let us test for Mach-O in files with non unicode bytes, while still not requiring many changes |
ok, put it in another PR |
A completely separate PR? Or ammend this one? |
Can be in this PR, but change the title to not confuse anthony. |
Latest commit is using option number 3. This allows searching for Mach-O even if there are non unicode chars but keeps the rest of the code as str |
The recent change of not encoding byte strings in bdist_mac is breaking the build. Methods using bytes should not be mixed with str. This patch unifies the relevant code to use all bytes.
NOTE: There is one step where I choose to
decode
This is because
The
fileName
is generated from typestr
(fromos.walk
) but when we add extra files in the loop they were added as type bytes.Currently I decode back to string then append to the list, but alternatively it may be better to encode the results of
os.walk
so that it is all bytes throughout.