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

Closed
vstinner opened this Issue Jun 29, 2016 · 2 comments

Comments

Projects
None yet
1 participant
@vstinner
Contributor

vstinner commented Jun 29, 2016

Example of trace:

/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/commands/run.py:358: ResourceWarning: unclosed file <_io.BufferedReader name=5>
  return run_tests()
Object allocated at (most recent call first):
  File "/home/haypo/prog/python/default/Lib/subprocess.py", lineno 953
    self.stdout = io.open(c2pread, 'rb', bufsize)
  File "/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/ui/cli.py", lineno 318
    return subprocess.Popen(*args, **kwargs)
  File "/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/testcommand.py", lineno 360
    stdout=subprocess.PIPE, stdin=subprocess.PIPE)
  File "/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/testcommand.py", lineno 379
    result.extend(fixture.run_tests())
  File "/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/commands/run.py", 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/run.py", lineno 358
    return run_tests()
  File "/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/commands/run.py", lineno 213
    return self._run_tests(cmd)
  File "/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/commands/__init__.py", lineno 143
    result = self.run()
  File "/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/testrepository/commands/__init__.py", 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))
@vstinner

This comment has been minimized.

Show comment
Hide comment
@vstinner

vstinner Dec 5, 2016

Contributor

Most warnings are fixed by my pull request #25.

Contributor

vstinner commented Dec 5, 2016

Most warnings are fixed by my pull request #25.

@vstinner

This comment has been minimized.

Show comment
Hide comment
@vstinner

vstinner Jan 2, 2017

Contributor

My pull request #25 has been merged, thanks.

Contributor

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