Ticket #4920 enhancement closed fixed

Opened 2 years ago

Last modified 9 months ago

Use the stdlib `os.initgroups` if it is available

Reported by: exarkun Owned by: exarkun
Priority: low Milestone: Python 3.3 Minimal
Component: core Keywords:
Cc: Branch: branches/stdlib-initgroups-4920
(diff, github, buildbot, log)
Author: exarkun Launchpad Bug:

Description

os.initgroups was added to the Python 2.7 standard library. We should prefer it over our twisted.python._initgroups extension.

Attachments

initgroups.patch Download (0.6 KB) - added by vperic 13 months ago.

Change History

Changed 13 months ago by vperic

1

Changed 13 months ago by vperic

  • keywords review added

As far as I can see, this is a simple matter of wrapping the current code with another "try/except" block. I've attached a patch doing just that. Not really sure how to test it, either.

2

Changed 13 months ago by therve

  • owner set to vperic
  • keywords review removed

I think the tests are covering it already, and the builders on 2.7 will pick it up. But you should change twisted/topfiles/setup.py to not build _initgroups.c on 2.7 and newer. Please add a NEWS fragment as well (and merge). Thanks!

3

Changed 13 months ago by exarkun

But you should change twisted/topfiles/setup.py to not build _initgroups.c on 2.7 and newer

With unit tests, of course.

4

Changed 10 months ago by itamar

  • milestone set to Python 3.3 Minimal

5

Changed 9 months ago by exarkun

  • owner changed from vperic to exarkun
  • status changed from new to assigned

6

Changed 9 months ago by exarkun

  • branch set to branches/stdlib-initgroups-4920
  • branch_author set to exarkun

(In [35884]) Branching to 'stdlib-initgroups-4920'

7

Changed 9 months ago by exarkun

  • keywords review added
  • owner changed from exarkun to itamar
  • status changed from assigned to new

8

Changed 9 months ago by itamar

  • owner changed from itamar to exarkun
  • keywords review removed

There's a failure on one of the builds:  http://buildbot.twistedmatrix.com/builders/debian-easy-py2.6-epoll/builds/401/steps/epoll/logs/problems

Other than that, looks good; merge when fixed.

9

Changed 9 months ago by exarkun

  • status changed from new to closed
  • resolution set to fixed

(In [35900]) Merge stdlib-initgroups-4920

Author: exarkun Reviewer: itamar Fixes: #4920

Use os.initgroups when it is available (and skip building our extension module for the same functionality in that case).

Note: See TracTickets for help on using tickets.