Serhiy Storchaka added the comment:
Thank you for your review Brett.
--
assignee: -> serhiy.storchaka
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
Roundup Robot added the comment:
New changeset 65e0e06b70b6 by Serhiy Storchaka in branch 'default':
Issue #26129: Deprecated accepting non-integers in grp.getgrgid().
https://hg.python.org/cpython/rev/65e0e06b70b6
--
nosy: +python-dev
___
Python
Brett Cannon added the comment:
A single deprecation cycle should be enough since it obviously shouldn't work
with floats and strings might make sense but updating code to not use them is
easy enough.
--
___
Python tracker
Larry Hastings added the comment:
Nope. Argument Clinic was merged in 3.4, and in 3.3 pwd.getpwuid wouldn't
accept strings. So this isn't a bug introduced in the Clinic conversion in
3.4, this is historical behavior, and we can't change it now.
If anything, I'd prefer that grp.getgrid
Serhiy Storchaka added the comment:
This looks as unintentional consequences of ab0221811771.
I think the current behavior of grp.getgrgid() is not correct, because it
accepts str, float and other types. Python is strong-typed language and
shouldn't make unwanted implicit type conversions. I
New submission from Simon Fraser:
grp.getgrgid is capable of accepting a string:
from grp import getgrgid
print(getgrgid('0'))
However, pwd.getpwuid can't do the same:
from pwd import getpwuid
print(getpwuid('0'))
Traceback (most recent call last):
File "getpwuid_test.py", line 2, in