[MacPorts] #70527: itstool @2.0.7_2+python312: SyntaxWarning: invalid escape sequence

MacPorts noreply at macports.org
Thu Aug 15 10:09:40 UTC 2024


#70527: itstool @2.0.7_2+python312: SyntaxWarning: invalid escape sequence
----------------------------+---------------------------
  Reporter:  christophecvr  |      Owner:  christophecvr
      Type:  defect         |     Status:  closed
  Priority:  Normal         |  Milestone:
 Component:  ports          |    Version:  2.10.99
Resolution:  fixed          |   Keywords:  haspatch
      Port:  itstool        |
----------------------------+---------------------------

Comment (by christophecvr):

 Replying to [comment:5 ryandesign]:
 > I know that. I was showing you the fix that had been proposed to
 upstream so that you might consider using that fix in your MacPorts PR.
 Instead you fixed the problem a different way. I have not analyzed the two
 fixes to determine if they are equivalent.

 Sorry I missed this comment of you, just found it now.
 Basically there is not much difference . There are two ways of changing
 that escape sequence.
 One way is using and r in front of the string or add an backslash to the
 escape sequence: \\

 {{{
 r'\s' or '\\s'
 }}}
 \\
  for escaping a more complicated escape sequence like '\< ... >' it's best
 to use (in python)

 {{{
 r'\<...>'
 }}}

 Else it is much easier to use a double backslash

 In the patch they used only the r option I used both. Since my change was
 tested very extensive I kept my solution.

-- 
Ticket URL: <https://trac.macports.org/ticket/70527#comment:6>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list