os.path.relpath() in gettext builder
# generate "#: file1:line1\n#: file2:line2 ..." pofile.write(u"#: %s\n" % "\n#: ".join("%s:%s" % (path.relpath(source, self.outdir), line) for source, line, _ in positions))
Throws an exception on W32:
File "%PYTHONPATH%\lib\ntpath.py", line 512, in relpath % (path_prefix, start_prefix)) ValueError: path is on drive %DRIVE1%:, start on drive %DRIVE2%:
because `source' is absolute path, and self.outdir is also an absolute path (even if sphinx-build was invoked with relative paths for source and output directories), and they could be (and are, in my case) on different drives.
If being able to express source path as relative to self.outdir is a requirement, then i simply don't know how this is going to be fixed. Otherwise, you can catch ValueError here (sticking to better-to-ask-forgiveness-than-to-ask-permission line) and output source path as-is.