Martin v. Löwis <[EMAIL PROTECTED]> added the comment: > Doesn't getgrgid() return the untranslated content of /etc/group? > Then the encoding of this file is relevant.
That certainly depends on the implementation of getgrgid. On some systems, it uses NIS, LDAP, or a relational database in addition to or instead of /etc/group. I don't think POSIX specifies the charset of gr_name, except perhaps implicitly by inheriting the notion of "execution character set" from C, which proposes that all char* should have the same interpretation. In POSIX, the character set comes from the locale. The getgrid man page gives an example demonstrating that you are supposed to be able to printf() gr_name using %s, which suggests that it should have the locale's encoding. In Cygwin, I have no doubt that the implementation literally copies the encoding untranslated. I would claim this to be a bug in Cygwin. A quality POSIX implementation would convert the /etc/group encoding to the locale's encoding (just as it should when fetching the data from LDAP). > Maybe we should start considering cygwin as a posix platform with win32 > features; but I am not sure to like this idea. If it is desired that we support this specific implementation aspect, we can certainly special-case Cygwin in getgrgid. However, I would prefer if this issue was discussed with the Cygwin people first, suggesting that it might be a Cygwin bug (one that it certainly shares with many other POSIX implementations - people just don't use non-ASCII characters in /etc/group). If Cygwin ever changes its implementation in that respect, we would need to have a way for telling which specific implementation is being used. _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3824> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com