ResourceWarnings with Python 3.2

Arfrever Frehtes Taifersar Arahesis avatarArfrever Frehtes Taifersar Arahesis created an issue

PYTHONWARNINGS="d" environmental variable enables additional warnings.

$ PYTHONWARNINGS="d" python3.2 setup.py test
setup.py:15: ResourceWarning: unclosed file <_io.TextIOWrapper name='README.txt' mode='r' encoding='UTF-8'>
  value = open(name+'.txt').read()
setup.py:15: ResourceWarning: unclosed file <_io.TextIOWrapper name='CHANGES.txt' mode='r' encoding='UTF-8'>
  value = open(name+'.txt').read()
...
/tmp/pyquery-1.1/pyquery/test.py:79: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/pyquery-1.1/docs/api.txt' mode='r' encoding='UTF-8'>
  doc = open(self.path).read()
/tmp/pyquery-1.1/pyquery/test.py:79: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/pyquery-1.1/docs/attributes.txt' mode='r' encoding='UTF-8'>
  doc = open(self.path).read()
/tmp/pyquery-1.1/pyquery/test.py:79: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/pyquery-1.1/docs/changes.txt' mode='r' encoding='UTF-8'>
  doc = open(self.path).read()
/tmp/pyquery-1.1/pyquery/test.py:79: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/pyquery-1.1/docs/css.txt' mode='r' encoding='UTF-8'>
  doc = open(self.path).read()
/tmp/pyquery-1.1/pyquery/test.py:79: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/pyquery-1.1/docs/future.txt' mode='r' encoding='UTF-8'>
  doc = open(self.path).read()
/tmp/pyquery-1.1/pyquery/test.py:79: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/pyquery-1.1/docs/index.txt' mode='r' encoding='UTF-8'>
  doc = open(self.path).read()
/tmp/pyquery-1.1/pyquery/test.py:79: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/pyquery-1.1/pyquery/../README.txt' mode='r' encoding='UTF-8'>
  doc = open(self.path).read()
/tmp/pyquery-1.1/pyquery/test.py:79: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/pyquery-1.1/docs/testing.txt' mode='r' encoding='UTF-8'>
  doc = open(self.path).read()
/tmp/pyquery-1.1/pyquery/test.py:102: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/pyquery-1.1/pyquery/tests.txt' mode='r' encoding='UTF-8'>
  doc = open(self.path).read()
/tmp/pyquery-1.1/pyquery/test.py:79: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/pyquery-1.1/docs/tips.txt' mode='r' encoding='UTF-8'>
  doc = open(self.path).read()
/tmp/pyquery-1.1/pyquery/test.py:79: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/pyquery-1.1/docs/traversing.txt' mode='r' encoding='UTF-8'>
  doc = open(self.path).read()
...

I'm attaching the patch.

Comments (3)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.