homepage

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 Alexqw
Recipients Alexqw
Date 2013年04月09日.13:28:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1365514128.27.0.523273104192.issue17676@psf.upfronthosting.co.za>
In-reply-to
Content
spwd uses -1 rather than '' for empty attributes. This is different from the behaviour in the pwd module, and makes it more difficult to generate a new, valid shadow entry.
In my opinion, simply doing a ':'.join(str(val) for val in rec) should result in a valid entry. With pwd this is currently possible. Not so with spwd.
pwd:
import pwd
rec = pwd.getpwnam('alex')
print ':'.join(str(val) for val in rec)
spwd:
import spwd
rec = spwd.getspnam('alex')
shdw = ''
for idx, val in enumerate(recs_shdw):
 if idx != 0:
 shdw += ':'
 if val != -1:
 shdw += str(val)
print shdw
History
Date User Action Args
2013年04月09日 13:28:48Alexqwsetrecipients: + Alexqw
2013年04月09日 13:28:48Alexqwsetmessageid: <1365514128.27.0.523273104192.issue17676@psf.upfronthosting.co.za>
2013年04月09日 13:28:48Alexqwlinkissue17676 messages
2013年04月09日 13:28:47Alexqwcreate

AltStyle によって変換されたページ (->オリジナル) /