http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11599
Revision: 11599
Author: drtrigon
Date: 2013-05-30 15:56:47 +0000 (Thu, 30 May 2013)
Log Message:
-----------
bug fix; TypeError: No registered converter was able to produce a C++ rvalue of type
std::string from this Python object of type unicode
Modified Paths:
--------------
trunk/pywikipedia/catimages.py
Modified: trunk/pywikipedia/catimages.py
===================================================================
--- trunk/pywikipedia/catimages.py 2013-05-30 15:24:22 UTC (rev 11598)
+++ trunk/pywikipedia/catimages.py 2013-05-30 15:56:47 UTC (rev 11599)
@@ -1216,7 +1216,8 @@
import jseg
# e.g. "segdist -i test3.jpg -t 6 -r9 test3.map.gif"
enable_recovery() # enable recovery from hard crash
- jseg.segdist_cpp.main( ("segdist -i %s -t 6 -r9 %s"%(tmpjpg,
tmpgif)).split(" ") )
+ jseg.segdist_cpp.main( [ item.encode('utf-8') for item in
+ ("segdist -i %s -t 6 -r9 %s"%(tmpjpg,
tmpgif)).split(" ") ] )
disable_recovery() # disable since everything worked out fine
#out = open((tmpgif + ".stdout"), "r").read() # reading
stdout
#print out