.. blogpost:: :title: Bug in Sphinx 1.6.2 for custom css :keywords: documentation, sphinx, bug :date: 2017-06-05 :categories: documentation :lid: sphinx-162-bug-custom-css I was finally able to take some time and finish the migration to *Sphinx 1.6.2*. However, there is still an error I cannot fix because it is a bug in Sphinx which happens when a custom css is used. :: jinja2.exceptions.UndefinedError: 'str object' has no attribute 'filename' The bug is fixed in the current developpment version by this commit: `Check css.rel attributes to test str or Stylesheet object `_ and I did not find any better way than modifying the file ``sphinx/theme/basic/layout.html`` and by updating the following block: :: {%- macro css() %} {%- for css in css_files %} {%- if css|attr("rel") %} {%- else %} {%- endif %} {%- endfor %} {%- endmacro %} This is really annoying. This probably means there is no unit test covering this functionality. Another bug comes from `sphinxcontrib.image `_. The following line is no longer valid with the new version of Sphinx: :: from sphinx.util.compat import make_admonition It is already being included in a `pull request `_.