Your message dated Thu, 30 Jun 2016 00:48:47 +0000 with message-id <[email protected]> and subject line Bug#828833: fixed in file 1:5.28-2 has caused the Debian Bug report #828833, regarding python3-magic: magic file type double encoded to be marked as done.
This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact [email protected] immediately.) -- 828833: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=828833 Debian Bug Tracking System Contact [email protected] with problems
--- Begin Message ---Package: python3-magic Version: 1:5.28-1 Hi, since python3-magic 1:5.28-1 the file type detection is broken. Instead of returning a string whih contains the magic, it returns double encoded bytes: >>> import magic >>> path = "/usr/share/doc/gdb/refcard.ps.gz" >>> x = magic.open(magic.NONE) >>> x.load() 0 >>> x.file(path) b"b'gzip compressed data, max compression, from Unix'" (Instead of just 'gzip compressed data, max compression, from Unix' like before.) The problem seems to be those lines: > r = _file(self._magic_t, bi) > ... > return str(r).encode('utf-8') r is already of type bytes, converting it to string results in the string "b'gzip compressed data, max compression, from Unix'", which is then encoded to utf-8: b"b'gzip compressed data, max compression, from Unix'" Converting it with str(r, 'utf-8') seems to be the correct way and has the same result as before. Kind regards, Reinerdiff --git a/debian/patches/fix_string_encoding.patch b/debian/patches/fix_string_encoding.patch new file mode 100644 index 0000000..7600a47 --- /dev/null +++ b/debian/patches/fix_string_encoding.patch @@ -0,0 +1,29 @@ +--- a/python/magic.py ++++ b/python/magic.py +@@ -134,7 +134,7 @@ + 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 @@ + 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 @@ + if isinstance(e, str): + return e + else: +- return str(e).encode('utf-8') ++ return str(e, 'utf-8') + + def setflags(self, flags): + """ diff --git a/debian/patches/series b/debian/patches/series index 23199ea..1cb450f 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -7,3 +7,4 @@ local.mention-posixly-correct-dependent-behaviour-in-usage-message.patch local.report-gz-as-application-gzip.patch local.disable-detection-of-vax-coff-executables.patch local.avoid-line-break-warning-from-man.patch +fix_string_encoding.patch
signature.asc
Description: Digital signature
--- End Message ---
--- Begin Message ---Source: file Source-Version: 1:5.28-2 We believe that the bug you reported is fixed in the latest version of file, which is due to be installed in the Debian FTP archive. A summary of the changes between this version and the previous one is attached. Thank you for reporting the bug, which will now be closed. If you have further comments please address them to [email protected], and the maintainer will reopen the bug report if appropriate. Debian distribution maintenance software pp. Christoph Biedl <[email protected]> (supplier of updated file package) (This message was generated automatically at their request; if you believe that there is a problem with it please contact the archive administrators by mailing [email protected]) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Format: 1.8 Date: Thu, 30 Jun 2016 01:39:07 +0200 Source: file Binary: file file-dbg libmagic1 libmagic-dev python-magic python3-magic Architecture: source armhf all Version: 1:5.28-2 Distribution: unstable Urgency: high Maintainer: Christoph Biedl <[email protected]> Changed-By: Christoph Biedl <[email protected]> Description: file - Determines file type using "magic" numbers file-dbg - Determines file type using "magic" numbers (debug) libmagic-dev - File type determination library using "magic" numbers (developmen libmagic1 - File type determination library using "magic" numbers python-magic - File type determination library using "magic" numbers (Python bin python3-magic - File type determination library using "magic" numbers (Python 3 b Closes: 828833 Changes: file (1:5.28-2) unstable; urgency=high . * Enable full hardening build * Cherry-pick commits since 5.28 release: - Avoid "can't break line" warnings from lintian - Don't copy NULL - Avoid double encoding with python3. Closes: #828833 Checksums-Sha1: 4adf3888d6d84f6dd3c63da3e3cc6ebcbe8bb765 2107 file_5.28-2.dsc 24ac26bdc633c221bfa93abd33513122c5b48f93 29424 file_5.28-2.debian.tar.xz 2dbf81d026f601808e8a552bd9198a0be18cc6de 198080 file-dbg_5.28-2_armhf.deb 4bb1b222667b4c15061c8927570292b93f536a61 62358 file_5.28-2_armhf.deb 78310b902137d72af7a1850e2b64063a1df5c5e1 113404 libmagic-dev_5.28-2_armhf.deb cc40863475d76189fe27532a714177d0bb82d6fe 269210 libmagic1_5.28-2_armhf.deb f9e451c9ebd825da06ed2088bec52890bbf9fd71 46954 python-magic_5.28-2_all.deb cbe54a08ab6fb72a2f9f481da1e83184ac9f63d2 47014 python3-magic_5.28-2_all.deb Checksums-Sha256: 418d3ad7bef876c6a264124035a99bb4e8e78ee2601b2555c598fe8f98a7768a 2107 file_5.28-2.dsc e2a112839c3bcb0df981fae41022495776fda01e7a00d96711c7a4eaf1aae302 29424 file_5.28-2.debian.tar.xz 41e83ff361b8e399c7c9cfa01ae96a3b8cc1797c401cf6439259090dc4b72e35 198080 file-dbg_5.28-2_armhf.deb e1b9b93b4c74f3bf5e70572cabc67e284f236aa09b9169ffe409652d9709372d 62358 file_5.28-2_armhf.deb cdc94727e2aa72cc62a258ec2471aed03743e6acf616638183c2d0c30ca98c92 113404 libmagic-dev_5.28-2_armhf.deb 655bfd846ef28c2bf941771ecc37426bead487bb028f8e1b1ba96c4ce6bcd08c 269210 libmagic1_5.28-2_armhf.deb 0e716968cb254cc61fdaa8b07d5ccfe4c553048e192a37cb746435010680e966 46954 python-magic_5.28-2_all.deb 0bec96413261d9937d9bb662342d62fd9f51656bd9338e330da48a5b7d01be07 47014 python3-magic_5.28-2_all.deb Files: 4683d9f45cfb5fcbeb96d2c87e4973c1 2107 utils standard file_5.28-2.dsc 63a8b0dd16c8d4af18e47bbb21ffce54 29424 utils standard file_5.28-2.debian.tar.xz ff76656d626ebc2d119e5d9f7c18a349 198080 debug extra file-dbg_5.28-2_armhf.deb 9340dd50239181798faf8bbf3415b73c 62358 utils standard file_5.28-2_armhf.deb e274eb4205e1798e8707a2a86c62ed0d 113404 libdevel optional libmagic-dev_5.28-2_armhf.deb a7b0fe40318cc87212770fd468273034 269210 libs standard libmagic1_5.28-2_armhf.deb 5fccb8858e413783585570767b0e534c 46954 python optional python-magic_5.28-2_all.deb dac16e0e3ca043d5b212b3722e6d5435 47014 python optional python3-magic_5.28-2_all.deb -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJXdGFpAAoJEMQsWOtZFJL9d94P/0W35DlUuM9B6Ei5Vsr+zH9r kFA2/ilSVoGZbsLrUAdSue2Wy8HmnUJf36mLwsG3TdLnWR1I8KkNVYgVQ5v2v5Zp IDYmGSNdH1+/ERBjQpMV5nihmTtW7Kfc20vauE2a+pTDriE3H1avePY0C776gwRf PUVEYhnOzbkTx5Tkc+SNb/0YWsU/eaNWEKPqyqlF75ov2+WWDgs6OzAY4kjesyri bKylEJ+8sHqYBiylKBv+oFW++VZycBYRgiLzLVk8sZWu1B8jBFSX5PIjiOTWL5Xk fKJTWPAkBjG7luDa48QIVymCu+FhEOhfiSb0iSiTkylUA23r6UDB6k4BSYQlvT7n wgrvI3QcbaxkuOqO+S/QX5R8310ssccrJ/aCO4rSC8wWYG0Dr5egzwXyTY38FdM2 6sv47wya0JK2zPhxQ1z0zSsCYC5vtJ1Nqxi+e+FQoYhHT1dgbam0rmyuSOh6BLwW 7x3tFLE82pSRmMIPlrP0AMEWaDsvEWfq9KSqIX2EgZBH0hisLQF5hKJqvXOjDRrP NtXE4zFdT9nZgTLsTlS5Nvq9l8xeuuoFxkmGRJ413dCcET9gZchuZ71QA/wbM081 x3Q1RCJJ2KR1MVFlpePVBix22Esv78YXFe3HOmxqdr9vailKALNXu/JG8+PZT2Zi co35R/vuP9mEBO26DTPG =dqJm -----END PGP SIGNATURE-----
--- End Message ---

