Opened 18 years ago
Closed 14 years ago
#3104 closed defect (invalid)
'float' object has no attribute 'split'
Reported by: | anonymous | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This is actually a ticket just to give a pointer to the root cause, which is a bug in python's email module, which Django uses to parse multi-part form uploads.
The python bug has a patch on it.
Here's the traceback:
File "/pegasus/code/current/django/utils/httpwrappers.py", line 46, in parse_file_upload name_dict = parse_header(submessage['Content-Disposition'])[1] File "/usr/lib/python2.4/cgi.py", line 331, in parse_header plist = map(lambda x: x.strip(), line.split(';')) AttributeError: 'NoneType' object has no attribute 'split'
Change History (5)
comment:1 by , 18 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:3 by , 14 years ago
Easy pickings: | unset |
---|---|
Summary: | AttributeError: 'NoneType' object has no attribute 'split' → 'float' object has no attribute 'split' |
comment:4 by , 14 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
UI/UX: | unset |
Having AttributeError 'NoneType' object has no attribute 'strip' problem
Environment:
Request Method: GET
Request URL: http://172.16.13.46:8080/addRecord/
Django Version: 1.3
Python Version: 2.6.6
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
'CI']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.csrf.CsrfResponseMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response
- response = callback(request, *callback_args, callback_kwargs)
File "/home/dbarker/cisite/CI/views.py" in addRecord
- u_data = collectdata(u) #collect the url information
File "/home/dbarker/cisite/CI/datagrab.py" in collectdata
- data = urllib.urlopen(someurl)
File "/usr/lib/python2.6/urllib.py" in urlopen
- return opener.open(url)
File "/usr/lib/python2.6/urllib.py" in open
- fullurl = unwrap(toBytes(fullurl))
File "/usr/lib/python2.6/urllib.py" in unwrap
- url = url.strip()
Exception Type: AttributeError at /addRecord/
Exception Value: 'NoneType' object has no attribute 'strip'
comment:5 by , 14 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
Your problem occurs inside urllib.urlopen(someurl)
in your own code, so it's completely unrelated to Django, let alone to the ticket you reopened.
This tracker is not the right place to discuss Python usage problems. Please ask such questions in a Python developers forum / chat instead.
PS: my guess is that someurl
is None
.
The Python bug referenced has been marked private, so now we have even less information than before to understand what's going on here. If this problem is still a problem, can somebody reopen with (a) a title that is a bit more explanatory, (b) an explanation of what the problem is and how to repeat it.