Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#21559 closed defect (fixed)

python's os.getgroups() fails as root on 10.6 SL

Reported by: league@… Owned by: blb@…
Priority: Normal Milestone:
Component: ports Version: 1.8.99
Keywords: Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: python26

Description

My rdiff-backup script fails on snow leopard because of this issue that arose with python25. When run as root, os.getgroups() causes an OSError exception. This did not occur on 10.5, but it occurs on 10.6 with both python 2.5 and 2.6.

% python2.6 
Python 2.6.2 (r262:71600, Sep 22 2009, 09:48:09) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getgroups()
[501, 204, 100, 98, 81, 80, 79, 61, 12, 101, 402, 102]
>>> 
% sudo python2.6
Python 2.6.2 (r262:71600, Sep 22 2009, 09:48:09) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getgroups()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument
>>> 

As I said, my main concern is getting rdiff-backup to work as root. That relies explicitly on python25, but I imagine the fix would be the same for both. Incidentally, the python 2.6.1 distributed with the OS does not exhibit this problem, so building rdiff-backup against that may be a workaround.

Change History (4)

comment:1 Changed 15 years ago by blb@…

Cc: mcalhoun@… added
Owner: changed from macports-tickets@… to blb@…
Status: newassigned

comment:2 Changed 15 years ago by blb@…

Resolution: fixed
Status: assignedclosed

Fixed in r58151, thanks for finding that.

comment:3 Changed 15 years ago by league@…

So fast, thanks! Could this same patch be applied to python25, or will we have to fix rdiff-backup to move to 2.6 (which will also entail porting py25-xattr)?

comment:4 Changed 15 years ago by blb@…

py26-xattr has been added in r58160. However, when it comees to rdiff-backup, updating it to python 2.6 would be a good idea, but there is one issue. Both python 2.5 and 2.6 versions of xattr want to install ${prefix}/bin/xattr (and py26-xattr lists a conflict with py25-xattr). If you have rdiff-backup already installed with py25, upgrading to py26 will fail due to this conflict.

I'd say open a ticket for rdiff-backup, maybe a good solution can be found.

Note: See TracTickets for help on using tickets.