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: readline.clear_history() missing in test_readline.py
Type: behavior Stage: resolved
Components: Tests Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: apalala, python-dev
Priority: normal Keywords: patch

Created on 2012-08-10 21:49 by apalala, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
readline_clear_history_available.patch apalala, 2012-08-10 22:51 Check if clear_history() is available before calling it. review
Messages (6)
msg167919 - (view) Author: Juancarlo Añez (apalala) * Date: 2012-08-10 21:49
$ lsb_release -a
LSB Version:	core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 12.04.1 LTS
Release:	12.04
Codename:	precise

$ hg branch
2.7

$ ./python Lib/test/test_readline.py
testHistoryUpdates (__main__.TestHistoryManipulation) ... ERROR

======================================================================
ERROR: testHistoryUpdates (__main__.TestHistoryManipulation)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_readline.py", line 16, in testHistoryUpdates
    readline.clear_history()
AttributeError: 'module' object has no attribute 'clear_history'

----------------------------------------------------------------------
Ran 1 test in 0.003s

FAILED (errors=1)
Traceback (most recent call last):
  File "Lib/test/test_readline.py", line 43, in <module>
    test_main()
  File "Lib/test/test_readline.py", line 40, in test_main
    run_unittest(TestHistoryManipulation)
  File "/art/python/cpython/Lib/test/test_support.py", line 1125, in run_unittest
    _run_suite(suite)
  File "/art/python/cpython/Lib/test/test_support.py", line 1108, in _run_suite
    raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
  File "Lib/test/test_readline.py", line 16, in testHistoryUpdates
    readline.clear_history()
AttributeError: 'module' object has no attribute 'clear_history'
msg167920 - (view) Author: Juancarlo Añez (apalala) * Date: 2012-08-10 21:53
$ dpkg -l | grep readline
ii  libreadline-dev                                             6.2-8                                   GNU readline and history libraries, development files
ii  libreadline5                                                5.2-11                                  GNU readline and history libraries, run-time libraries
ii  libreadline6                                                6.2-8                                   GNU readline and history libraries, run-time libraries
ii  libreadline6-dev                                            6.2-8                                   GNU readline and history libraries, development files
ii  readline-common                                             6.2-8                                   GNU readline and history libraries, common files
msg167922 - (view) Author: Juancarlo Añez (apalala) * Date: 2012-08-10 22:45
Check if clear_history() is available before calling it.
msg167923 - (view) Author: Juancarlo Añez (apalala) * Date: 2012-08-10 22:51
Check if clear_history() is available before calling it.
msg167941 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-08-11 08:59
New changeset 961a15aff2a6 by Georg Brandl in branch '3.2':
Closes #15620: check for presence of readline.clear_history(), which is apparently missing on some readline versions, before calling it in the test.
http://hg.python.org/cpython/rev/961a15aff2a6
msg167942 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-08-11 09:07
New changeset dda08ec9fbd5 by Georg Brandl in branch '2.7':
Graft a89d654adaa2 from 3.2 branch. Fixes #15620.
http://hg.python.org/cpython/rev/dda08ec9fbd5
History
Date User Action Args
2022-04-11 14:57:34adminsetgithub: 59825
2012-08-11 09:07:51python-devsetmessages: + msg167942
2012-08-11 08:59:32python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg167941

resolution: fixed
stage: resolved
2012-08-10 22:51:13apalalasetfiles: + readline_clear_history_available.patch

messages: + msg167923
2012-08-10 22:47:14apalalasetfiles: - readline_clear_history_available.patch
2012-08-10 22:45:54apalalasetfiles: + readline_clear_history_available.patch
keywords: + patch
messages: + msg167922
2012-08-10 21:53:26apalalasetmessages: + msg167920
2012-08-10 21:49:13apalalacreate