diff options
| author | Georg Brandl <georg@python.org> | 2011-09-21 19:06:48 +0200 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2011-09-21 19:06:48 +0200 |
| commit | 0e55d4967fa9c2f9d2abc09ffa9fad357c47bf16 (patch) | |
| tree | 09a687be29fa46249bcec80531a7ed7e9f0bfe32 /sphinx/builders/gettext.py | |
| parent | aba7fcb1fa5ffdf5af225c3e7e78a4710a5a942d (diff) | |
| download | sphinx-0e55d4967fa9c2f9d2abc09ffa9fad357c47bf16.tar.gz | |
Fix #765: on Windows, relpath() does not always succeed.
Diffstat (limited to 'sphinx/builders/gettext.py')
| -rw-r--r-- | sphinx/builders/gettext.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sphinx/builders/gettext.py b/sphinx/builders/gettext.py index 1552e273..41a5acbc 100644 --- a/sphinx/builders/gettext.py +++ b/sphinx/builders/gettext.py @@ -14,11 +14,9 @@ from codecs import open from datetime import datetime from collections import defaultdict -from docutils import nodes - from sphinx.builders import Builder from sphinx.util.nodes import extract_messages -from sphinx.util.osutil import SEP, copyfile +from sphinx.util.osutil import SEP, safe_relpath from sphinx.util.console import darkgreen POHEADER = ur""" @@ -113,7 +111,7 @@ class MessageCatalogBuilder(I18nBuilder): # generate "#: file1:line1\n#: file2:line2 ..." pofile.write(u"#: %s\n" % "\n#: ".join("%s:%s" % - (path.relpath(source, self.outdir), line) + (safe_relpath(source, self.outdir), line) for source, line, _ in positions)) # generate "# uuid1\n# uuid2\n ..." pofile.write(u"# %s\n" % "\n# ".join(uid for _, _, uid |
