Opened 12 days ago

Closed 9 days ago

#35740 closed Bug (needsinfo)

file_storage.tests.FileFieldStorageTests.test_extended_length_storage fails when bcachefs is in use

Reported by: Alyssa Ross Owned by:
Component: File uploads/storage Version: 4.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This test constructs a file name of the maximum permissible length reported by the filesystem, then checks that round-tripping it through a FileField with a max_length of 300. If the filesystem reports a maximum permissible length longer than 300, this won't work, because the name will have been truncated by the FileField.

Change History (4)

comment:1 by Alyssa Ross, 12 days ago

Owner: set to Alyssa Ross
Status: newassigned

comment:2 by Alyssa Ross, 12 days ago

Owner: Alyssa Ross removed
Status: assignednew

comment:3 by Sarah Boyce, 10 days ago

Summary: test_extended_length_storage fails on bcachefsfile_storage.tests.FileFieldStorageTests.test_extended_length_storage fails when bcachefs is in use

Refs #24826
Do you have a suggested patch?

comment:4 by Sarah Boyce, 9 days ago

Resolution: needsinfo
Status: newclosed

Increasing the max_length for extended_length might work but I can't find what this number should be for bcachefs.

  • tests/file_storage/models.py

    a b class Storage(models.Model):  
    8080        storage=temp_storage, upload_to="tests", max_length=20
    8181    )
    8282    extended_length = models.FileField(
    83         storage=temp_storage, upload_to="tests", max_length=300
     83        storage=temp_storage, upload_to="tests", max_length=2000
    8484    )

Can you share what _storage_max_filename_length returns for you?

Note: See TracTickets for help on using tickets.
Back to Top