Message136271
> Here's a patch:
> - those functions now accept and return str, not bytes arrays
You use UTF-8 encoding:
+ "Is", ni[i].if_index, ni[i].if_name);
+ if (!PyArg_ParseTuple(args, "s:if_nametoindex", &ifname))
You should also use the FS encoding with surrogateescape error handler:
- parse arguments using "O&" format with PyUnicode_FSConverter: it gives you a PyBytes object, then use PyBytes_AS_STRING() and PyBytes_GET_SIZE()
- use PyUnicode_DecodeFSDefault() to decode a byte string |
|
Date |
User |
Action |
Args |
2011-05-19 09:46:53 | vstinner | set | recipients:
+ vstinner, gregory.p.smith, pitrou, christian.heimes, OG7, meiermic, nadeem.vawda, neologix, santoso.wijaya, python-dev |
2011-05-19 09:46:53 | vstinner | set | messageid: <1305798413.89.0.227171793879.issue1746656@psf.upfronthosting.co.za> |
2011-05-19 09:46:53 | vstinner | link | issue1746656 messages |
2011-05-19 09:46:53 | vstinner | create | |
|