Serhiy Storchaka added the comment:

This is because grp.struct_group contains unhashable component (a list).

Same behavior with tuple:

>>> tuple(grp.getgrgid(1000))
('serhiy', 'x', 1000, [])
>>> set(tuple(grp.getgrgid(1000)))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'
>>> set([tuple(grp.getgrgid(1000))])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'

Instead a set of grp.struct_group, create a dict, which maps group name to 
grp.struct_group.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22513>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to