I received the following bug from our package of docutils: https://bugzilla.redhat.com/show_bug.cgi?id=785622
Reproduced by doing the following:
touch test.rst default.css
rst2html --stylesheet-path=default.css test.rst
The problem is that on python2 we're combining a unicode string (from command line parsing) with a byte str (from the current working directory). I'll attach a patch that addresses this in a minimally invasive manner. However, I think that there are still latent bugs in the code as on unix systems, filenames are byte str with a few bytes marked as illegal. That means that a user could have a current working directory where part of the path was encoded in latin-1 and part in utf-8, for instance. This may throw an exception when converting it to unicode or it may return a unicode string that doesn't actually represent the bytes that are on disk (and so will fail to find the file when it attempts to read it). Fixing that would require a re-architecting of the file handling in all of docutils, though.