Closed Javalar closed 2 months ago
Calling get_hash under any condition raises an exception with message TypeError: Object of type PackageCollection is not JSON serializable.
get_hash
TypeError: Object of type PackageCollection is not JSON serializable
Example code:
from plette import Pipfile with open('Pipfile', 'r', encoding='UTF-8') as file: pipfile = Pipfile.load(file) pipfile.get_hash()
This is caused by the fact that to_dict now creates a structure which is populated with dataclasses, which json.dumps can't convert to JSON.
to_dict
json.dumps
Looking at the unit tests, I think they are passing because the test Pipfile object does not contain any packages.
Pipfile
Should be fixed in v2.0.0
Description
Calling
get_hash
under any condition raises an exception with messageTypeError: Object of type PackageCollection is not JSON serializable
.Example code:
This is caused by the fact that
to_dict
now creates a structure which is populated with dataclasses, whichjson.dumps
can't convert to JSON.Notes
Looking at the unit tests, I think they are passing because the test
Pipfile
object does not contain any packages.