Opened 6 years ago
Last modified 6 years ago
#29454 closed Cleanup/optimization
Default size for django.core.files.uploadedfile is None and then len will raise error — at Initial Version
Reported by: | jxltom | Owned by: | nobody |
---|---|---|---|
Component: | File uploads/storage | Version: | 2.0 |
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
By default, size
of django.core.files.uploadedfile is
None
and
__len__
will return
size
by default. Calling
len
will raise
TypeError: 'NoneType' object cannot be interpreted as an integer
error if size is not assigned specifically.
Can this be handled better? such as do not implement __len__
method if
size
is set as
None
Note:
See TracTickets
for help on using tickets.