Issue4202
Created on 2008-10-25 02:52 by grahamd, last changed 2022-04-11 14:56 by admin.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| readline.patch | Winston451, 2012-10-26 12:24 | review | ||
| Messages (5) | |||
|---|---|---|---|
| msg75201 - (view) | Author: Graham Dumpleton (grahamd) | Date: 2008-10-25 02:52 | |
Because the readline module uses PyGILState_Ensure() to facilitate triggering callbacks into Python code, this would make the ability to use the hook functions incompatible with use in sub interpreters. If this is the case, then that readline module cannot be used in sub interpreters should be documented if not already. Better still, attempts to register hooks from sub interpreters should result in an exception. Further, when in use, in sub interpreter, callback hooks should also not be called if defined, because if defined they would be the hooks from the main interpreter since variables holding the hooks are static C variables and shared across all interpreters. This issue derived from reading of code only and not tested in real program. |
|||
| msg107981 - (view) | Author: Terry J. Reedy (terry.reedy) * ![]() |
Date: 2010-06-17 01:34 | |
The be an issue, tests with currents interpreters are needed. You may be right, but it may be that no one ever uses readline with subinterpreters. |
|||
| msg173809 - (view) | Author: (Winston451) | Date: 2012-10-25 23:23 | |
Hi, I'm currently developping an application which runs sub interpreters in threads (one sub interpreter per thread). When I try to use readline completion in these sub interpreters it fails because it's not possible to import the "keyword" module (PyEval_GetRestricted() returns true). I think it is due to the fact that readline's on_completion() use PyGILState_Ensure(). It should be possible to use PyEval_RestoreThread with _PyOS_ReadlineTState instead. |
|||
| msg173839 - (view) | Author: (Winston451) | Date: 2012-10-26 12:17 | |
I attached a patch that solve the problem |
|||
| msg368905 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2020-05-15 01:28 | |
See also bpo-15751: [subinterpreters] Make the PyGILState API compatible with subinterpreters. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:56:40 | admin | set | github: 48452 |
| 2020-05-15 01:28:36 | vstinner | set | nosy:
+ vstinner messages: + msg368905 |
| 2020-05-15 01:10:05 | vstinner | set | components:
+ Subinterpreters, - Interpreter Core title: Multiple interpreters and readline module hook functions. -> [subinterpreters] Multiple interpreters and readline module hook functions. |
| 2015-07-03 00:32:42 | eric.snow | set | nosy:
+ eric.snow versions: + Python 3.5, Python 3.6, - Python 3.4 |
| 2012-10-26 13:02:22 | berker.peksag | set | versions: - Python 2.6, Python 3.0, Python 3.1, Python 2.7, Python 3.2, Python 3.3, Python 3.5 |
| 2012-10-26 12:24:47 | Winston451 | set | files: - readline.patch |
| 2012-10-26 12:24:31 | Winston451 | set | files: + readline.patch |
| 2012-10-26 12:19:40 | Winston451 | set | type: behavior versions: + Python 2.6, Python 3.1, Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5 |
| 2012-10-26 12:17:40 | Winston451 | set | files:
+ readline.patch keywords: + patch messages: + msg173839 |
| 2012-10-25 23:23:50 | Winston451 | set | status: pending -> open nosy: + Winston451 messages: + msg173809 |
| 2010-06-17 01:34:59 | terry.reedy | set | status: open -> pending versions: - Python 2.5 nosy: + terry.reedy messages: + msg107981 |
| 2008-10-25 02:52:43 | grahamd | create | |
