New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use older filetype detection for linux distributions which do not have python3-magic version 0.4.20 #3021
Comments
Copying from IRC - python3-magic has the current dependency for 0.4.20 (edit: or newer) due to the use of a properly functioning I'd first suggest seeing if 0.4.20 (or newer) can be pushed as an upgrade in the older distro releases. If not, then we could certainly accept a PR that implements fallback logic for the older versions of the magic module. |
We have decided to patch downstream old distributions for Ubuntu like so, (basically reverting to older approach for binary file detection). This keeps file_is_binary() in utilities but changes its internal behavior to not use magic.detect_from_filename() but the older 4.3 approach.
|
Ack, looks fine to me. Closing as resolved downstream. |
For compatibility reasons on some distros, sos should not have a hard dependency on 'magic' python library. It should attempt to use it for detection of binary file content, but should fall back to previous "read the very first byte" method otherwise. Resolves: sosreport#3025 Relates: sosreport#3021 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
For compatibility reasons on some distros, sos should not have a hard dependency on 'magic' python library. It should attempt to use it for detection of binary file content, but should fall back to previous "read the very first byte" method otherwise. Resolves: sosreport#3025 Relates: sosreport#3021 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
For compatibility reasons on some distros, sos should not have a hard dependency on 'magic' python library. It should attempt to use it for detection of binary file content, but should fall back to previous "read the very first byte" method otherwise. Resolves: sosreport#3025 Relates: sosreport#3021 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
For compatibility reasons on some distros, sos should not have a hard dependency on 'magic' python library. It should attempt to use it for detection of binary file content, but should fall back to previous "read the very first byte" method otherwise. Resolves: sosreport#3025 Relates: sosreport#3021 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
For compatibility reasons on some distros, sos should not have a hard dependency on 'magic' python library. It should attempt to use it for detection of binary file content, but should fall back to previous "read the very first byte" method otherwise. Resolves: #3025 Relates: #3021 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
On sos 4.3, filetype detection does not use magic.detect_from_filename()
but it does on 4.4,
( due to 0689d8b )
Older linux distributions may not be having python3-magic version 0.4.20 which provides the detect_from_filename() method (introduced in 0.4.19 , thanks @arif-ali !)
So sos should detect if an older python3-magic version than 0.4.20 is installed and if so, use the older way to detect if a file is binary.
The text was updated successfully, but these errors were encountered: