Add PyUnicode_Copy() function, include it to the public API
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 094ceb7..b19f1b3 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -729,8 +729,7 @@
else if (PyUnicode_Check(*param))
/* For a Unicode subtype that's not a Unicode object,
return a true Unicode object with the same data. */
- *param = PyUnicode_FromUnicode(PyUnicode_AS_UNICODE(*param),
- PyUnicode_GET_SIZE(*param));
+ *param = PyUnicode_Copy(*param);
else
*param = PyUnicode_FromEncodedObject(*param,
Py_FileSystemDefaultEncoding,