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

Jeff Forcier avatarJeff 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 (2)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.