[MacPorts] #51930: diffoscope @54_0: mixes up Python 3 bytes and strings

MacPorts noreply at macports.org
Wed Jul 27 19:42:01 PDT 2016


#51930: diffoscope @54_0: mixes up Python 3 bytes and strings
----------------------+------------------------
 Reporter:  larryv@…  |      Owner:  raimue@…
     Type:  defect    |     Status:  new
 Priority:  Normal    |  Milestone:
Component:  ports     |    Version:  2.3.99
 Keywords:            |       Port:  diffoscope
----------------------+------------------------
 {{{
 % diffoscope zsh-5.2_0.darwin_15.x86_64.tbz2-*
 Traceback (most recent call last):
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5
 /site-packages/diffoscope/__main__.py", line 177, in main
     sys.exit(run_diffoscope(parsed_args))
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5
 /site-packages/diffoscope/__main__.py", line 148, in run_diffoscope
     parsed_args.file1, parsed_args.file2)
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5
 /site-packages/diffoscope/comparators/__init__.py", line 94, in
 compare_root_paths
     file1 = specialize(FilesystemFile(path1, container=container1))
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5
 /site-packages/diffoscope/comparators/__init__.py", line 175, in
 specialize
     if cls.recognizes(file):
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5
 /site-packages/diffoscope/comparators/ps.py", line 38, in recognizes
     return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5
 /site-packages/diffoscope/comparators/binary.py", line 135, in
 magic_file_type
     self._magic_file_type = File.guess_file_type(self.path)
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5
 /site-packages/diffoscope/comparators/binary.py", line 82, in
 guess_file_type
     return self._mimedb.from_file(path).decode('utf-8')
 AttributeError: 'str' object has no attribute 'decode'
 %
 }}}
 I’m assuming that `self._mimedb.from_file(path)` was expected to return a
 bytes object (or a Python 2 str object).

-- 
Ticket URL: <https://trac.macports.org/ticket/51930>
MacPorts <https://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list