arty-name / livejournal-export

Export your LiveJournal (posts + comments) to XML, JSON and optionally convert them to HTML and Markdown
45 stars 16 forks source link

Outdated String Formatting \s #16

Closed dsnvwlmnt closed 4 months ago

dsnvwlmnt commented 4 months ago

FWIW Python 3.12 gives a syntax warning, which to my understanding in a future Python version will be a syntax error:

export.py:19: SyntaxWarning: invalid escape sequence '\s' NEWLINES = re.compile('(\s*\n){3,}')

I'm not sure what effect this had on my exported blog... A cursory look seems to be fine...

There are 2 solutions listed here: https://stackoverflow.com/questions/50504500

Either 1) declare it a string literal by putting an r in front: r'(\s*\n){3,}' Or 2) maybe you can double escape the s: '(\\s*\n){3,}'

I'm a little out of my depth to say more.

arty-name commented 4 months ago

Thank you for your very detailed input!