Message227811
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. |
|
Date |
User |
Action |
Args |
2014-09-29 17:19:31 | ethan.furman | set | recipients:
+ ethan.furman |
2014-09-29 17:19:31 | ethan.furman | set | messageid: <1412011171.66.0.600285567527.issue22513@psf.upfronthosting.co.za> |
2014-09-29 17:19:31 | ethan.furman | link | issue22513 messages |
2014-09-29 17:19:31 | ethan.furman | create | |
|