def __init__(self, f, *args, **kwargs): print type(f) # => <class 'django.core.files.uploadedfile.InMemoryUploadedFile'> print type(f.encoding) # => AttributeError: 'cStringIO.StringO' object has no attribute 'encoding'
How can it in the first line claim that it is an InMemoryUploadedFile, but in the second line, where I try to access an attribute on it, claim to be a StringO? To test that this issue is not the result of the instance being passed too far into my code (where my code messes something up), I tried the same test in the view directly with the request.FILES['file'] instance, and the same issue occurs. I should be able to continue without this attribute, but now I'm just curious. If anyone knows what's going on, please let me know. Thanks.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/zvo4GJWsYigJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment