Opened 18 years ago

Closed 13 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 Gary Wilson <gary.wilson@…>, 18 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Malcolm Tredinnick, 17 years ago

Resolution: invalid
Status: newclosed

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.

comment:3 by anonymous, 13 years ago

Easy pickings: unset
Summary: AttributeError: 'NoneType' object has no attribute 'split''float' object has no attribute 'split'

comment:4 by anonymous, 13 years ago

Resolution: invalid
Status: closedreopened
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

  1. response = callback(request, *callback_args, callback_kwargs)

File "/home/dbarker/cisite/CI/views.py" in addRecord

  1. u_data = collectdata(u) #collect the url information

File "/home/dbarker/cisite/CI/datagrab.py" in collectdata

  1. data = urllib.urlopen(someurl)

File "/usr/lib/python2.6/urllib.py" in urlopen

  1. return opener.open(url)

File "/usr/lib/python2.6/urllib.py" in open

  1. fullurl = unwrap(toBytes(fullurl))

File "/usr/lib/python2.6/urllib.py" in unwrap

  1. url = url.strip()

Exception Type: AttributeError at /addRecord/
Exception Value: 'NoneType' object has no attribute 'strip'

Version 0, edited 13 years ago by anonymous (next)

comment:5 by Aymeric Augustin, 13 years ago

Resolution: invalid
Status: reopenedclosed

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.

Note: See TracTickets for help on using tickets.
Back to Top