freemyipod r807 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r806‎ | r807 | r808 >
Date:01:59, 21 November 2011
Author:theseven
Status:new
Tags:
Comment:
libemcore.py: Fix Python 3 problem in emcore.py's ls function
Modified paths:
  • /emcore/trunk/tools/libemcore.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/libemcore.py
@@ -871,7 +871,7 @@
872872 dirent = self.read(result.ptr, result.maxpath + 16)
873873 ret = Bunch()
874874 (ret.name, ret.attributes, ret.size, ret.startcluster, ret.wrtdate, ret.wrttime) = struct.unpack("<%dsIIIHH" % result.maxpath, dirent)
875 - ret.name = ret.name[:ret.name.index('\x00')]
 875+ ret.name = ret.name[:ret.name.index(b"\0")].decode("utf_8")
876876 self.logger.debug("Read directory entry:\n")
877877 self.logger.debug("Name: %s\n" % ret.name)
878878 self.logger.debug("Attributes: 0x%X\n" % ret.attributes)