Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subprocesses pipes (stdout, stderr) are not explicitly closed: ResourceWarning warnings are logged #26

vstinner opened this issue Jun 29, 2016 · 2 comments


Copy link

@vstinner vstinner commented Jun 29, 2016

Example of trace:

/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/commands/ ResourceWarning: unclosed file <_io.BufferedReader name=5>
  return run_tests()
Object allocated at (most recent call first):
  File "/home/haypo/prog/python/default/Lib/", lineno 953
    self.stdout =, 'rb', bufsize)
  File "/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/ui/", lineno 318
    return subprocess.Popen(*args, **kwargs)
  File "/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/", lineno 360
    stdout=subprocess.PIPE, stdin=subprocess.PIPE)
  File "/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/", lineno 379
  File "/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/commands/", lineno 348
    run_procs = [('subunit', ReturnCodeToSubunit(proc)) for proc in cmd.run_tests()]
  File "/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/commands/", lineno 358
    return run_tests()
  File "/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/commands/", lineno 213
    return self._run_tests(cmd)
  File "/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/commands/", lineno 143
    result =
  File "/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/commands/", lineno 188
    result = cmd.execute()
  File "/home/haypo/prog/openstack/nova/py36/bin/testr", lineno 26
    sys.exit(run_argv(sys.argv, sys.stdin, sys.stdout, sys.stderr))

This comment has been minimized.

Copy link
Contributor Author

@vstinner vstinner commented Dec 5, 2016

Most warnings are fixed by my pull request #25.


This comment has been minimized.

Copy link
Contributor Author

@vstinner vstinner commented Jan 2, 2017

My pull request #25 has been merged, thanks.

@vstinner vstinner closed this Jan 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.