Bug 91048 - Recent changes to contrib/mklog cause failure
Summary: Recent changes to contrib/mklog cause failure
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 10.0
: P3 normal
Target Milestone: ---
Assignee: Janne Blomqvist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-01 22:19 UTC by Kelvin Nilsen
Modified: 2019-07-02 05:57 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kelvin Nilsen 2019-07-01 22:19:33 UTC
./contrib/mklog crashes, even on very simple diff files.  Sample traceback report follows:

./contrib/mklog svn.diffs.7-1-2019 >svn.ChangeLog
Traceback (most recent call last):
 File “./contrib/mklog”, line 470, in <module>
   main()
 File “./contrib/mklog”, line 357, in main
   name, email = read_user_info()
 File “./contrib/mklog”, line 105, in read_user_info
   if cache.match(r’^\s*([a-zA-Z0-9_]+)\s*=\s*(.*?)\s*$’, s):
 File “./contrib/mklog”, line 57, in match
   self.last_match = re.match(p, s) if isinstance(p, str) else p.match(s)
 File “/usr/lib/python3.5/re.py”, line 163, in match
   return _compile(pattern, flags).match(string)
TypeError: cannot use a string pattern on a bytes-like object

I get these problems with any diff file.  In this case, my diff file consists only of the following:

kelvin@genoa:~/gcc-root/gcc-trunk$ cat svn.diffs.7-1-2019 
Index: gcc/doc/extend.texi
===================================================================
--- gcc/doc/extend.texi	(revision 272909)
+++ gcc/doc/extend.texi	(working copy)
@@ -5371,6 +5371,8 @@ Kernel functions must have @code{void} return type
 @node PowerPC Function Attributes
 @subsection PowerPC Function Attributes
 
+kelvin is clowning around here to try to figure out mklog behavior.
+
 These function attributes are supported by the PowerPC back end:
 
 @table @code
Comment 1 Janne Blomqvist 2019-07-02 05:55:02 UTC
Author: jb
Date: Tue Jul  2 05:54:31 2019
New Revision: 272921

URL: https://gcc.gnu.org/viewcvs?rev=272921&root=gcc&view=rev
Log:
mklog/91048: Open ~/.mklog in string mode.

2019-07-02  Janne Blomqvist  <jb@gcc.gnu.org>

	PR other/91048
	* mklog (read_user_info): Open ~/.mklog in string mode.

Modified:
    trunk/contrib/ChangeLog
    trunk/contrib/mklog
Comment 2 Janne Blomqvist 2019-07-02 05:57:15 UTC
Thanks for the report. Fixed, closing.