popen and unicode

Neil Hodgson nhodgson at bigpond.net.au
Tue May 25 17:44:23 EDT 2004


Stuart McGraw:

> Does os.popen() work with unicode strings containing characters outside
> the ASCII range?  (I think I answered my own question, above.)

   There is no Unicode support in the current implementation of popen. This
could be added in a similar way to the Unicode file name support but it is
more work than I currently have time for. If you are interested in fixing
this, the code is in dist/src/Modules/posixmodule.c _PyPopenCreateProcess.

> How can I call popen to process non-ascii filenames on a Windows box?
> Is there anything else I could use (e.g. spawn) that will work with
unicode
> filnames?

   You can use ctypes to call the underlying platform APIs.

   Neil





More information about the Python-list mailing list