subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1845386 - /subversion/trunk/tools/dist/release.py
Date Wed, 31 Oct 2018 20:21:49 GMT
Author: danielsh
Date: Wed Oct 31 20:21:49 2018
New Revision: 1845386

URL: http://svn.apache.org/viewvc?rev=1845386&view=rev
Log:
release.py: Avoid undefined behaviour.

In Python, «'\x'», where \x isn't a defined escape sequence, is an expression
whose meaning may change in the future as new sequences are added.

* tools/dist/release.py
  (write_changelog): Use «r''» string literals to avoid undefined escape sequences
    in «''» string literals.

[c:skip]

Modified:
    subversion/trunk/tools/dist/release.py

Modified: subversion/trunk/tools/dist/release.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dist/release.py?rev=1845386&r1=1845385&r2=1845386&view=diff
==============================================================================
--- subversion/trunk/tools/dist/release.py (original)
+++ subversion/trunk/tools/dist/release.py Wed Oct 31 20:21:49 2018
@@ -1327,8 +1327,8 @@ def write_changelog(args):
     
     separator_pattern = re.compile('^-{72}$')
     revline_pattern = re.compile('^r(\d+) \| [^\|]+ \| [^\|]+ \| \d+ lines?$')
-    changes_prefix_pattern = re.compile('^\[(U|D)?:?([^\]]+)?\](.+)$')
-    changes_suffix_pattern = re.compile('^(.+)\[(U|D)?:?([^\]]+)?\]$')
+    changes_prefix_pattern = re.compile(r'^\[(U|D)?:?([^\]]+)?\](.+)$')
+    changes_suffix_pattern = re.compile(r'^(.+)\[(U|D)?:?([^\]]+)?\]$')
     # TODO: push this into backport.status as a library function
     auto_merge_pattern = \
         re.compile(r'^Merge (r\d+,? |the r\d+ group |the \S+ branch:)')
@@ -1391,13 +1391,13 @@ def write_changelog(args):
 
         if not got_firstline:
             got_firstline = True
-            if (not re.search('status|changes|post-release housekeeping|follow-up|^\*',
+            if (not re.search(r'status|changes|post-release housekeeping|follow-up|^\*',
                               line, re.IGNORECASE)
                     and not changes_prefix_pattern.match(line)
                     and not changes_suffix_pattern.match(line)):
                 unlabeled_summary = line
 
-        if re.search('\[(c:)?(skip|ignore)\]', line, re.IGNORECASE):
+        if re.search(r'\[(c:)?(skip|ignore)\]', line, re.IGNORECASE):
             changes_ignore = True
             
         prefix_match = changes_prefix_pattern.match(line)



Mime
View raw message