ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 20 Feb 2020 11:55:33 +0100SageTeX Warning of Sagemath-9.0 on string with Escaped 'S'https://ask.sagemath.org/question/49999/sagetex-warning-of-sagemath-90-on-string-with-escaped-s/After I installed SageMath-9.0 (MacApplication), I encountered the following warning in the log of SageTeX compilation.
```Console
/Applications/SageMath-9.0.app/Contents/Resources/sage/local/lib/python3.7/site-packages/sagetex.py:63: DeprecationWarning: invalid escape sequence \S
[re.match(' *\S', line) for line in lines]
```
I looked through the internet and found a similar situation in some other software.
* ThiefMaster
* "invalid escape sequence" DeprecationWarnings with Python 3.6 #646
* github.com/pallets/jinja/issues/646
I am trying the solution of this page on GitHub.
The relevant part is around line 63 of `sagetex.py`, which I quote here.
<pre>
```python
def strip_common_leading_spaces(s):
lines = s.splitlines()
lead = min(m.end() for m in
[re.match(r' *\S', line) for line in lines]
if m is not None) - 1
return '\n'.join(line[lead:] for line in lines)
```
</pre>
As in this quotation, I just inserted the letter 'r' to the left of the string on line 63.
It is the first line of the deepest indentation in this quotation.
Is this a good solution?
rana-aereaThu, 20 Feb 2020 11:55:33 +0100https://ask.sagemath.org/question/49999/