This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test for broken poll at runtime
Type: Stage:
Components: Extension Modules Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: ronaldoussoren Nosy List: loewis, ronaldoussoren
Priority: normal Keywords: patch

Created on 2006-04-17 14:25 by ronaldoussoren, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
broken-poll-at-runtime.patch ronaldoussoren, 2006-04-17 14:46 version 2
broken-poll-at-runtime-2.patch ronaldoussoren, 2006-04-18 19:46
Messages (6)
msg50030 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2006-04-17 14:25
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.
msg50031 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2006-04-17 14:46
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.
msg50032 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-04-17 22:02
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.
msg50033 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2006-04-18 19:46
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. 
msg50034 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-04-20 20:50
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.
msg50035 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2006-04-23 12:36
Logged In: YES 
user_id=580910

Commited as revision 45661
History
Date User Action Args
2022-04-11 14:56:16adminsetgithub: 43227
2006-04-17 14:25:41ronaldoussorencreate