@@ -1380,6 +1380,11 @@ makebdaddr(bdaddr_t *bdaddr)
13801380}
13811381#endif
13821382
1383+ PyObject *
1384+ unicode_fsdecode (void * arg )
1385+ {
1386+ return PyUnicode_DecodeFSDefault ((const char * )arg );
1387+ }
13831388
13841389/* Create an object representing the given socket address,
13851390 suitable for passing it back to bind(), connect() etc.
@@ -1616,7 +1621,7 @@ makesockaddr(SOCKET_T sockfd, struct sockaddr *addr, size_t addrlen, int proto)
16161621#ifdef CAN_ISOTP
16171622 case CAN_ISOTP :
16181623 {
1619- return Py_BuildValue ("O&kk" , PyUnicode_DecodeFSDefault ,
1624+ return Py_BuildValue ("O&kk" , unicode_fsdecode ,
16201625 ifname ,
16211626 a -> can_addr .tp .rx_id ,
16221627 a -> can_addr .tp .tx_id );
@@ -1625,7 +1630,7 @@ makesockaddr(SOCKET_T sockfd, struct sockaddr *addr, size_t addrlen, int proto)
16251630#ifdef CAN_J1939
16261631 case CAN_J1939 :
16271632 {
1628- return Py_BuildValue ("O&KIB" , PyUnicode_DecodeFSDefault ,
1633+ return Py_BuildValue ("O&KIB" , unicode_fsdecode ,
16291634 ifname ,
16301635 (unsigned long long )a -> can_addr .j1939 .name ,
16311636 (unsigned int )a -> can_addr .j1939 .pgn ,
@@ -1634,7 +1639,7 @@ makesockaddr(SOCKET_T sockfd, struct sockaddr *addr, size_t addrlen, int proto)
16341639#endif /* CAN_J1939 */
16351640 default :
16361641 {
1637- return Py_BuildValue ("(O&)" , PyUnicode_DecodeFSDefault ,
1642+ return Py_BuildValue ("(O&)" , unicode_fsdecode ,
16381643 ifname );
16391644 }
16401645 }
@@ -7161,7 +7166,7 @@ socket_if_nameindex(PyObject *self, PyObject *arg)
71617166 }
71627167#endif
71637168 PyObject * ni_tuple = Py_BuildValue ("IO&" ,
7164- ni [i ].if_index , PyUnicode_DecodeFSDefault , ni [i ].if_name );
7169+ ni [i ].if_index , unicode_fsdecode , ni [i ].if_name );
71657170
71667171 if (ni_tuple == NULL || PyList_Append (list , ni_tuple ) == -1 ) {
71677172 Py_XDECREF (ni_tuple );
0 commit comments