Antoine Pitrou added the comment:
Agreed with David's latest analysis.
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18678
___
R. David Murray added the comment:
Revisiting this with fresh eyes, I no longer think this was a typo, and I think
we shouldn't have changed it and should change it back (but keep the 'p' names
as aliases for those who expect the man page names to be valid).
My logic is: 'sp_namp' is so named
Roundup Robot added the comment:
New changeset 1b0ca1a7a3ca by R David Murray in branch 'default':
#18678: Correct names of spwd struct members.
http://hg.python.org/cpython/rev/1b0ca1a7a3ca
--
nosy: +python-dev
___
Python tracker
R. David Murray added the comment:
Thanks, Vajrasky. I elected to apply this only to default, since it hasn't
caused any real-world problems. The (small but non-zero) chance of breaking
someone's code in the maintenance releases doesn't seem justified by the nature
of the fix.
--
Changes by R. David Murray rdmur...@bitdance.com:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18678
___
___
Vajrasky Kok added the comment:
I think giving deprecation message when accessing incorrect attribute from spwd
struct is not practical. You're right, R. David Murray, as you can see in
spwd_struct_members_name_fix_v2.patch.
So I make a simpler patch. I just give a deprecation message in the
Vajrasky Kok added the comment:
Attached the patch to accommodate R. David Murray's request. Accessing invalid
attributes such as sp_nam and sp_pwd from spwd tuple will generate deprecation
warning message.
Also, I added test function so we can run spwd module directly. This is useful
New submission from Vajrasky Kok:
Both python2 and python3 have this behaviour.
import os; os.getuid()
0
'I am root'
'I am root'
import spwd
spwd.getspnam('bin')
spwd.struct_spwd(sp_nam='bin', sp_pwd='*', sp_lstchg=15558, sp_min=0,
sp_max=9, sp_warn=7, sp_inact=-1, sp_expire=-1,
R. David Murray added the comment:
Ideally, for backward compatibility reasons we really ought to support access
by the old (incorrect) name even in 3.4 (with a deprecation warning, even more
ideally). I'm not sure if that's practical?
--
nosy: +r.david.murray