summaryrefslogtreecommitdiffstats
path: root/Modules/readline.c
Commit message (Collapse)AuthorAgeFilesLines
* [2.7] bpo-29854: Fix segfault in call_readline() (GH-728)Nir Soffer2017-07-101-4/+6
| | | | | | | | | | | | | | | If history-length is set in .inputrc, and the history file is double the history size (or more), history_get(N) returns NULL, and python segfaults. Fix that by checking for NULL return value. It seems that the root cause is incorrect handling of bigger history in readline, but Python should not segfault even if readline returns unexpected value. This issue affects only GNU readline. When using libedit emulation system history size option does not work. This is a backport of the actual fix from master without the test, since the test depends on new run_pty() helper which is not available in 2.7.
* Issue #19884: Avoid spurious output on OS X with Gnu ReadlineMartin Panter2016-08-271-12/+15
| | | | | Also adjust the test condition, because enable-meta-key was only added in 6.1, not 6.0.
* Issue #25523: Correct "a" article to "an" articleMartin Panter2015-11-021-1/+1
| | | | | | This changes the main documentation, doc strings, source code comments, and a couple error messages in the test suite. In some cases the word was removed to fix the grammar.
* Issue #22463: Correct #endif placement; patch by Senthil KumaranMartin Panter2016-06-221-1/+1
|
* Issue #22463: Backport compiler warning fixes and workaroundsMartin Panter2016-06-211-1/+4
| | | | | | | | | | | | | | * Set but unused variable in Parser/pgen.c in non-debug builds. Patch by Christian Heimes. * Unused static function in Modules/readline.c. Patch by Georg Brandl. * main_window unused in Modules/tkappinit.c. Patch by Gregory P. Smith. * Dead assignment in Modules/_ctypes/cfield.c. Extracted from patch by Brett Cannon. * Expression result unused in PyObject_INIT macro expansions. Based on patches by Christian Heimes. * Load expat_config.h and therefore pyconfig.h before C stdlib headers are loaded. This silences pre-processor warnings including '_POSIX_C_SOURCE redefined'. Extracted from patch by Christian Heimes.
* Issue #27171: Fix typos in documentation, code comments, and testsMartin Panter2016-06-021-1/+1
|
* Issue #6953: Rearrange and expand Readline module documentationMartin Panter2016-04-051-15/+15
| | | | | | | | | | | | | | | | | * Group functions into six new subsections * Document the underlying Readline function or variable accessed * get_history_length() returns the history file limit * clear_history() is conditionally compiled in * Clarify zero and one bases for history item indexes * parse_and_bind() uses its argument directly as an init line * Change "command line" to "line buffer" for consistency * read_init_file() also executes the file * read_history_file() replaces the previous history * write_history_file() overwrites any existing file * Differentiate history file lines from history list items, which could be multi-line * Add more information about completion, also addressing Issue #10796 * libedit (Editline) may be used on any platform; detection is OS X specific
* Issue #23735: Avoid sighandler_t Gnu-ismMartin Panter2016-04-031-1/+1
|
* Issue #23735: Add SIGWINCH handler for Readline 6.3+ support, by Eric PriceMartin Panter2016-04-031-0/+31
|
* Issue #24266: Cancel history search mode with Ctrl+C in Readline 7Martin Panter2016-03-221-0/+3
|
* Issue #25203: Failed readline.set_completer_delims() no longer left theSerhiy Storchaka2015-09-271-4/+5
| | | | module in inconsistent state.
* remove extern definition, since it's in a header file (closes #24058)Benjamin Peterson2015-04-261-2/+0
|
* Issue #22773: fix failing test with old readline versions due to issue #19884.Antoine Pitrou2014-11-041-0/+3
|
* Backed out changeset 7c19f1f792c6Benjamin Peterson2014-08-201-2/+5
|
* don't call rl_initialize when stdout is not a ttyBenjamin Peterson2014-08-201-5/+2
|
* Issue #19884, readline: calling rl_variable_bind ("enable-meta-key", "off")Victor Stinner2014-07-241-1/+5
| | | | does crash on Mac OS X which uses libedit instead of readline.
* Issue #19884: readline: Disable the meta modifier key if stdout is not aVictor Stinner2014-07-241-2/+13
| | | | | | terminal to not write the ANSI sequence "\033[1034h" into stdout. This sequence is used on some terminal (ex: TERM=xterm-256color") to enable support of 8 bit characters.
* Issue #20437: Fixed 43 potential bugs when deleting objects references.Serhiy Storchaka2014-02-091-2/+1
|
* Issue #20374: delete spurious empty lineNed Deily2014-02-061-1/+0
|
* Issue #20374: Avoid compiler warnings when compiling readline with libedit.Ned Deily2014-02-061-0/+9
|
* new plan: just remove typecasts (closes #20374)Benjamin Peterson2014-01-241-4/+4
|
* use new readline function types (closes #20374)Benjamin Peterson2014-01-241-3/+3
|
* Issue #18458: Prevent crashes with newer versions of libedit. Its readlineNed Deily2013-10-121-15/+25
| | | | | emulation has changed from 0-based indexing to 1-based like gnu readline. Original patch by Ronald Oussoren.
* Issue #17289: The readline module now plays nicer with external modules or ↵Antoine Pitrou2013-05-061-8/+19
| | | | | | applications changing the rl_completer_word_break_characters global variable. Initial patch by Bradley Froehle.
* Back out fix for issue #13886; it introduced a new bug in interactive ↵Nadeem Vawda2013-02-021-1/+1
| | | | readline use.
* Issue #13886: Fix input() to not strip out supposedly-invalid input bytes.Nadeem Vawda2013-01-271-1/+1
|
* Merged revisions 87356 via svnmerge fromR. David Murray2010-12-181-2/+15
| | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87356 | r.david.murray | 2010-12-17 22:48:32 -0500 (Fri, 17 Dec 2010) | 11 lines #9907: call rl_initialize early when using editline on OSX editline rl_initialize apparently discards any mappings done before it is called, which makes tab revert to file completion instead of inserting a tab. So now on OSX we call rl_initialize first if we are using readline, and then re-read the users .editrc (if any) afterward so they can still override our defaults. Patch by Ned Deily, modified by Ronald Oussoren. ........
* Merged revisions 83670 via svnmerge fromMark Dickinson2010-08-031-19/+26
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83670 | mark.dickinson | 2010-08-03 17:49:49 +0100 (Tue, 03 Aug 2010) | 3 lines Issue #8065: Fix another memory leak in readline module, from failure to free the result of a call to history_get_history_state. ........
* Merged revisions 83667 via svnmerge fromMark Dickinson2010-08-031-12/+34
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83667 | mark.dickinson | 2010-08-03 17:08:16 +0100 (Tue, 03 Aug 2010) | 2 lines Issue #9450: Fix memory leaks in readline.remove/replace_history_entry. ........
* Untabify C files. Will watch buildbots.Antoine Pitrou2010-05-091-509/+509
|
* Strip out extraneous whitespace, cast a some `const char *` to `void *` whenBrett Cannon2010-05-041-21/+21
| | | | | passed to free() and make a `char *` to a `const char *` as found by Clang's static analyzer.
* Add guard around the prototype for completion_matches to enableRonald Oussoren2010-02-111-0/+3
| | | | compilition with libedit on OSX 10.5
* Some platforms have rl_completion_append_character but not ↵Antoine Pitrou2009-10-261-0/+2
| | | | | | rl_completion_suppress_append. Reported by Mark D.
* Issue #5833: Fix extra space character in readline completion with theAntoine Pitrou2009-10-191-3/+4
| | | | GNU readline library version 6.0.
* Issue 6877: this patch makes it possible to link the readline extensionRonald Oussoren2009-09-201-0/+70
| | | | | | | | to the libedit emulation of the readline API on OSX 10.5 or later. This also adds a minimal testsuite for readline to check that the history manipuation functions have the same interface with both C libraries.
* Issue #1113244: Py_XINCREF, Py_DECREF, Py_XDECREF: Add `do { ... } while (0)'Matthias Klose2009-04-051-2/+2
| | | | to avoid compiler warnings.
* Issue #4204: Fixed module build errors on FreeBSD 4.Martin v. Löwis2008-11-041-0/+8
|
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-5/+5
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-5/+5
|
* readline module cleanupChristian Heimes2007-11-121-99/+90
| | | | | | | | fixed indention to tabs use Py_RETURN_NONE macro added more error checks to on_completion_display_matches_hook open question: Does PyList_SetItem(l, i, o) steal a reference to o in the case of an error?
* Only set rl_completion_display_matches_hook if thereMartin v. Löwis2007-11-121-31/+38
| | | | is a Python hook function. Fixes #1425.
* Patch #1388440: Add set_completion_display_matches_hook andMartin v. Löwis2007-09-041-0/+77
| | | | get_completion_type to readline.
* SF #1703270, add missing declaration in readline.c to avoid compiler warning.Neal Norwitz2007-04-191-1/+3
|
* [Bug #1552726] Avoid repeatedly polling in interactive mode -- only put a ↵Andrew M. Kuchling2006-09-071-1/+7
| | | | | | | | | | | timeout on the select() if an input hook has been defined. Patch by Richard Boulton. This select() code is only executed with readline 2.1, or if READLINE_CALLBACKS is defined. Backport candidate for 2.5, 2.4, probably earlier versions too.
* Fix memory leaks in some conditions.Neal Norwitz2006-07-161-9/+11
| | | | Reported by Klocwork #152.
* Check return result from Py_InitModule*(). This API can fail.Neal Norwitz2006-01-191-0/+2
| | | | Probably should be backported.
* Fix parse errors in readline module when compiling without threads.Georg Brandl2005-09-291-0/+2
|
* In a threads-disabled build, typing Ctrl-C into a raw_input() crashed,Michael W. Hudson2005-04-071-0/+4
| | | | | | | | | because (essentially) I didn't realise that PY_BEGIN/END_ALLOW_THREADS actually expanded to nothing under a no-threads build, so if you somehow NULLed out the threadstate (e.g. by calling PyThread_SaveThread) it would stay NULLed when you return to Python. Argh! Backport candidate.
* Fixes forMichael W. Hudson2005-03-301-26/+23
| | | | | | | | | | | | | | | | | [ 1166660 ] The readline module can cause python to segfault It seems to me that the code I'm rewriting here attempted to call any user-supplied hook functions using the thread state of the thread that called the hook-setting function, as opposed to that of the thread that is currently executing. This doesn't work, in general. Fix this by using the PyGILState API (It wouldn't be that hard to define a dummy version of said API when #ifndef WITH_THREAD, would it?). Also, check the conversion to integer of the return value of a hook function for errors (this problem was mentioned in the ipython bug report linked to in the above bug).
* Be a bit more accurate.Michael W. Hudson2005-03-301-1/+2
|