commit 36bec646e5f9e64a0cc3fe65b9fb92d8ac0da838
parent d2d115933cb2431ad0ac9ec37f9fb0a6f2d0cc1f
Author: gearsix <gearsix@tuta.io>
Date: Thu, 25 Apr 2024 10:25:23 +0100
bugfix: regex strings are now raw strings
This avoids some versions of Python throwing an error when interpreting
the regex characters (by default it would interpret unicode strings and
attempt to interpret them as escape invalid characters).
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/sya.py b/src/sya.py
@@ -12,8 +12,8 @@ Version = 'v1.0.1'
Shell = True if sys.platform == 'win32' else False
UnsafeFilenameChars = re.compile('[/\\?%*:|\"<>\x7F\x00-\x1F]')
-TrackNum = re.compile('(?:\d+.? ?-? ?)')
-Timestamp = re.compile('(?: - )?(?:[\t ]+)?(?:[\[\(]+)?((\d+[:.])+(\d+))(?:[\]\)])?(?:[\t ]+)?(?: - )?')
+TrackNum = re.compile(r'(?:\d+.? ?-? ?)')
+Timestamp = re.compile(r'(?: - )?(?:[\t ]+)?(?:[\[\(]+)?((\d+[:.])+(\d+))(?:[\]\)])?(?:[\t ]+)?(?: - )?')
class TracklistItem:
def __init__(self, timestamp, title):