DoubleCiti / mongodb-migrations

A database migration tool for MongoDB
GNU General Public License v3.0
71 stars 43 forks source link

Python 3.12 SyntaxWarning #54

Open valentyn-malenchak opened 4 months ago

valentyn-malenchak commented 4 months ago

Hi,

After migrating my project to Python 3.12, I started receiving the following warning:

C:\PATH_TO_MY_VENV\Lib\site-packages\mongodb_migrations\cli.py:32: SyntaxWarning: invalid escape sequence '\d'
  result = re.match('^(\d+)[_a-z]*\.py$', file)

This warning is indicating that the escape sequence \d is invalid in the regular expression provided: https://docs.python.org/3/whatsnew/3.12.html#other-language-changes So locally I tried to replace regex pattern '^(\d+)[_a-z]*\.py$' to raw string r'^(\d+)[_a-z]*\.py$' and it works fine.

What are your thoughts on this issue? Can I help with PR?

And thank you a lot for this great tool!

gmetzker-4c commented 3 weeks ago

Agreed would nice to see this released.