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: script_helper._assert_python should set TERM='' by default.
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, georg.brandl, martin.panter, python-dev, r.david.murray
Priority: normal Keywords: patch

Created on 2013-06-25 12:40 by r.david.murray, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue18300.diff berker.peksag, 2014-01-22 14:49 review
issue18300_test_doctest.diff berker.peksag, 2014-01-22 14:49 review
Messages (6)
msg191856 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-06-25 12:40
See issue 11390 for a discussion, but briefly: there is a bug in the readline library that causes it, on some systems, to emit a control sequence on stdout when readline is first initialized and TERM is set to xterm.  The bug can be avoided by setting TERM='', and since assert_python is often used to test output, the bogus characters can cause tests to fail on just some systems.  _assert_python should therefore set TERM='' unless the TERM environment variable is passed explicitly by the caller.

While this issue probably has minimal impact on the earlier python versions (where only doctest is likely to trigger this bug, because it calls pdb which calls readline), on 3.4 readline is always initialized, and therefore the bug is more likely to cause unexpected test failures.
msg199895 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2013-10-14 14:22
Sounds good to me.
msg208815 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-01-22 14:49
Attached patch to set TERM='' by default in test.script_helper._assert_python.
msg268959 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-06-21 03:26
More recently, Issue 19884 has worked around the problem where practical on non-Apple platforms, so perhaps this problem is not so important now. However it could still be present with older Gnu Readline versions, and slightly newer versions on Apple (pending my latest patch in Issue 19884).

Both patches look okay to me, and since the Readline bug could still happen in some cases, I think it is worth applying them.
msg269163 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-06-24 06:28
New changeset 983fe8f96b08 by Berker Peksag in branch '3.5':
Issue #18300: Set TERM='' by default in assert_python_*
https://hg.python.org/cpython/rev/983fe8f96b08

New changeset 1c49cf82d115 by Berker Peksag in branch 'default':
Issue #18300: Merge from 3.5
https://hg.python.org/cpython/rev/1c49cf82d115
msg269164 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-06-24 06:29
Thanks for the review, Martin.
History
Date User Action Args
2022-04-11 14:57:47adminsetgithub: 62500
2016-06-24 06:29:30berker.peksagsetstatus: open -> closed
versions: + Python 3.5, Python 3.6, - Python 2.7, Python 3.3, Python 3.4
messages: + msg269164

components: + Tests
resolution: fixed
stage: patch review -> resolved
2016-06-24 06:28:06python-devsetnosy: + python-dev
messages: + msg269163
2016-06-21 03:26:56martin.pantersetnosy: + martin.panter
messages: + msg268959
2014-01-22 14:49:36berker.peksagsetfiles: + issue18300_test_doctest.diff
2014-01-22 14:49:16berker.peksagsetfiles: + issue18300.diff

title: script_helper._asert_python should set TERM='' by default. -> script_helper._assert_python should set TERM='' by default.
keywords: + patch
nosy: + berker.peksag

messages: + msg208815
stage: needs patch -> patch review
2013-10-14 14:22:14georg.brandlsetnosy: + georg.brandl
messages: + msg199895
2013-06-25 12:40:40r.david.murraycreate