Skip to content

MD5 hash for gridfs is deprecated #891

Open

Description

@Kwentar

_id = self.fs.put(f, filename=abs_path)

Looks like md5 hash doesn't work as earlier in gridfs, and all files will be added without checking md5 (file in file = self.fs.find_one({"filename": abs_path, "md5": md5}) always None), I fixed it like _id = self.fs.put(f, filename=abs_path, md5=md5) but not sure this is the correct one

Activity

  1. adriennie commented on Oct 26, 2026

    @adriennie

    Hi! I'd like to work on this. Could I be assigned?

    I've reproduced it on current master with PyMongo 4.x: saving the same unchanged
    source file twice stores two copies in GridFS instead of reusing the first one.
    I have a fix with a regression test ready to open as a PR.

    Quick scope question: resource_event() uses the same md5 lookup and looks
    affected too. Should I include it in the same PR or open a separate one?

    @thequilo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions