On Sun, Sep 3, 2017 at 9:58 AM, Giampaolo Rodola' <g.rod...@gmail.com> wrote: > > - #1040: all strings are encoded by using OS fs encoding. > - #1040: the following Windows APIs on Python 2 now return a string instead > of > unicode: > - Process.memory_maps().path > - WindowsService.bin_path() > - WindowsService.description() > - WindowsService.display_name() > - WindowsService.username()
This seems wrong. User names, file paths, registry strings, etc are all Unicode in Windows. One cannot in general encode them as the legacy (as in it really should be avoided) 'mbcs' encoding, i.e. ANSI. Using the 'replace' handler will make a mess with best-fit replacements and question marks. For example, _winreg in Python 2 has to return unicode strings and always has, which should be the precedent for psutil. Python 2 code that supports Windows has to be able to handle this. -- https://mail.python.org/mailman/listinfo/python-list