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 ethan.furman
Recipients ethan.furman
Date 2014-09-29.17:19:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1412011171.66.0.600285567527.issue22513@psf.upfronthosting.co.za>
In-reply-to
Content
First, the behavior for pwd.struct_passwd:
-----------------------------------------
--> pwd.getpwuid(1000)
pwd.struct_passwd(pw_name='ethan', pw_passwd='x', pw_uid=1000, pw_gid=1000, pw_gecos='Ethan Furman,,,', pw_dir='/home/ethan', pw_shell='/bin/bash')

--> set(pwd.getpwuid(1000))
set(['/bin/bash', 1000, 'Ethan Furman,,,', '/home/ethan', 'ethan', 'x'])

--> set([pwd.getpwuid(1000)])
set([pwd.struct_passwd(pw_name='ethan', pw_passwd='x', pw_uid=1000, pw_gid=1000, pw_gecos='Ethan Furman,,,', pw_dir='/home/ethan', pw_shell='/bin/bash')])

Now, the behavior for grp.struct_group:
--------------------------------------
--> grp.getgrgid(1000)
grp.struct_group(gr_name='ethan', gr_passwd='x', gr_gid=1000, gr_mem=[])

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

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


At the very least the error message is wrong (it's not a list), and at the most grp.struct_group should be hashable  -- i.e. we should be able to have a set of groups.
History
Date User Action Args
2014-09-29 17:19:31ethan.furmansetrecipients: + ethan.furman
2014-09-29 17:19:31ethan.furmansetmessageid: <1412011171.66.0.600285567527.issue22513@psf.upfronthosting.co.za>
2014-09-29 17:19:31ethan.furmanlinkissue22513 messages
2014-09-29 17:19:31ethan.furmancreate