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.
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) * (Python committer) | 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) * (Python committer) | 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 | |