ctypes: Fix ctypesgencore for Python 3#379
Conversation
Python 3 sort says 'must use keyword argument for key function' (Python 2 accepts this new syntax). The parameter of Signature.update() is used as a hash, so any encoding will do, but using UTF-8 always for consistency.
|
The issue emerged on Ubuntu 18.04 when I was testing CMake build from #348 and it turned out it is the same fix as in #357 with an encoding change (which should be minor in this case). So this replaces #357 which cannot be merged as is. This may trigger update of lib/python/ctypes/ctypesgencore/parser/parsetab.py on some systems. It did for me on Ubuntu 18.04, but not on Ubuntu 16.04. I also don't understand when these changes should be committed if at all (some local developer's paths are in parsetab.py). So, I'm not including any of these changes and I'm suggesting to see what happens when they land in master, unless somebody has a different suggestion. (For the review, I'm just asking for feedback the changes I made, not this broader parsetab.py issue.) |
|
As I had already tested this change on a ubuntu and windows msvc, I think it can be merged :) |
|
Thank you both for the reviews! |
|
@wenzeslaus should this (not) be backported? |
|
Backport? Maybe, it is probably really needed only for CMake since macOS seems to have similar but different issues. I would suggest to wait couple days if we see people having problems with changes that parsetab.py file. |
|
ok, I leave it to you then. |
Python 3 sort says 'must use keyword argument for key function'
(Python 2 accepts this new syntax).
The parameter of Signature.update() is used as a hash, so any encoding will do,
but using UTF-8 always for consistency.