This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author loewis
Recipients amaury.forgeotdarc, loewis, ocean-city, rpetrov
Date 2008-09-24.18:42:04
SpamBayes Score 1.1934898e-14
Marked as misclassified No
Message-id <48DA89F9.8050707@v.loewis.de>
In-reply-to <1222257647.34.0.460201367742.issue3824@psf.upfronthosting.co.za>
Content
> 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.
History
Date User Action Args
2008-09-24 18:45:14loewissetrecipients: + loewis, amaury.forgeotdarc, ocean-city, rpetrov
2008-09-24 18:42:05loewislinkissue3824 messages
2008-09-24 18:42:04loewiscreate