[issue33242] Support binary symbol names

2018-04-08 Thread Eryk Sun
Eryk Sun added the comment: If you're automatically wrapping a C source file and don't know the source encoding, you could naively decode it as Latin-1. You're still faced with the problem of characters that Python doesn't allow in identifiers. For example, gcc allows "$"

[issue33242] Support binary symbol names

2018-04-08 Thread Matthias Urlichs
Matthias Urlichs added the comment: Well, the original problem remains: symbol names aren't constrained to UTF-8 … so if I happen to stumble onto one of those (maybe generated by a code obfuscator), the answer is "don't use Python3 then"? --

[issue33242] Support binary symbol names

2018-04-08 Thread Eryk Sun
Change by Eryk Sun : -- resolution: not a bug -> rejected ___ Python tracker ___ ___

[issue33242] Support binary symbol names

2018-04-08 Thread Eryk Sun
Eryk Sun added the comment: Field names define CField descriptor attributes on the class. Attribute names should be strings, not bytes. There's no syntactically clean way to use a bytes name. Consider the example of a generic property on a class: >>> T = type('T', (),

[issue33242] Support binary symbol names

2018-04-08 Thread Ned Deily
Change by Ned Deily : -- nosy: +amaury.forgeotdarc, belopolsky, meador.inge ___ Python tracker ___

[issue33242] Support binary symbol names

2018-04-08 Thread Matthias Urlichs
New submission from Matthias Urlichs : ctypes should support binary symbols. Rationale: There's no requirement that the symbol name in question is encoded as ASCII or UTF-8. >>> import ctypes >>> t = type('iface', (ctypes.Structure,), {'_fields_': [(b'c_string_symbol',