jwdj / EasyABC

EasyABC
GNU General Public License v2.0
87 stars 36 forks source link

Deprecation warnings in Python 3.12 #89

Open revad opened 5 months ago

revad commented 5 months ago

I've been running a snapshot of EasyABC 1.3.8.7 on Windows with Python 3.8, and I've seen on forums that others are successfully using 3.9. My version now includes the changes for python 3.10 in #77 python 3.11 in #78. The latest python for Windows available from python.org is 3.12.2 so I tried that. No obvious failures, but not a thorough test. (I was testing fluidsynth and playing a selection.)

It displays these deprecation warnings - all need raw strings.

C:\Users\David\Documents\easyabc\easyabc_240312\easyabc\xml2abc_interface.py:103: SyntaxWarning: invalid escape sequence '\d'
  s = re.sub('(?m)^(V:\d+.*\n)', '', s)                      #   remove all V: field lines
C:\Users\David\Documents\easyabc\easyabc_240312\easyabc\xml2abc.py:453: SyntaxWarning: invalid escape sequence '\_'
  elif x.endswith ('_') and not x.endswith ('\_'): # start of new melisma
C:\Users\David\Documents\easyabc\easyabc_240312\easyabc\xml2abc.py:752: SyntaxWarning: invalid escape sequence '\_'
  txt += (e.text or '').replace ('_','\_').replace('-', r'\-').replace(' ', '~')
C:\Users\David\Documents\easyabc\easyabc_240312\easyabc\xml2abc.py:1214: SyntaxWarning: invalid escape sequence '\d'
  tmpro = re.search ('[.\d]+', metr.findtext ('per-minute'))  # look for a number
C:\Users\David\Documents\easyabc\easyabc_240312\easyabc\abc2xml.py:2150: SyntaxWarning: invalid escape sequence '\s'
  fragments = re.split ('^\s*X:', abctext, flags=re.M)
C:\Users\David\Documents\easyabc\easyabc_240312\easyabc\abc_tune.py:20: SyntaxWarning: invalid escape sequence '\['
  inline_meter_re = re.compile('\[{0}\]'.format(meter_pattern))
C:\Users\David\Documents\easyabc\easyabc_240312\easyabc\abc_tune.py:21: SyntaxWarning: invalid escape sequence '\['
  inline_unitlength_re = re.compile('\[{0}\]'.format(unitlength_pattern))
C:\Users\David\Documents\easyabc\easyabc_240312\easyabc\tune_actions.py:662: SyntaxWarning: invalid escape sequence '\d'
  denominator_re = re.compile('/(\d*)')
C:\Users\David\Documents\easyabc\easyabc_240312\easyabc\tune_actions.py:2036: SyntaxWarning: invalid escape sequence '\{'
  for c in '[\{\}]':
C:\Users\David\Documents\easyabc\easyabc_240312\easyabc\tune_elements.py:69: SyntaxWarning: invalid escape sequence '\d'
  clef_pattern = ' *?(?P<clef>(?: (?P<clefprefix>(?:clef=)?)(?P<clefname>{1})(?P<stafftranspose>(?:[+^_-]8)?))?) *?(?P<octave>(?: octave=-?\d+)?) *?(?P<stafflines>(?: stafflines=\d+)?) *?(?P<playtranspose>(?: transpose=-?\d+)?) *?(?P<score>(?: score={0}{0})?) *?(?P<sound>(?: sound={0}{0})?) *?(?P<shift>(?: shift={0}{0})?) *?(?P<instrument>(?: instrument={0}(?:/{0})?)?)'.format(simple_note_pattern, clef_name_pattern)
C:\Users\David\Documents\easyabc\easyabc_240312\easyabc\tune_elements.py:960: SyntaxWarning: invalid escape sequence '\]'
  pattern = r'[^\d\w\s%s]' % re.escape('!"#$%&\'()*+,-./:;<=>?@[\]^_`{|}~')