mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-25 11:37:43 -10:00
The zipfile.is_zipfile() function is overly lenient, in that non-zip files that contain the four bytes "PK\005\006" near the end of the file are reported as zip files even if the zip structure is not valid. Occasionally, our target.tar.bz2 files randomly contain those 4 bytes at the expected location, which causes the mar repackaging code to try to process the package as a zip file instead of a tar file. The tarfile.is_tarfile() logic looks a little more robust in that it actually tries to open the file, so if we try tar first before falling back to zip we should be a little more resilient. Differential Revision: https://phabricator.services.mozilla.com/D31908
This directory contains common Python code. The basic rule is that if Python code is cross-module (that's "module" in the Mozilla meaning - as in "module ownership") and is MPL-compatible, it should go here. What should not go here: * Vendored python modules (use third_party/python instead) * Python that is not MPL-compatible (see other-licenses/) * Python that has good reason to remain close to its "owning" (Mozilla) module (e.g. it is only being consumed from there). Historical information can be found at https://bugzilla.mozilla.org/show_bug.cgi?id=775243 https://bugzilla.mozilla.org/show_bug.cgi?id=1346025