Fixed bug when compiling project which path contains non-ASCII characters
authorLaurent Bessard
Wed, 25 Sep 2013 19:06:18 +0200
changeset 54 eb068364ccfa
parent 53 d92a0c3040a4
child 55 0be064739434
Fixed bug when compiling project which path contains non-ASCII characters
LPCtarget/__init__.py
--- a/LPCtarget/__init__.py	Wed Sep 25 19:04:38 2013 +0200
+++ b/LPCtarget/__init__.py	Wed Sep 25 19:06:18 2013 +0200
@@ -15,10 +15,11 @@
 
     def _get_md5_header(self):
         """Returns signature header"""
+        buildpath = self.buildpath.encode(sys.getfilesystemencoding())
         size = int(Popen(
-             ['arm-elf-size','-B',os.path.join(self.buildpath,"ArmPLC_rom.elf")],
+             ['arm-elf-size','-B',os.path.join(buildpath,"ArmPLC_rom.elf")],
              stdout=PIPE).communicate()[0].splitlines()[1].split()[0])
-        res = "&" + hashlib.md5(open(os.path.join(self.buildpath, "ArmPLC_rom.bin"), "rb").read(size)).hexdigest() + '\n' +\
+        res = "&" + hashlib.md5(open(os.path.join(buildpath, "ArmPLC_rom.bin"), "rb").read(size)).hexdigest() + '\n' +\
               "$" + str(size) + '\n'
         return res