classification
Title: Remove test.support.strip_python_stderr()
Type: Stage: resolved
Components: Tests Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gregory.p.smith, vstinner
Priority: normal Keywords: patch

Created on 2019-12-06 23:39 by vstinner, last changed 2019-12-08 07:38 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 17490 merged vstinner, 2019-12-06 23:53
Messages (4)
msg357955 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-12-06 23:39
Python 3.3 compiled in debug mode dumps the total number of references at exit into stderr. Something like:

$ python3.3-dbg -X showrefcount -c pass
[18563 refs, 6496 blocks]

In Python 3.4, bpo-17323 disabled this feature by default and added -X showrefcount command line option:

commit 1f8898a5916b942c86ee8716c37d2db388e7bf2f
Author: Ezio Melotti <ezio.melotti@gmail.com>
Date:   Tue Mar 26 01:59:56 2013 +0200

    #17323: The "[X refs, Y blocks]" printed by debug builds has been disabled by default.  It can be re-enabled with the `-X showrefcount` option.

test.support module still has strip_python_stderr() function to remove "[18563 refs, 6496 blocks]" from stderr, but it's now useless.

Attached PR removes the function. The PR also avoids calling str.strip().
msg357958 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2019-12-07 00:32
do we have any buildbots using -X showrefcount?
msg357960 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-12-07 00:42
> do we have any buildbots using -X showrefcount?

No. What would be the purpose of such buildbot?

-X showrefcount is tested by test_cmd_line.test_showrefcount().

I ran "./python -X showrefcount -m test -j0 -r": all tests pass. (test_pty fail when run in parallel, but pass when run sequentially: bpo-38547, it's unrelated to this change).
msg357993 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-12-08 07:38
New changeset 6cac1136665b70f72db291b95876d7affcf1d2db by Victor Stinner in branch 'master':
bpo-38991: Remove test.support.strip_python_stderr() (GH-17490)
https://github.com/python/cpython/commit/6cac1136665b70f72db291b95876d7affcf1d2db
History
Date User Action Args
2019-12-08 07:38:43vstinnersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-12-08 07:38:22vstinnersetmessages: + msg357993
2019-12-07 00:42:25vstinnersetmessages: + msg357960
2019-12-07 00:32:07gregory.p.smithsetnosy: + gregory.p.smith
messages: + msg357958
2019-12-06 23:53:40vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request16968
2019-12-06 23:39:15vstinnercreate