diff --git a/pkgs/development/python-modules/python-magic/default.nix b/pkgs/development/python-modules/python-magic/default.nix index b0aeb1264a38..adcbc9e547da 100644 --- a/pkgs/development/python-modules/python-magic/default.nix +++ b/pkgs/development/python-modules/python-magic/default.nix @@ -38,6 +38,9 @@ buildPythonPackage rec { url = "https://github.com/ahupp/python-magic/commit/3d2405ca80cd39b2a91decd26af81dcf181390a4.patch"; hash = "sha256-HRsnO9MGfMD9BkJdC4SrEFQ1OZEaXpwakXFLoaCPK94="; }) + + # Fix test failures due to modified output in file 5.47 + ./fix-parquet-test.patch ]; preCheck = '' diff --git a/pkgs/development/python-modules/python-magic/fix-parquet-test.patch b/pkgs/development/python-modules/python-magic/fix-parquet-test.patch new file mode 100644 index 000000000000..6062b28d30ca --- /dev/null +++ b/pkgs/development/python-modules/python-magic/fix-parquet-test.patch @@ -0,0 +1,20 @@ +--- a/test/python_magic_test.py ++++ b/test/python_magic_test.py +@@ -93,7 +93,7 @@ class MagicTest(unittest.TestCase): + 'magic._pyc_': ('application/octet-stream', 'text/x-bytecode.python', 'application/x-bytecode.python'), + 'test.pdf': 'application/pdf', + 'test.gz': ('application/gzip', 'application/x-gzip'), +- 'test.snappy.parquet': 'application/octet-stream', ++ 'test.snappy.parquet': ('application/octet-stream', 'application/vnd.apache.parquet'), + 'text.txt': 'text/plain', + b'\xce\xbb'.decode('utf-8'): 'text/plain', + b'\xce\xbb': 'text/plain', +@@ -123,7 +123,7 @@ class MagicTest(unittest.TestCase): + ': Sun Jun 29 01:32:52 2008, from Unix, truncated' + ), + 'text.txt': 'ASCII text', +- 'test.snappy.parquet': ('Apache Parquet', 'Par archive data'), ++ 'test.snappy.parquet': ('Apache Parquet', 'Apache Parquet file', 'Par archive data'), + }, buf_equals_file=False) + finally: + del os.environ['TZ']