I'm using cx-Freeze to freeze a PyQt5 application. On my Jenkins slave running OSX 10.13, when cx-Freeze is using the file command to check the type of the files, it classifies a .pyc file (python bytecode) as a dBase III DBT file with some non-utf-8 characters in the output:

$>file ./__pycache__/archive_util.cpython-35.opt-2.pyc
./__pycache__/archive_util.cpython-35.opt-2.pyc: dBase III DBT, version number 0, next free block index 168627479, 1st item "N)?warn)?DistutilsExecError)?spawn)?mkpath)?log)getpwnam)getgrnamc"

When I run the file command on the same file on my own Mac OS, I get the correct classification:

$>file ./__pycache__/archive_util.cpython-35.opt-2.pyc
./__pycache__/archive_util.cpython-35.opt-2.pyc: python 3.5.2+ byte-compiled

What could possibly make file command to behave that way in the Jenkins build machine?

  • File actually just guesses based on a database of heuristics. Dont rely on it to be right. Sep 14, 2019 at 14:48

1 Answer 1


It's probably a different version of the file command with a different magic file /usr/share/file/magic.mgc (see the source files /usr/share/file/magic/database for the "dBase III" definitions and /usr/share/file/magic/python for python) or your pyc files are different (different python version and/or code) and file has a false match on Jenkins.

Have you compared the files or swapped them and run file on them again? If both files are the same, it must be a different magic.mgc file (or if it is missing different source files or a different configuration like a MAGIC environment variable, but that's not very likely).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.