mirror of
https://github.com/apple/pkl.git
synced 2026-01-14 23:53:44 +01:00
File extension conflicts with Python's .pkl #52
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bitnom on GitHub (Feb 11, 2024).
I'm sure you're aware the file extension .pkl has long been used by Python. Think of all the Python scripts and tooling out there which look for .pkl files. One consequence off the top of my head is that many .gitignore boilerplates contain
*.pkl. There must be countless projects already referencing .pkl files.Maybe add a fourth character before this thing spreads any further. I'm super curious what the rationale was for greenlighting a conflicting file-extension.
@cellomath commented on GitHub (Feb 12, 2024):
Per the Python Docs,
Thus, any programs searching the filesystem for
*.pklpython files are responsible for maintaining that they only load.pklfiles they trust, and not this format's config files.In the other case that the program is not responsible for managing the directory, you'll also get thrown a
_pickle.UnpicklingError: Memo value not found at [index]if attempting to unpickle a .pkl config file, which can be handled by the program.Are you thinking of a project in particular for which this file extension conflict might cause an issue?
@bioball commented on GitHub (Feb 14, 2024):
As far as I'm aware, Python's pickle doesn't have an official file extension. Python's authors themselves seem to have moved on from
.pkl, and now prefer.pickle: https://stackoverflow.com/questions/40433474/preferred-or-most-common-file-extension-for-a-python-pickleFor projects that look to use both Pkl and python pickle, maybe it's best to use
.pickleas the filename for python pickle files.@chrisvander commented on GitHub (Feb 14, 2024):
I don't think this is relevant. Pickled files have long been saved on developer preference; there's no particular reason that they have to use
.pklor.pickle.@moritztim commented on GitHub (Feb 14, 2024):
This should be closed as "not planned"
@bioball commented on GitHub (Feb 14, 2024):
Agree; closing this.
@akshitsingh23 commented on GitHub (Jul 7, 2024):
I used pickle to save my model for a project. I stored the visualizer file also in pickle format. But when I am integrating it with Flask and using them to generate output. It is giving only 1 output.
For the frontend I am using react.
I have tried downloading model.pkl from colab but still getting wrong output.
Can you please help me.
@moritztim commented on GitHub (Jul 8, 2024):
@akshitsingh23 This is the comment section of an issue in a different project that uses the same file extension. This repository has nothing to do with python's pickle library. You could try directing your question at StackOverflow.