running "python setup.py" with command "test" and parameters ()
running test
running egg_info
writing diffoscope.egg-info/PKG-INFO
writing entry points to diffoscope.egg-info/entry_points.txt
writing requirements to diffoscope.egg-info/requires.txt
writing dependency_links to diffoscope.egg-info/dependency_links.txt
writing top-level names to diffoscope.egg-info/top_level.txt
reading manifest file 'diffoscope.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'diffoscope.egg-info/SOURCES.txt'
running build_ext
============================= test session starts ==============================
platform linux -- Python 3.5.2 -- py-1.4.31 -- pytest-2.7.3
rootdir: /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61, inifile:
collected 247 items
tests/test_difference.py ...
tests/test_main.py .FF...FFFFFF.
tests/comparators/test_binary.py EEFFFFFEsEEE.s.ss..
tests/comparators/test_bzip2.py EEEFEE
tests/comparators/test_cbfs.py ssssss
tests/comparators/test_cpio.py EEssss
tests/comparators/test_deb.py EEEEFEEEEEE
tests/comparators/test_debian.py .F.EEF.EE.F.EF.F.EF
tests/comparators/test_dex.py EEss
tests/comparators/test_directory.py ..EE
tests/comparators/test_elf.py EEEEEEEEEE
tests/comparators/test_epub.py EEss
tests/comparators/test_fonts.py EEss
tests/comparators/test_fsimage.py Esss
tests/comparators/test_gettext.py EEsss
tests/comparators/test_git.py EEE
tests/comparators/test_gzip.py EEEEFEE
tests/comparators/test_haskell.py sEs
tests/comparators/test_icc.py EEss
tests/comparators/test_image.py EEss
tests/comparators/test_ipk.py EEEEE
tests/comparators/test_iso9660.py EEsssss
tests/comparators/test_java.py EEss
tests/comparators/test_json.py EEEE
tests/comparators/test_macho.py EEss
tests/comparators/test_mono.py EEss
tests/comparators/test_pdf.py EEsss
tests/comparators/test_png.py EEss
tests/comparators/test_ppu.py sEss
tests/comparators/test_ps.py EEsss
tests/comparators/test_rlib.py EEEEEEsE
tests/comparators/test_rpm.py Esssss
tests/comparators/test_sqlite.py EEss
tests/comparators/test_squashfs.py EEEEsss
tests/comparators/test_tar.py EEEEEEE
tests/comparators/test_text.py EEEEEE
tests/comparators/test_utils.py .ssEEEE.
tests/comparators/test_xz.py EEEFEE
tests/comparators/test_zip.py EEsssEEsss
==================================== ERRORS ====================================
_____________________ ERROR at setup of test_same_content ______________________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/binary1>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
___________________ ERROR at setup of test_not_same_content ____________________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/binary1>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
________________ ERROR at setup of test_no_differences_with_xxd ________________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/binary1>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
_____________ ERROR at setup of test_compare_non_existing_with_xxd _____________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/binary1>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
______________ ERROR at setup of test_no_differences_without_xxd _______________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/binary1>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
__________________ ERROR at setup of test_compare_without_xxd __________________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/binary1>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
____________________ ERROR at setup of test_identification _____________________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/test1.bz2>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
____________________ ERROR at setup of test_no_differences _____________________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/test1.bz2>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
____________________ ERROR at setup of test_content_source _____________________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/test1.bz2>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
_____________________ ERROR at setup of test_content_diff ______________________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/test1.bz2>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
_________________ ERROR at setup of test_compare_non_existing __________________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/test1.bz2>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
____________________ ERROR at setup of test_identification _____________________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/test1.cpio>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
____________________ ERROR at setup of test_no_differences _____________________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/test1.cpio>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
____________________ ERROR at setup of test_identification _____________________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/test1.deb>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
____________________ ERROR at setup of test_no_differences _____________________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/test1.deb>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
_______________________ ERROR at setup of test_metadata ________________________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/test1.deb>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
___________________ ERROR at setup of test_compressed_files ____________________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/test1.deb>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
___________ ERROR at setup of test_identification_of_md5sums_in_deb ____________
> lambda: specialize(FilesystemFile(filename))
)
tests/comparators/utils.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/__init__.py:161: in specialize
if cls.recognizes(file):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file = <<class 'diffoscope.comparators.binary.FilesystemFile'> /tmp/guix-build-diffoscope-61.drv-0/diffoscope-61/tests/data/test1.deb>
@staticmethod
def recognizes(file):
> return PsFile.RE_FILE_TYPE.match(file.magic_file_type)
E TypeError: cannot use a string pattern on a bytes-like object
diffoscope/comparators/ps.py:40: TypeError
________________________ ERROR at setup of test_md5sums ________________________
=================================== FAILURES ===================================
_______________________________ test_superblock ________________________________
differences = []
@skip_unless_tool_is_older_than('unsquashfs', unsquashfs_version, '4.3')
def test_superblock(differences):
expected_diff = open(data('squashfs_superblock_expected_diff')).read()
> assert differences[0].unified_diff == expected_diff
E IndexError: list index out of range
tests/comparators/test_squashfs.py:59: IndexError
============== 1 failed, 173 passed, 73 skipped in 16.46 seconds ===============
From 349cd1cbc2020f9ec045516d4d0984b3bee4975d Mon Sep 17 00:00:00 2001
From: Leo Famulari <leo@famulari.name>
Date: Mon, 17 Oct 2016 16:48:27 -0400
Subject: [PATCH 1/2] gnu: python-file: Don't create a compressed egg.
* gnu/packages/python.scm (python-file, python2-file)[arguments]: Pass
"--single-version-externally-managed" "--root=/" to #:configure-flags.
---
gnu/packages/python.scm | 1 +
1 file changed, 1 insertion(+)
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 0e648cd..1222e88 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -6462,6 +6462,7 @@ Python's @code{ctypes} foreign function interface (FFI).")
(build-system python-build-system)
(arguments
'(#:tests? #f ;no tests
+ #:configure-flags '("--single-version-externally-managed" "--root=/")
#:phases (modify-phases %standard-phases
(add-before 'build 'change-directory
(lambda _
--
2.10.1
From 823b6beab65163d1f37caf540c8d672e835a6083 Mon Sep 17 00:00:00 2001
From: Leo Famulari <leo@famulari.name>
Date: Mon, 17 Oct 2016 20:12:32 -0400
Subject: [PATCH 2/2] gnu: python-file: Fix build failure present in file@5.28.
* gnu/packages/patches/python-file-double-encoding-bug.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/python.scm (python-file)[source]: Use it.
---
gnu/local.mk | 1 +
.../patches/python-file-double-encoding-bug.patch | 49 ++++++++++++++++++++++
gnu/packages/python.scm | 4 ++
3 files changed, 54 insertions(+)
create mode 100644 gnu/packages/patches/python-file-double-encoding-bug.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 1c91e79..1b5a29b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -785,6 +785,7 @@ dist_patch_DATA = \
%D%/packages/patches/python-3.5-fix-tests.patch \
%D%/packages/patches/python-dendropy-exclude-failing-tests.patch \
%D%/packages/patches/python-django-fix-testcase.patch \
+ %D%/packages/patches/python-file-double-encoding-bug.patch \
%D%/packages/patches/python-fix-tests.patch \
%D%/packages/patches/python-ipython-inputhook-ctype.patch \
%D%/packages/patches/python-rarfile-fix-tests.patch \
diff --git a/gnu/packages/patches/python-file-double-encoding-bug.patch b/gnu/packages/patches/python-file-double-encoding-bug.patch
new file mode 100644
index 0000000..21910b0
--- /dev/null
+++ b/gnu/packages/patches/python-file-double-encoding-bug.patch
@@ -0,0 +1,49 @@
+Fix bug that causes build failure with Python 3.
+
+Copied from upstream source repository:
+
+https://github.com/file/file/commit/73e043d2a986234b187a00ed0c8d1f7bf83df372
+
+From 73e043d2a986234b187a00ed0c8d1f7bf83df372 Mon Sep 17 00:00:00 2001
+From: Christos Zoulas <christos@zoulas.com>
+Date: Tue, 28 Jun 2016 17:10:22 +0000
+Subject: [PATCH] PR/562: Reiner Herrmann: Avoid double encoding with python3
+
+---
+ python/magic.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/python/magic.py b/python/magic.py
+index c48f7d5..b0f7a17 100644
+--- a/python/magic.py
++++ b/python/magic.py
+@@ -134,7 +134,7 @@ class Magic(object):
+ if isinstance(r, str):
+ return r
+ else:
+- return str(r).encode('utf-8')
++ return str(r, 'utf-8')
+
+ def descriptor(self, fd):
+ """
+@@ -152,7 +152,7 @@ class Magic(object):
+ if isinstance(r, str):
+ return r
+ else:
+- return str(r).encode('utf-8')
++ return str(r, 'utf-8')
+
+ def error(self):
+ """
+@@ -163,7 +163,7 @@ class Magic(object):
+ if isinstance(e, str):
+ return e
+ else:
+- return str(e).encode('utf-8')
++ return str(e, 'utf-8')
+
+ def setflags(self, flags):
+ """
+--
+2.10.1
+
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 1222e88..94c2fc0 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -6459,6 +6459,10 @@ Python's @code{ctypes} foreign function interface (FFI).")
(package
(inherit file)
(name "python-file")
+ (source (origin
+ (inherit (package-source file))
+ ;; XXX This patch should not be applied to python2-file.
+ (patches (search-patches "python-file-double-encoding-bug.patch"))))
(build-system python-build-system)
(arguments
'(#:tests? #f ;no tests
--
2.10.1