diff --git a/preprocess.py b/preprocess.py
index b5351a8c35ed65115d98056868860d6a5a26d3dc..1d1800e22b3a742e01bbcde849bc1bdd63268463 100644
--- a/preprocess.py
+++ b/preprocess.py
@@ -7,8 +7,9 @@ import sys
 from mtdUtils import setNoDataValue
 
 
-def getSizeFromOTBInfo(str):
-    str_lines = str.split('\n')
+def getSizeFromOTBInfo(string):
+    string = str(string)
+    str_lines = string.split('\\n')
     line = None
     W, H = -1, -1
     for x in str_lines: