-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
Add a feature to override file extension defining compression #607
Comments
I think the current way we're handling compression is not ideal. It isn't obvious what the ignore_ext flag is doing, and it has no effect on files without an extension, as you've mentioned in the ticket and the associated PR. This has been bothering me for a while, and I've come up with two solutions:
Unless we find other alternatives, 2 is the way to go, but it will take some time to get it right. OTOH, we'd replace ignore_ext with a parameter like "compression", which will be an enum-like variable with the following values:
|
I agree that this is the best option, but why does it have to be backwards-incompatible? After the (If both |
Good point @aperiodic. We could introduce the new parameter without immediately removing the old one. |
Thanks @mpenkov. Any feedback on when a release might get cut? |
Probably within the next month or so. |
Problem description
Transparent compression/decompression is a killer feature that could be made more broadly applicable, if decoupled from the extension of the underlying "file". Tying application-handling behavior to "file" extension is not a universally portable idea (for example, on classic UNIX, a "shebang" line encodes the same information), and some decoupling already exists in the current
ignore_ext
flag tosmart_open.open
. This feature would complete the decoupling by allowing the extension to be effectively overridden to force a compression-handling behavior, by supplying aoverride_ext
string tosmart_open.open
. At that point, users would be free to name "files" without extensions, and still have the ability to take advantage of the great feature.Steps/code to reproduce the problem
N/A (not a defect), but any file path without an extension is not eligible for transparent compression/decompression, currently.
Versions
Checklist
Before you create the issue, please make sure you have:
The text was updated successfully, but these errors were encountered: