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

Default string literals rendered with too many quotes and backlashes #10278

Closed
laurensvalk opened this issue Mar 21, 2022 · 1 comment
Closed

Comments

@laurensvalk
Copy link

Describe the bug

In overloaded functions, some typed default string literals can be rendered with too many quotes or backlashes:

sep: str = "' '", end: str = "'\\n'"

How to Reproduce

This is a minimal repo created for several Sphinx bug reports.

RTD-theme and napoleon are enabled, but it is also reproducable without them.

$ git clone https://github.com/pybricks/sphinx-issues-minimal
$ cd sphinx-issues-minimal
# Optional if you don't have Sphinx 4.4 and RTD theme  1.0.0 already:
# poetry install
$ make clean html
$ # Open build/html/bugs.html to see above output
$ # See src/bugs/__init__.py for the offending Python source code

Expected behavior

The expected output for the two arguments would be:

sep: str = "", end: str = "\n"

Your project

https://github.com/pybricks/sphinx-issues-minimal

Screenshots

image

OS

Ubuntu

Python version

3.8.3

Sphinx version

4.4.0

Sphinx extensions

'sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx_rtd_theme'

Extra tools

No response

Additional context

This was originally posted here: pybricks/pybricks-api#81

@tk0miya
Copy link
Member

tk0miya commented Mar 31, 2022

The root cause of this problem is the same as #10279. This will also be fixed by #10315.

@tk0miya tk0miya closed this as completed Mar 31, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants