Apache OpenOffice (AOO) Bugzilla – Issue 121612
Mail merge broken due to Python3 conversion
Last modified: 2022-10-28 12:54:15 UTC
revision 1423676 seems to have applied the "2to3 source-to-source conversion tool, all print statements are automatically converted to print() function calls, so this is mostly a non-issue for larger projects." http://docs.python.org/3.0/whatsnew/3.0.html#print-is-a-function Converting statements as the following: Old: print >>sys.stderr, "fatal error" New: print("fatal error", file=sys.stderr) print("fatal error", file=sys.stderr) is no valid Python 2 syntax, so this broke mailmerge.py
"arielch" committed SVN revision 1432668 into trunk: i121612 - Fix broken python mail component
Fixed by replacing print( "$STRING", file=sys.stderr) only valid in Python3, with out = sys.stderr out.write("$STRING\n") that works both in Python2 and Python3. I only checked the mail component, but other stuff might be broken to.
(In reply to comment #2) > Fixed by replacing > > print( "$STRING", file=sys.stderr) > > only valid in Python3, with > > out = sys.stderr > out.write("$STRING\n") > > that works both in Python2 and Python3. > > I only checked the mail component, but other stuff might be broken to. Thank you for the fix! I opengroked "sys.stderr" and it appears it was the only case where this happened.