On 11/16/20 12:17 AM, Maciej W. Rozycki wrote:
Hi Martin,
Hello.
I have decided to give your `contrib/mklog.py' script a hit and, well,
ahem, I guess I must be doing something utterly silly, but no matter what
kind of a diff I hand to the script it does not produce anything unless I
apply a patch like below to it, in which case the output produced is as
expected.
Hm, it should not be really needed. See:
$ git show > 1
$ ipython
$ from unidiff import PatchSet
$ PatchSet(open('1'))
Out[2]: <PatchSet: [<PatchedFile: gcc/config/i386/i386.h>, <PatchedFile:
gcc/doc/invoke.texi>]>
This is with plain Debian systems, Stretch (9.7) and Buster (10.6), the
latter being the most recent stable release, and `python3-unidiff' package
versions 0.5.2 and 0.5.4 respectively. I actually have figured out how to
patch your script by examining a `python3-unidiff' script included with
the said packages (of the same name, coincidentally).
I gather I must be the only one seeing that, as usually, or it would have
been addressed one way or another.
What's going on here -- has the API of `PatchSet' changed so much at one
point? Can we do anything to prevent someone else from tripping over this
issue?
Can you please show how do you use the script and what's the output?
Thanks,
Martin
Maciej the confused
diff --git a/contrib/mklog.py b/contrib/mklog.py
index 1e85dfe583a..becf076b77d 100755
--- a/contrib/mklog.py
+++ b/contrib/mklog.py
@@ -243,7 +243,7 @@ if __name__ == '__main__':
args.input = None
input = open(args.input) if args.input else sys.stdin
- data = input.read()
+ data = input
output = generate_changelog(data, args.no_functions,
args.fill_up_bug_titles)
if args.changelog: