﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24826	file_storage.tests.FileFieldStorageTests.test_extended_length_storage fails when AUFS is in use	Raphaël Hertzog	nobody	"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'
}}}"	Bug	closed	File uploads/storage	1.8	Normal	fixed			Ready for checkin	1	0	0	0	0	0
