Charles-François Natali <[email protected]> added the comment:
I didn't test, but after skimming through the code I think that if an invalid
user name/group name is provided, os.chown is passed None, which will fail with
ValueError.
It would be better to raise an explicit error like "no such user" / "no such
group".
That's something you could add to the tests.
Also, you could initialize _user to -1 instead of None, and replace
if user is None:
_user = -1
else:
[...]
with
if user is not None:
[...]
Same goes for _group.
----------
nosy: +charles-francois.natali
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue12191>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com