Issue #21 resolved

DeprecationWarnings and ResourceWarnings with Python >=3.2

Arfrever Frehtes Taifersar Arahesis
created an issue

When warnings are enabled (using e.g. PYTHONWARNINGS="d" environmental variable), then test suite triggers many DeprecationWarnings and ResourceWarnings with Python >=3.2.

ResourceWarnings:

$ PYTHONWARNINGS="d::ResourceWarning" nosetests-3.2 build/lib
......................................................................................................................................................................./tmp/cssutils/build/lib/cssutils/parse.py:178: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/cssutils/build/lib/tests/../../sheets/import.css'>
  return self.parseString(open(filename, 'rb').read(),
/tmp/cssutils/build/lib/cssutils/util.py:838: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/cssutils/build/sheets/import/import2.css'>
  r = fetcher(url)
/tmp/cssutils/build/lib/cssutils/util.py:838: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/cssutils/build/sheets/import3.css'>
  r = fetcher(url)
/tmp/cssutils/build/lib/cssutils/util.py:838: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/cssutils/build/sheets/import/import-impossible.css'>
  r = fetcher(url)
/tmp/cssutils/build/lib/cssutils/parse.py:178: ResourceWarning: unclosed file <_io.BufferedReader name='../../sheets/import.css'>
  return self.parseString(open(filename, 'rb').read(),
/tmp/cssutils/build/lib/cssutils/parse.py:178: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/tmp4x2her_cssutilstest.css'>
  return self.parseString(open(filename, 'rb').read(),
.../tmp/cssutils/build/lib/cssutils/util.py:838: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/cssutils/build/sheets/import.css'>
  r = fetcher(url)
..................................................................................................................../tmp/cssutils/build/lib/cssutils/parse.py:178: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/cssutils/build/lib/tests/../../sheets/csscombine-proxy.css'>
  return self.parseString(open(filename, 'rb').read(),
/tmp/cssutils/build/lib/cssutils/util.py:838: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/cssutils/build/sheets/csscombine-1.css'>
  r = fetcher(url)
/tmp/cssutils/build/lib/cssutils/util.py:838: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/cssutils/build/sheets/csscombine-2.css'>
  r = fetcher(url)
/tmp/cssutils/build/lib/cssutils/util.py:838: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/cssutils/build/sheets/1.css'>
  r = fetcher(url)
/tmp/cssutils/build/lib/cssutils/util.py:838: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/cssutils/build/sheets/csscombine-proxy.css'>
  r = fetcher(url)
/tmp/cssutils/build/lib/tests/test_scripts_csscombine.py:38: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/cssutils/build/lib/tests/../../sheets/csscombine-proxy.css'>
  cssText=open(csspath, mode="rb").read()
............................................................................
----------------------------------------------------------------------
Ran 362 tests in 14.425s

OK

Comments (8)

  1. cthedot repo owner

    did not see the warnings on my setup (guess doing something wrong) but changed something in current head. Could you checkout and check? Thanks a lot!

  2. Log in to comment