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

Fix a ResourceWarning in setuptools_build #3824

Merged
merged 1 commit into from Jul 21, 2016

Conversation

Projects
None yet
2 participants
@vstinner
Contributor

vstinner commented Jun 29, 2016

Running setup.py using SETUPTOOLS_SHIM logs a ResourceWarning on
Python 3 when using python3 -Wd command line option. This change
fixes the warning by close the setup.py file before running it.

Example of warning with Python 3.5 and pip:

$ python3 -m venv py3
$ py3/bin/python -m pip install -U pip
$ py3/bin/python -Wd -m pip install PrettyTable python-editor
...

Collecting PrettyTable
  Using cached prettytable-0.7.2.zip
/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/pip/req/req_install.py:425: ResourceWarning: unclosed file <_io.BufferedReader name=5>
  command_desc='python setup.py egg_info')

Collecting python-editor
  Using cached python-editor-1.0.1.tar.gz
Installing collected packages: PrettyTable, python-editor
  Running setup.py install for PrettyTable ... done
/home/haypo/prog/openstack/nova/py36/lib/python3.6/site-packages/pip/req/req_install.py:880: ResourceWarning: unclosed file <_io.BufferedReader name=5>
  spinner=spinner,
  Running setup.py install for python-editor ... done

...
Fix a ResourceWarning in setuptools_build
Running setup.py using SETUPTOOLS_SHIM logs a ResourceWarning on
Python 3 when using python3 -Wd command line option. This change
fixes the warning by close the setup.py file before running it.

@xavfernandez xavfernandez added this to the 8.2 milestone Jul 21, 2016

@xavfernandez xavfernandez merged commit 0811f6e into pypa:master Jul 21, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@xavfernandez

This comment has been minimized.

Show comment
Hide comment
@xavfernandez

xavfernandez Jul 21, 2016

Contributor

Thanks 👍

Contributor

xavfernandez commented Jul 21, 2016

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment