Arfrever Frehtes Taifersar Arahesis added the comment:
Revision 035cbc654889 added useless '#ifndef Py_LIMITED_API' check in 2.7
branch.
Support for Py_LIMITED_API was introduced in Python 3.2.
--
nosy: +Arfrever
___
Python tracker
Changes by Serhiy Storchaka storch...@gmail.com:
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
___
Mark Dickinson added the comment:
Hmm; good point. Well, +1 to the functionality, anyway; I'll leave the
discussion about the name.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
Serhiy Storchaka added the comment:
There is a problem with test_pwd on 64-bit platform. It expects KeyError on
pwd.getpwuid(sys.maxsize). Actually the test is not looks robust. On 32-bit
platform sys.maxsize = 2**31-1 2**32 and this value only by chance was not in
the user database. On
Eric V. Smith added the comment:
+1 for PyIndex_AsLong()
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
___
___
Serhiy Storchaka added the comment:
(perhaps we need as PyNumber_AsLongIndex() to do the direct conversion
to a C long, it would make things easier in many cases)
In this case we need PyNumber_AsLongAndOverflowIndex() and
PyNumber_AsUnsignedLongIndex(). And a lot of other parallel functions
Serhiy Storchaka added the comment:
Not technically the topic of this issue, but should we just lock
down _Py_Uid_Converter() to ints?
I just copied this code from PyArg_ParseTuple*() for 'l' format.
This is still accepted:
os.setuid(Decimal(1000.2))
Any C implemented function which
Stefan Krah added the comment:
Serhiy Storchaka rep...@bugs.python.org wrote:
Not technically the topic of this issue, but should we just lock
down _Py_Uid_Converter() to ints?
I just copied this code from PyArg_ParseTuple*() for 'l' format.
os.setuid(Decimal(1000.2))
I know that this
Serhiy Storchaka added the comment:
There is a problem with test_pwd on 64-bit platform.
Fixed in changesets a0983e46feb1 and 1e9fa629756c: Raise KeyError instead of
OverflowError when getpwuid's argument is out of uid_t range.
--
___
Python
Antoine Pitrou added the comment:
In this case we need PyNumber_AsLongAndOverflowIndex() and
PyNumber_AsUnsignedLongIndex(). And a lot of other parallel functions
for other cases. This can exponentially increase a number of functions.
I don't think it will be exponential :-)
--
Roundup Robot added the comment:
New changeset 3893ab574c55 by Serhiy Storchaka in branch '3.2':
Issue #4591: Uid and gid values larger than 2**31 are supported now.
http://hg.python.org/cpython/rev/3893ab574c55
New changeset 035cbc654889 by Serhiy Storchaka in branch '2.7':
Issue #4591: Uid
Mark Dickinson added the comment:
No objections here.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
___
___
Python-bugs-list mailing list
Roundup Robot added the comment:
New changeset b322655a4a88 by Serhiy Storchaka in branch '3.3':
Issue #4591: Uid and gid values larger than 2**31 are supported now.
http://hg.python.org/cpython/rev/b322655a4a88
New changeset 94256de0aff0 by Serhiy Storchaka in branch 'default':
Issue #4591:
Antoine Pitrou added the comment:
Looks like this broke some buildbots:
==
ERROR: test_chown (test.test_shutil.TestShutil)
--
Traceback (most recent call
Roundup Robot added the comment:
New changeset 4ef048f4834e by Serhiy Storchaka in branch '3.3':
Reject float as uid or gid.
http://hg.python.org/cpython/rev/4ef048f4834e
New changeset 3fdcffdfd3e6 by Serhiy Storchaka in branch 'default':
Reject float as uid or gid.
Stefan Krah added the comment:
Not technically the topic of this issue, but should we just lock
down _Py_Uid_Converter() to ints?
This is still accepted:
os.setuid(Decimal(1000.2))
--
nosy: +skrah
___
Python tracker rep...@bugs.python.org
Antoine Pitrou added the comment:
Not technically the topic of this issue, but should we just lock
down _Py_Uid_Converter() to ints?
The right way to do it should be to use PyNumber_Index().
(perhaps we need as PyNumber_AsLongIndex() to do the direct conversion
to a C long, it would make
Mark Dickinson added the comment:
(perhaps we need as PyNumber_AsLongIndex() to do the direct conversion
to a C long, it would make things easier in many cases)
+1, but drop the 'Index' part of the name, to match the existing
PyNumber_AsSsize_t.
--
Antoine Pitrou added the comment:
(perhaps we need as PyNumber_AsLongIndex() to do the direct conversion
to a C long, it would make things easier in many cases)
+1, but drop the 'Index' part of the name, to match the existing
PyNumber_AsSsize_t.
There's already PyNumber_Long() (which
Serhiy Storchaka added the comment:
Are there any objections, nitpicks or suggestions?
--
assignee: - serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
___
Serhiy Storchaka added the comment:
Patch updated. The converters declaration moved to the new file
Modules/posixmodule.h (Modules/grpmodule.c, Modules/posixmodule.c,
Modules/pwdmodule.c, and Modules/signalmodule.c use it) and the implementation
moved to Modules/posixmodule.c.
--
Serhiy Storchaka added the comment:
The value -1 is used is some functions like chown() (to only change the
user, only the group or none, to check if you are allowed or not). How do
you handle this value?
Yes, there is a special case for -1. Look at the code.
--
Serhiy Storchaka added the comment:
Here is a simplified version of patch from issue2005. Support of uid_t/gid_t
larger than unsigned long dropped. Signed uid_t/gid_t support dropped. The
converters moved to Objects/longobject.c. Some tests added.
--
components: +Extension Modules,
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
___
___
Python-bugs-list
Mark Dickinson added the comment:
I don't think _Py_Uid_Converter and _Py_Gid_Converter belong in
Objects/longobject.c. Is there a better place to put these? (Though
_PyLong_FromUid and _PyLong_FromGid seem fine.)
--
___
Python tracker
Mark Dickinson added the comment:
Though _PyLong_FromUid and _PyLong_FromGid seem fine.
Hmm. I take that back. I don't think any of this really belongs in
Objects/longobject.c. Right now that module contains entirely portable C code
that knows almost nothing about operating systems. In
Serhiy Storchaka added the comment:
Hmm. I take that back. I don't think any of this really belongs in
Objects/longobject.c.
I am also not happy with that. Originally they were in Modules/posixmodule.c.
However where should we place the declarations? We have not posixmodule.h.
Serhiy Storchaka added the comment:
Perhaps we should add a new header file for declarations of converters to/from
all platform specific integers (pid_t, time_t, uid_t, gid_t).
--
___
Python tracker rep...@bugs.python.org
Mark Dickinson added the comment:
Do we know of any systems where none of int, long, long long (if defined) or
their unsigned variants match gid_t / uid_t?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
Mark Dickinson added the comment:
A new header file sounds reasonable. We could then move the PID stuff out of
longobject.h
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
___
Serhiy Storchaka added the comment:
Do we know of any systems where none of int, long, long long (if defined) or
their unsigned variants match gid_t / uid_t?
No, I don't.
--
___
Python tracker rep...@bugs.python.org
STINNER Victor added the comment:
The value -1 is used is some functions like chown() (to only change the
user, only the group or none, to check if you are allowed or not). How do
you handle this value?
Le 24 nov. 2012 19:29, Serhiy Storchaka rep...@bugs.python.org a écrit :
Serhiy Storchaka
Changes by Terry J. Reedy tjre...@udel.edu:
--
versions: +Python 3.2, Python 3.3 -Python 3.0, Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
___
Changes by Terry J. Reedy tjre...@udel.edu:
--
versions: -Python 2.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
___
___
Python-bugs-list
STINNER Victor victor.stin...@haypocalc.com added the comment:
See also #3586: pwd.getpwnam('nobody') produces incorrect results if
sizeof(uid_t) sizeof(long) (now closed).
--
___
Python tracker rep...@bugs.python.org
Antoine Pitrou pit...@free.fr added the comment:
I'm not sure hardcoding 2^32 - 1 in the error message is a good idea.
I also think it would be nice to have tests for the -1 special value:
- check that chown(-1, current_gid) succeeds (and leaves the uid intact)
- check that chown(current_uid,
STINNER Victor victor.stin...@haypocalc.com added the comment:
Anyone available for a patch review? Do you need anything else: tests,
documentation updates, etc.?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
Antoine Pitrou pit...@free.fr added the comment:
The documentation for PyArg_ParseTuple states that the I code doesn't
do any overflow checking. Does it mean the input parameters can be
silently truncated?
--
nosy: +pitrou
___
Python tracker
Changes by STINNER Victor victor.stin...@haypocalc.com:
Removed file: http://bugs.python.org/file12301/posix_unsigned_uid.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
___
Changes by STINNER Victor victor.stin...@haypocalc.com:
Added file: http://bugs.python.org/file13413/posix_unsigned_uid-2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
___
Changes by STINNER Victor victor.stin...@haypocalc.com:
Removed file: http://bugs.python.org/file13412/posix_unsigned_uid-2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
___
Changes by STINNER Victor victor.stin...@haypocalc.com:
Removed file: http://bugs.python.org/file13413/posix_unsigned_uid-2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4591
___
STINNER Victor victor.stin...@haypocalc.com added the comment:
Oops, i forgot to ignore space changes in my diff... new patch.
--
Added file: http://bugs.python.org/file13414/posix_unsigned_uid-2.patch
___
Python tracker rep...@bugs.python.org
STINNER Victor victor.stin...@haypocalc.com added the comment:
New patch using PyNumber_Index()+PyLong_AsLong() for parse_uid() and
parse_gid() as proposed by antoine (on IRC).
Changes between python trunk and posix_unsigned_uid-3.patch:
- os.chown() and os.fchown() accepts uid and gid 2^31:
STINNER Victor [EMAIL PROTECTED] added the comment:
There is not only chown! There are also lchown(), fchown(), stat() and
lstat().
Attached patch:
- use unsigned int to store Windows st_uid/st_gid in the win32_stat
structure
- use PyLong to store an unsigned group in the stat result
STINNER Victor [EMAIL PROTECTED] added the comment:
I tested my patch (for Python trunk) on Ubuntu Gutsy with a 32 bits
CPU: chown(), lchwon(), fchown(), stat() and lstat() works as expected
(support identifier 2**31-1).
___
Python tracker [EMAIL
46 matches
Mail list logo