Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid/unnecessary string escape sequences #1017

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

gkatev
Copy link

@gkatev gkatev commented Jun 26, 2024

This fixes a couple of occurences of invalid/unnecessary escape sequences in strings. In Python 3.12 these result in SyntaxWarnings. The one in StartPage is what we're most interested in, as it appears quite prominently when opening FreeCAD:

image

Error log:

$ FreeCAD                                                                                        1 ↵
FreeCAD 0.21.0, Libs: 0.21.0R38998 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2023
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

/usr/lib/freecad/Ext/freecad/fc_cadquery/selectors.py:178: SyntaxWarning: invalid escape sequence '\|'
  """
/usr/lib/freecad/Ext/freecad/fc_cadquery/selectors.py:556: SyntaxWarning: invalid escape sequence '\|'
  """
/usr/lib/freecad/Ext/freecad/fc_cadquery/selectors.py:608: SyntaxWarning: invalid escape sequence '\|'
  """
/usr/lib/freecad/Mod/Start/StartPage/StartPage.py:151: SyntaxWarning: invalid escape sequence '\/'
  _Re_Pattern = "<Property name=\"{}\".*?String value=\"(.*?)\"\/>"

These invalid sequences are an issue because they result in SyntaxWarnings
in Python 3.12. The one in StartPage is what we're most interested in,
as it appears quite prominently when opening FreeCAD.
@realthunder realthunder merged commit 4e382d8 into realthunder:LinkStable Sep 3, 2024
@realthunder
Copy link
Owner

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants