diff --git a/CHANGES b/CHANGES index 8622c0713..d64a1f712 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,9 @@ Release 0.6.6 (in development) * #387: Fix the display of search results in ``dirhtml`` output. +* #376: In autodoc, fix display of parameter defaults containing + backslashes. + * #370: Fix handling of complex list item labels in LaTeX output. * #374: Make the ``doctest_path`` config value of the doctest diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 676740671..084ae1552 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -813,7 +813,10 @@ class FunctionDocumenter(ModuleLevelDocumenter): argspec = inspect.getargspec(self.object.__init__) if argspec[0]: del argspec[0][0] - return inspect.formatargspec(*argspec) + args = inspect.formatargspec(*argspec) + # escape backslashes for reST + args = args.replace('\\', '\\\\') + return args def document_members(self, all_members=False): pass