#24826: file_storage.tests.FileFieldStorageTests.test_extended_length_storage
fails
when AUFS is in use
--------------------------------------+--------------------
Reporter: rhertzog | Owner: nobody
Type: Bug | Status: new
Component: File uploads/storage | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
It's quite common to build Debian packages with an AUFS overlay on top of
a clean build environment. However such an overlay imposes a slightly
lower maximum length for filenames. The maximum is 242 according to
http://aufs.sourceforge.net/aufs3/man.html
Due to this, the test
file_storage.tests.FileFieldStorageTests.test_extended_length_storage
fails and the package build fails. This is rather unfortunate. I'm not
quite sure what the point of the test is so I'm not sure what's the best
solution:
* always use 238 "a" instead of 251
* detect AUFS usage and use 238 "a" in that context
* detect AUFS usage and skip the test in that context
* do some tests to detect the true max filename and then pick the
appropriate number of "a"
Only the last one seems really future proof to me because there are
probably multiple contexts in which the maximum length of the filenames
might be reduced (remote FS, other kinds of overlay FS, etc.).
{{{
======================================================================
ERROR: test_extended_length_storage
(file_storage.tests.FileFieldStorageTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/«PKGBUILDDIR»/tests/file_storage/tests.py", line 539, in
test_extended_length_storage
obj.extended_length.save('%s.txt' % filename, ContentFile('Same
Content'))
File "/«PKGBUILDDIR»/django/db/models/fields/files.py", line 94, in save
self.name = self.storage.save(name, content,
max_length=self.field.max_length)
File "/«PKGBUILDDIR»/django/core/files/storage.py", line 64, in save
name = self._save(name, content)
File "/«PKGBUILDDIR»/django/core/files/storage.py", line 249, in _save
fd = os.open(full_path, flags, 0o666)
OSError: [Errno 36] File name too long:
'/tmp/django_GfeLeZ/tmpQaF0eu/tests/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.txt'
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24826>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.3e41967815aa7a38ff9c9ae0826bd4ba%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.