Bug 2220936 - asciidoc: invalid escape sequence '\S'
Summary: asciidoc: invalid escape sequence '\S'
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: asciidoc
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Fabian Affolter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-06 14:57 UTC by Jerry James
Modified: 2023-07-10 07:03 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-07-10 07:03:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jerry James 2023-07-06 14:57:52 UTC
Create a trivial asciidoc document, say test.txt, with these contents:

= Document Header

This is a trivial AsciiDoc document.

Then run "asciidoc test.txt" in Rawhide.  You will see:

<unknown>:1: SyntaxWarning: invalid escape sequence '\S'

I have tracked the issue down to asciidoc/asciidoc.py, line 2911:

self.separator = ast.literal_eval('"' + self.separator + '"')

The issue is that self.separator can be an escape sequence, so the code should include an 'r' to ask for evaluation of a raw string; i.e.,

self.separator = ast.literal_eval('r"' + self.separator + '"')

The '\S' in question comes from asciidoc's own configuration files, by the way.

Reproducible: Always

Steps to Reproduce:
1. See above
2.
3.
Actual Results:  
Warning about an invalid escape sequence while asciidoc reads its configuration files.

Expected Results:  
No warnings.

Comment 1 Jerry James 2023-07-07 17:18:20 UTC
Upstream PR: https://github.com/asciidoc-py/asciidoc-py/pull/267

Comment 2 Josef Ridky 2023-07-10 07:03:22 UTC
Fixed in Rawhide.

Build https://koji.fedoraproject.org/koji/taskinfo?taskID=103157275


Note You need to log in before you can comment on or make changes to this bug.