Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nbdev_readme fails with mysterious error if docstring contains "\" #1455

Open
nikolas-claussen opened this issue Sep 30, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@nikolas-claussen
Copy link

nbdev_readme fails if I have a backslash in the docstring of any exported function, e.g.

#|  export
def f():
    """ 
    Example doctring $x \mapsto y$
    """
    return None

The resulting error message is very long and does not indicate the problem (although it does point to the offending function).

@nikolas-claussen nikolas-claussen added the bug Something isn't working label Sep 30, 2024
@jlopezpena
Copy link

Are you using python 3.12? The change in string parsing can yield warnings or errors with strings that contain backslashes. Those can normally be fixed simply by telling python it is a "raw" string, eg, just prepending the quotes with an r:

#|  export
def f():
    r""" 
    Example doctring $x \mapsto y$
    """
    return None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants