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.
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.
The pickle module is not secure. Only unpickle data you trust.
...
Safer serialization formats such as json may be more appropriate if you are processing untrusted data. See Comparison with json
Thus, any programs searching the filesystem for *.pkl python files are responsible for maintaining that they only load .pkl files 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?
@cellomath commented on GitHub (Feb 12, 2024):
Per the [Python Docs](https://docs.python.org/3/library/pickle.html),
> The pickle module is not secure. Only unpickle data you trust.
> ...
> Safer serialization formats such as [json](https://docs.python.org/3/library/json.html#module-json) may be more appropriate if you are processing untrusted data. See [Comparison with json](https://docs.python.org/3/library/pickle.html#comparison-with-json)
Thus, any programs searching the filesystem for `*.pkl` python files are responsible for maintaining that they only load `.pkl` files 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?
For projects that look to use both Pkl and python pickle, maybe it's best to use .pickle as the filename for python pickle files.
@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-pickle
For projects that look to use both Pkl and python pickle, maybe it's best to use `.pickle` as the filename for python pickle files.
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 .pkl or .pickle.
@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 `.pkl` or `.pickle`.
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.
@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.
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.
@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.
@moritztim commented on GitHub (Jul 8, 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.
@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](https://stackoverflow.com/).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.