sphinx.writers.html.HTMLTranslator.visit_image(): ResourceWarning

Arfrever Frehtes Taifersar Arahesis avatarArfrever Frehtes Taifersar Arahesis created an issue

sphinx.writers.html.HTMLTranslator.visit_image() triggers ResourceWarning when :scale: is used. I attach a patch.

Example (documentation of stevedore-0.14.1):

$ PYTHONPATH=".." make html
sphinx-build -b html -d build/doctrees   source build/html
Making output directory...
Running Sphinx v1.2.1
/usr/lib64/python3.3/site-packages/pbr/packaging.py:860: ResourceWarning: unclosed file <_io.TextIOWrapper name='PKG-INFO' mode='r' encoding='UTF-8'>
  version = _get_version_from_pkg_info(package_name)
loading pickled environment... failed: [Errno 2] No such file or directory: '/tmp/stevedore-0.14.1/docs/build/doctrees/environment.pickle'
building [html]: targets for 12 source files that are out of date
updating environment: 12 added, 0 changed, 0 removed
reading sources... [100%] tutorial/testing                                                                                                                   
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
/usr/lib64/python3.3/site-packages/sphinx/writers/html.py:404: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/stevedore-0.14.1/docs/source/essays/ceilometer-design.jpg'>
  del im
/usr/lib64/python3.3/site-packages/sphinx/writers/html.py:404: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/stevedore-0.14.1/docs/source/essays/discovery.jpg'>
  del im
/usr/lib64/python3.3/site-packages/sphinx/writers/html.py:404: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/stevedore-0.14.1/docs/source/essays/enabling.jpg'>
  del im
/usr/lib64/python3.3/site-packages/sphinx/writers/html.py:404: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/stevedore-0.14.1/docs/source/essays/importing.jpg'>
  del im
/usr/lib64/python3.3/site-packages/sphinx/writers/html.py:404: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/stevedore-0.14.1/docs/source/essays/integration.jpg'>
  del im
/usr/lib64/python3.3/site-packages/sphinx/writers/html.py:404: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/stevedore-0.14.1/docs/source/essays/invocation.jpg'>
  del im
/usr/lib64/python3.3/subprocess.py:718: ResourceWarning: unclosed file <_io.BufferedReader name=3>                                                           
  _cleanup()
writing output... [100%] tutorial/testing                                                                                                                    
writing additional files... genindex search
copying images... [100%] essays/invocation.jpg                                                                                                               
copying static files... WARNING: html_static_path entry '/tmp/stevedore-0.14.1/docs/source/_static' does not exist
done
copying extra files... done
dumping search index... done
dumping object inventory... done
build succeeded, 1 warning.

Build finished. The HTML pages are in build/html.

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.