From 577998be9ab7dea40e46a2b5f3d8b2a819bb26df Mon Sep 17 00:00:00 2001 From: Vivek Myers Date: Thu, 2 Jan 2025 12:52:30 -0800 Subject: [PATCH] Escape backslashes to avoid "invalid escape sequence '\s'" syntax warnings --- pythontex/pythontex3.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pythontex/pythontex3.py b/pythontex/pythontex3.py index 488c234..43e5fe9 100644 --- a/pythontex/pythontex3.py +++ b/pythontex/pythontex3.py @@ -546,7 +546,7 @@ def do_upgrade_compatibility(data, old_data, temp_data): data['settings']['outputdir'] != '.'): data['compatibility'] = c data['settings']['workingdir'] = data['settings']['outputdir'] - msg = ''' + msg = r''' **** PythonTeX upgrade message **** Beginning with v0.14, the default working directory is the document directory rather than the output directory. PythonTeX has detected @@ -554,7 +554,7 @@ def do_upgrade_compatibility(data, old_data, temp_data): It will continue to use the output directory for now. To keep your current settings long-term and avoid seeing this message in the future, add the following command to the preamble of your document, right after - the "\\usepackage{pythontex}": "\setpythontexworkingdir{}". + the "\usepackage{pythontex}": "\setpythontexworkingdir{}". If you wish to continue with the new settings instead, simply delete the file with extension .pkl in the output directory, and run PythonTeX. **** End PythonTeX upgrade message **** @@ -1807,7 +1807,7 @@ def run_code(encoding, outputdir, workingdir, # Get the gobbleation. This is used to determine if # other lines containing the basename are a continuation, # or separate messages. - errgobble = match('(\s*)', line).groups()[0] + errgobble = match(r'(\s*)', line).groups()[0] if start_errgobble is None: start_errgobble = errgobble # Only issue a message and track down the line numer if @@ -2072,7 +2072,7 @@ def run_code(encoding, outputdir, workingdir, # Get the gobbleation. This is used to determine if # other lines containing the basename are a continuation, # or separate messages. - errgobble = match('(\s*)', line).groups()[0] + errgobble = match(r'(\s*)', line).groups()[0] if start_errgobble is None: start_errgobble = errgobble # Only issue a message and track down the line numer if