subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1877953 - /subversion/trunk/tools/dist/release.py
Date Wed, 20 May 2020 12:46:12 GMT
Author: stsp
Date: Wed May 20 12:46:11 2020
New Revision: 1877953

URL: http://svn.apache.org/viewvc?rev=1877953&view=rev
Log:
Fix an TypeError exception in 'release.py create-tag'.

Regular expression matching failed due to lack of an explicit encoding
for files modified during the post-release housekeeping step.

The exception was observed with Python 3.7.7 and looked as follows:

INFO:root:Bumping version numbers on the branch
Traceback (most recent call last):
  File "/home/stsp/svn/svn-trunk/tools/dist/release.py", line 1916, in <module>
    main()
  File "/home/stsp/svn/svn-trunk/tools/dist/release.py", line 1912, in main
    args.func(args)
  File "/home/stsp/svn/svn-trunk/tools/dist/release.py", line 1134, in create_tag_and_bump_versions
    bump_versions_on_branch(args)
  File "/home/stsp/svn/svn-trunk/tools/dist/release.py", line 1108, in bump_versions_on_branch
    str(args.version.patch), str(new_version.patch))
  File "/home/stsp/svn/svn-trunk/tools/dist/release.py", line 1078, in replace_in_place
    replacement = re.sub(pattern, repl, line)
  File "/usr/local/lib/python3.7/re.py", line 192, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: cannot use a string pattern on a bytes-like object

* tools/dist/release.py
  (bump_versions_on_branch): Create temporary file handles with an explicit
   encoding argument (assume UTF-8).

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=1877953&r1=1877952&r2=1877953&view=diff
==============================================================================
--- subversion/trunk/tools/dist/release.py (original)
+++ subversion/trunk/tools/dist/release.py Wed May 20 12:46:11 2020
@@ -1096,7 +1096,7 @@ def bump_versions_on_branch(args):
                                    universal_newlines=True).strip()
     HEAD = int(HEAD)
     def file_object_for(relpath):
-        fd = tempfile.NamedTemporaryFile()
+        fd = tempfile.NamedTemporaryFile(mode='w+', encoding='UTF-8')
         url = branch_url + '/' + relpath
         fd.url = url
         subprocess.check_call(['svn', 'cat', '%s@%d' % (url, HEAD)],



Mime
View raw message