Issue 6338: Error message displayed on stderr when no C compiler is present with ctypes
Created on 2009-06-24 21:08 by ehuss, last changed 2022-04-11 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| ctypes_util.patch | ehuss, 2009-06-24 21:08 | Patch to squelch error | review | |
| Messages (4) | |||
|---|---|---|---|
| msg89681 - (view) | Author: Eric Huss (ehuss) | Date: 2009-06-24 21:08 | |
Importing the "uuid" module on a posix system (FreeBSD in my case) that does not have a C compiler causes "cc: not found" to be sent to stderr. This is because it imports ctypes and calls ctypes.util.find_library which attempts to determine if the C compiler is called "gcc" or "cc" using a shell command. |
|||
| msg112299 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2010-08-01 09:34 | |
The patch simply sends the error message to os.devnull. I can't test it as posix, but can it be committed as is? |
|||
| msg264142 - (view) | Author: Martin Panter (martin.panter) * ![]() |
Date: 2016-04-25 01:46 | |
It would be good to close the file when it’s no longer needed. Also, if this bug is relevant to Python 3, I would use open() rather than file(). |
|||
| msg265245 - (view) | Author: Martin Panter (martin.panter) * ![]() |
Date: 2016-05-10 13:05 | |
I presume the problem is that Free BSD’s “type” command outputs the error to the shell’s original stderr, rather than the one given on the “type” command line. If so, the Python 3 patches for Issue 22636 should avoid it by using shutil.which() instead. However that function does not exist in Python 2, so a different solution needs to be found. Probably an improved version of Eric’s patch would be good. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:56:50 | admin | set | github: 50587 |
| 2021-05-28 19:16:31 | iritkatriel | set | status: open -> closed resolution: out of date stage: needs patch -> resolved |
| 2016-05-10 13:05:16 | martin.panter | set | dependencies:
+ avoid using a shell in ctypes.util: replace os.popen with subprocess messages: + msg265245 stage: patch review -> needs patch versions: + Python 2.7, - Python 2.6 |
| 2016-05-09 23:06:17 | meador.inge | set | nosy:
+ meador.inge |
| 2016-04-25 01:46:39 | martin.panter | set | nosy:
+ martin.panter messages:
+ msg264142 |
| 2014-02-03 19:51:21 | BreamoreBoy | set | nosy:
- BreamoreBoy |
| 2010-08-01 09:34:16 | BreamoreBoy | set | nosy:
+ BreamoreBoy messages: + msg112299 |
| 2009-06-24 21:08:28 | ehuss | create | |
