[Patches] [ python-Patches-1471761 ] test for broken poll at runtime

SourceForge.net noreply at sourceforge.net
Thu Apr 20 22:50:10 CEST 2006


Patches item #1471761, was opened at 2006-04-17 16:25
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1471761&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Modules
Group: Python 2.5
Status: Open
>Resolution: Accepted
Priority: 5
Submitted By: Ronald Oussoren (ronaldoussoren)
>Assigned to: Ronald Oussoren (ronaldoussoren)
Summary: test for broken poll at runtime

Initial Comment:
This patch moves the test for a broken poll() implementation from 
configure-time to runtime.

The reason for creating this patch is that we'd like to have one python 
binary for OSX 10.3 and later. OSX 10.3 has a broken version of poll, 
while 10.4 doesn't. With this patch you'll have select.poll when it is 
available and working indepent of the version of the OS where python was 
build.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2006-04-20 22:50

Message:
Logged In: YES 
user_id=21627

The patch is fine. Please apply. When done, please leave the
subversion revision number here, and close the patch.

----------------------------------------------------------------------

Comment By: Ronald Oussoren (ronaldoussoren)
Date: 2006-04-18 21:46

Message:
Logged In: YES 
user_id=580910

I don't quite understand why runtime testing is considered bad here, although I 
guess the time used by a lot of runtime tests could add up. 

But anyway, broken-poll-at-runtime-2.patch implements your suggestion. 

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2006-04-18 00:02

Message:
Logged In: YES 
user_id=21627

I'm -1 for this patch in its current form. Python shouldn't
perform "unnecessary" system calls, even if they are as 
cheap as creating a pipe.

It's fine that you want to use the same binary across OSX 
releases; please rewrite the patch to be Mac-specific: 
Always run the configure test for a broken poll, but ignore 
its outcome on OSX. The easiest way to achieve this on top 
of your current patch might be the following:

- #undef HAVE_BROKEN_POLL on OSX in selectmodule.c
- implement select_have_broken_poll to return 0 (i.e. just
the last statement) on anything but OSX.

----------------------------------------------------------------------

Comment By: Ronald Oussoren (ronaldoussoren)
Date: 2006-04-17 16:46

Message:
Logged In: YES 
user_id=580910

I've uploaded a new version of the patch, and removed the earlier one, because 
the first version also contained an unrelated patch.

Also note that this patch updates configure.in, hence autoconf should be run 
before checking it in.

And finally: the original author of this patch is Bob Ipollito (etrepum), I've 
harvested this from the python24-fat tree.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1471761&group_id=5470


More information about the Patches mailing list