{"push_id":1960574439,"size":1,"distinct_size":1,"ref":"refs/heads/2.7","head":"990b2d043cdfaafc3378550f7d27259410a6b918","before":"20958e6d91d11a80d6c664ce6346791259b1d193","commits":[{"sha":"990b2d043cdfaafc3378550f7d27259410a6b918","author":{"name":"Pauli Virtanen","email":"eabfc2cdbb9d048830db18d9388d318bffed5b64@iki.fi"},"message":"[2.7] bpo-10746: Fix ctypes PEP 3118 type codes for c_long, c_bool, c_int (GH-31) (#3242)\n\n[2.7] bpo-10746: Fix ctypes PEP 3118 type codes for c_long, c_bool, c_int (GH-31)\r\n\r\nCtypes currently produces wrong pep3118 type codes for several types.\r\nE.g. memoryview(ctypes.c_long()).format gives \"<l\" on 64-bit platforms,\r\nbut it should be \"<q\" instead for sizeof(c_long) == 8\r\n\r\nThe problem is that the '<>' endian specification in the struct syntax\r\nalso turns on the \"standard size\" mode, which makes type characters have\r\na platform-independent meaning, which does not match with the codes used\r\ninternally in ctypes.  The struct module format syntax also does not\r\nallow specifying native-size non-native-endian items.\r\n\r\nThis commit adds a converter function that maps the internal ctypes\r\ncodes to appropriate struct module standard-size codes in the pep3118\r\nformat strings. The tests are modified to check for this..\r\n(cherry picked from commit 07f1658aa09f6798793c473c72b2951b7fefe220)","distinct":true,"url":"https://api.github.com/repos/kzlin129/cpython/commits/990b2d043cdfaafc3378550f7d27259410a6b918"}]}
{"actor":{"display_login":"kzlin129"}}