08.09.21 08:19, David Mertz, Ph.D. пише:
> I attempted to do this today, as my first actual contribution to CPython
> itself.  I think the prior attempt went down a wrong path, which is why
> neither PR could actually pass tests.
> 
> I've been looking at `posixmodule.c` for comparison, specifically.

The code in posixmodule.c is a bad example, because it is too general
and supports many options. It gives the patch as char* and wchat_t* (on
Windows), supports file descriptors and None, and format error messages
for functions supporting multiple types. But if you only need a path as
char*, you can just use PyUnicode_FSConverter().

There is an existing PR for this issue. It looks correct in general, but
I left some comments.

_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/LQGU6DM5ZSDPCAXKLEII6YIF4HQI52NG/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to