This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients OG7, christian.heimes, gregory.p.smith, meiermic, nadeem.vawda, neologix, pitrou, python-dev, santoso.wijaya, vstinner
Date 2011-05-19.09:46:53
SpamBayes Score 2.8939064e-07
Marked as misclassified No
Message-id <1305798413.89.0.227171793879.issue1746656@psf.upfronthosting.co.za>
In-reply-to
Content
> 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
History
Date User Action Args
2011-05-19 09:46:53vstinnersetrecipients: + vstinner, gregory.p.smith, pitrou, christian.heimes, OG7, meiermic, nadeem.vawda, neologix, santoso.wijaya, python-dev
2011-05-19 09:46:53vstinnersetmessageid: <1305798413.89.0.227171793879.issue1746656@psf.upfronthosting.co.za>
2011-05-19 09:46:53vstinnerlinkissue1746656 messages
2011-05-19 09:46:53vstinnercreate