← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~hjd/widelands/bug-1315853 into lp:widelands

 

Hans Joachim Desserud has proposed merging lp:~hjd/widelands/bug-1315853 into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1315853 in widelands: "Codecheck just print stack-traces when run with python3"
  https://bugs.launchpad.net/widelands/+bug/1315853

For more details, see:
https://code.launchpad.net/~hjd/widelands/bug-1315853/+merge/218214

Open files in textmode instead of bytes, to make codecheck work in python3 too. Not sure why they were read as binaries in the first place.

I ran two complete builds with python2.7.6 and python3.4.0 with this patch applied, and didn't get any unexpected errors/warnings. 

https://docs.python.org/3.4/tutorial/inputoutput.html#reading-and-writing-files
-- 
https://code.launchpad.net/~hjd/widelands/bug-1315853/+merge/218214
Your team Widelands Developers is requested to review the proposed merge of lp:~hjd/widelands/bug-1315853 into lp:widelands.
=== modified file 'cmake/codecheck/CodeCheck.py'
--- cmake/codecheck/CodeCheck.py	2014-04-06 17:07:29 +0000
+++ cmake/codecheck/CodeCheck.py	2014-05-04 11:40:01 +0000
@@ -288,7 +288,7 @@
         preprocessor = Preprocessor()
 
         # Check line by line (currently)
-        with open(fn,"rb") as file:
+        with open(fn, "r") as file:
             data = file.read()
             for c in self._checkers:
                 if self._benchmark: