Skip to content

sage --fixdoctests does not work with line continuation #39058

@user202729

Description

@user202729

Steps To Reproduce

a.sage:

r"""
sage: 123 + \
....: 456
578
"""

run

$ sage --fixdoctests --overwrite a.sage

Expected Behavior

replace

Actual Behavior

.../src/bin/sage-fixdoctests:351: UserWarning: Did not manage to replace
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    578
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
with
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    579
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  warnings.warn(txt % ('>' * 40, '\n'.join(expected), '>' * 40,
sage-fixdoctests: No fixes made in 'a.sage'

Additional Information

No response

Environment

  • OS: Linux
  • Sage Version: approximately latest

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions