Skip to content

Fix: Generating invalid stub if description ends with a quote #382

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Andrej730
Copy link
Contributor

Was trying to regenerate stubs after https://projects.blender.org/blender/blender/issues/141853 and stumbled upon the SyntaxError when ruff was trying to format the stub.

It occurred with https://docs.blender.org/api/current/bpy.types.BooleanModifier.html#bpy.types.BooleanModifier.debug_options attribute because it ends with ' and 4 single quotes in Python is illegal:

class BooleanModifier:
    debug_options: int
    ''' Debugging options, only when started with '-d''''

# ''' Debugging options, only when started with '-d''''
#                                                         ^
# SyntaxError: unterminated string literal (detected at line 4)

Arguably, #381 can be resolved and then this attribute will have an argument type and then this issue wouldn't occur. But this change still can be kept to make it more safe.

@Andrej730 Andrej730 force-pushed the 4-quotes-syntax-error branch from f7ed277 to c1d9f7d Compare July 27, 2025 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant