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: Add test for curses haskey replacement
Type: enhancement Stage: needs patch
Components: Library (Lib), Tests Versions: Python 3.4, Python 3.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: CuriousLearner, lehmannro, rtarnell, serhiy.storchaka, terry.reedy
Priority: normal Keywords: patch

Created on 2010-12-01 20:12 by rtarnell, last changed 2022-04-11 14:57 by admin.

Files
File name Uploaded Description Edit
issue10598.patch lehmannro, 2010-12-02 10:47 review
has_key.diff terry.reedy, 2015-05-18 01:00 review
Messages (7)
msg123007 - (view) Author: River Tarnell (rtarnell) Date: 2010-12-01 20:12
On Solaris 10 using system libcurses, curses fails to import:

hemlock% python3.1
Python 3.1.3 (r313:86834, Dec  1 2010, 19:51:26) 
[GCC 4.5.1] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import curses
Traceback (most recent call last):
  File "/opt/ts/python/3.1/lib/python3.1/curses/__init__.py", line 57, in <module>
    has_key
NameError: name 'has_key' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/ts/python/3.1/lib/python3.1/curses/__init__.py", line 59, in <module>
    from has_key import has_key
ImportError: No module named has_key
>>>
msg123062 - (view) Author: Robert Lehmann (lehmannro) * Date: 2010-12-02 10:47
I have attached a fix and a regression test.
msg221664 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-26 23:37
The code was fixed in default in r73781.  The patch for test_curses was never applied unless by a different name.
msg226124 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-08-30 07:50
For some reason, rev73781 above links to rev55058:fb542ed91e7f, whereas the actual patch is bff927c8b410.

I think testing the replacement is reasonable, but should be call something like 'test_haskey_backup' and it should test that the backup worked, that curses.haskey exists and is the function in curses.haskey. It probably could go in default only.
msg243443 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-05-18 01:00
Here is what I meant, but I cannot test on Windows.  Mark, do you have *nix currently?
msg243445 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2015-05-18 01:10
Sorry, Windows 8.1 only.
msg305893 - (view) Author: Sanyam Khurana (CuriousLearner) * (Python triager) Date: 2017-11-08 19:33
Is this bug still valid or we can just close it?
History
Date User Action Args
2022-04-11 14:57:09adminsetgithub: 54807
2017-11-08 23:10:20BreamoreBoysetnosy: - BreamoreBoy
2017-11-08 19:33:50CuriousLearnersetnosy: + CuriousLearner
messages: + msg305893
2017-11-01 17:44:52serhiy.storchakasetassignee: serhiy.storchaka

nosy: + serhiy.storchaka
2015-05-18 01:10:39BreamoreBoysetmessages: + msg243445
2015-05-18 01:00:48terry.reedysetfiles: + has_key.diff

messages: + msg243443
2014-08-30 07:50:03terry.reedysettype: enhancement
title: curses fails to import on Solaris -> Add test for curses haskey replacement
components: + Library (Lib), Tests, - Extension Modules

nosy: + terry.reedy
versions: + Python 3.4, Python 3.5, - Python 3.1
messages: + msg226124
stage: needs patch
2014-06-26 23:37:11BreamoreBoysetnosy: + BreamoreBoy
messages: + msg221664
2010-12-02 10:47:01lehmannrosetfiles: + issue10598.patch

nosy: + lehmannro
messages: + msg123062

keywords: + patch
2010-12-01 20:12:43rtarnellcreate