< /pyexiv2/src/pyexiv2/exif.py > /pyexiv2_src-py3k/exif.py 179c179 < values = map(self._convert_to_python, values) --- > values = list(map(self._convert_to_python, values)) 195c195 < raw_values = map(self._convert_to_string, value) --- > raw_values = list(map(self._convert_to_string, value)) 299c299 < return val.decode(encoding, 'replace') --- > return val.encode(encoding, 'replace') 303c303 < return value.decode('utf-8') --- > return value.encode('utf-8') 315c315 < return long(value) --- > return int(value) 358,362d357 < elif isinstance(value, unicode): < try: < return value.encode('utf-8') < except UnicodeEncodeError: < raise ExifValueError(value, self.type) 369c364 < if isinstance(value, unicode): --- > if isinstance(value, str): 394c389 < if isinstance(value, unicode): --- > if isinstance(value, str): 417c412 < if isinstance(value, (int, long)) and value >= 0: --- > if isinstance(value, int) and value >= 0: 423c418 < if isinstance(value, (int, long)): --- > if isinstance(value, int): 441c436 < if isinstance(value, unicode): --- > if isinstance(value, str): 513c508 < cached = self._metadata._tags['exif'].keys() --- > cached = list(self._metadata._tags['exif'].keys()) < /pyexiv2/src/pyexiv2/iptc.py > /pyexiv2_src-py3k/iptc.py 196c196 < NotifyingList(map(self._convert_to_python, self._raw_values)) --- > NotifyingList(list(map(self._convert_to_python, self._raw_values))) 208c208 < self.raw_value = map(self._convert_to_string, values) --- > self.raw_value = list(map(self._convert_to_string, values)) 327c327 < if isinstance(value, unicode): --- > if isinstance(value, str): < /pyexiv2/src/pyexiv2/main.py > /pyexiv2_src-py3k/main.py 37c37 < print 'Usage: %s image_file' % args[0] --- > print('Usage: %s image_file' % args[0]) 45c45 < print '%-45s%-11s%s' % (key, tag.type, str(tag)) --- > print('%-45s%-11s%s' % (key, tag.type, str(tag))) 49c49 < print '%-45s%-11s%s' % (key, tag.type, str(tag)) --- > print('%-45s%-11s%s' % (key, tag.type, str(tag))) < /pyexiv2/src/pyexiv2/metadata.py > /pyexiv2_src-py3k/metadata.py 63,64d62 < if filename is not None and isinstance(filename, unicode): < self.filename = filename.encode(sys.getfilesystemencoding()) 423c421 < except LookupError, error: --- > except LookupError as error: < /pyexiv2/src/pyexiv2/utils.py > /pyexiv2_src-py3k/utils.py 32c32 < from __future__ import division --- > 151,153c151 < if undefined == '': < return '' < return ''.join(map(lambda x: chr(int(x)), undefined.rstrip().split(' '))) --- > return ''.join([chr(int(x)) for x in undefined.rstrip().split(' ')]) 169c167 < return ''.join(map(lambda x: '%d ' % ord(x), sequence)).rstrip() --- > return ''.join(['%d ' % ord(x) for x in sequence]).rstrip() 197,198c195,196 < self._numerator = long(numerator) < self._denominator = long(denominator) --- > self._numerator = int(numerator) > self._denominator = int(denominator) 229c227 < return (long(gd['numerator']), long(gd['denominator'])) --- > return (int(gd['numerator']), int(gd['denominator'])) < /pyexiv2/src/pyexiv2/xmp.py > /pyexiv2_src-py3k/xmp.py 191c191 < self._value = map(lambda x: self._convert_to_python(x, type), self._raw_value) --- > self._value = [self._convert_to_python(x, type) for x in self._raw_value] 194c194 < for k, v in self._raw_value.iteritems(): --- > for k, v in self._raw_value.items(): 196c196 < self._value[unicode(k, 'utf-8')] = unicode(v, 'utf-8') --- > self._value[k] = v 198c198 < raise XmpValueError(self._raw_value, type) --- > raise XmpValueError(self._raw_value, self.type) 226c226 < self.raw_value = map(lambda x: self._convert_to_string(x, stype), value) --- > self.raw_value = [self._convert_to_string(x, stype) for x in value] 228c228 < if isinstance(value, basestring): --- > if isinstance(value, str): 233c233 < for k, v in value.iteritems(): --- > for k, v in value.items(): 359c359 < return unicode(value, 'utf-8') --- > return str(value) 409c409 < if isinstance(value, (int, long)): --- > if isinstance(value, int): 421,426c421 < if isinstance(value, unicode): < try: < return value.encode('utf-8') < except UnicodeEncodeError: < raise XmpValueError(value, type) < elif isinstance(value, str): --- > if isinstance(value, str): 429c424,427 < raise XmpValueError(value, type) --- > try: > return str(value) > except: > raise XmpValueError(value, type) 439,444c437 < if isinstance(value, unicode): < try: < return value.encode('utf-8') < except UnicodeEncodeError: < raise XmpValueError(value, type) < elif isinstance(value, str): --- > if isinstance(value, str): 447c440,443 < raise XmpValueError(value, type) --- > try: > return str(value) > except: > raise XmpValueError(value, type)