Issue #376 resolved

"\n" in function default args get munged in autodoc output

Jeff Forcier
created an issue

I've encountered what seems like an odd problem with the autodoc plugin: a function signature with "\n" in a default value has the '\' stripped away, and thus any generated autodocs appear to claim that the string instead just reads "n".

This happens regardless of whether the string is just "\n" or contains other text as well; it does not happen for e.g. "\k"; and it works correctly if the string is a raw string (r"\n"). (Except, of course, that now the default value is a literal "\n" instead of a newline -- which is incorrect.)

This problem occurs for me with Sphinx 0.6.3 and 0.6.5 under the stock Python 2.5.1 on Mac OS X 10.5, and also under Python 2.5.2 on Ubuntu 8.04.

I have not yet dug into the Sphinx source to see if I can debug this myself, but will try at some point.

Comments (3)

  1. Log in to comment