Bug 2220936

Summary: asciidoc: invalid escape sequence '\S'
Product: [Fedora] Fedora Reporter: Jerry James <loganjerry>
Component: asciidocAssignee: Fabian Affolter <mail>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: jridky, mail, nphilipp
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-10 07:03:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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