﻿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
21588	"""Modifying upload handlers on the fly"" documentation doesn't replicate internal magic"	Keryn Knight <django@…>	Berker Peksag	"In the documentation for [https://docs.djangoproject.com/en/dev/topics/http/file-uploads/#modifying-upload-handlers-on-the-fly modifying upload handlers on a per-request basis], the examples given imply that simply instantiating a Handler onto the `upload_handlers` is equivalent to setting them globally via [https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-FILE_UPLOAD_HANDLERS FILE_UPLOAD_HANDLERS], however this isn't the case, because the `_initialize_handlers` method of `HttpRequest` passes `self` (ie: the `request` parameter in userland code) to the given handler.

Thus copying or subclassing from one of the default handlers doesn't necessarily work as expected because `request` is always `None` - which is perfectly valid according to the arguments for, say, `FileUploadHandler`.

It would be prudent to note that custom handlers, if they need arguments (including request), should do so at the time of instantiation onto the upload_handlers list"	Cleanup/optimization	closed	Documentation	dev	Normal	fixed		berker.peksag@…	Accepted	1	0	0	1	0	0
