Opened 15 years ago

Closed 10 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


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/", line 46,
in parse_file_upload
  name_dict = parse_header(submessage['Content-Disposition'])[1]

 File "/usr/lib/python2.4/", 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 Changed 14 years ago by Gary Wilson <gary.wilson@…>

Triage Stage: UnreviewedAccepted

comment:2 Changed 14 years ago by Malcolm Tredinnick

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 Changed 10 years ago by anonymous

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

comment:4 Changed 10 years ago by anonymous

Resolution: invalid
Status: closedreopened
UI/UX: unset

Having AttributeError 'NoneType' object has no attribute 'strip' problem

Request Method: GET
Request URL:

Django Version: 1.3
Python Version: 2.6.6
Installed Applications:
Installed Middleware:

File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/dbarker/cisite/CI/" in addRecord
  73. 		u_data = collectdata(u)     #collect the url information
File "/home/dbarker/cisite/CI/" in collectdata
  48.     data = urllib.urlopen(someurl)
File "/usr/lib/python2.6/" in urlopen
  86.         return
File "/usr/lib/python2.6/" in open
  179.         fullurl = unwrap(toBytes(fullurl))
File "/usr/lib/python2.6/" in unwrap
  1034.     url = url.strip()

Exception Type: AttributeError at /addRecord/
Exception Value: 'NoneType' object has no attribute 'strip'
Last edited 10 years ago by Aymeric Augustin (previous) (diff)

comment:5 Changed 10 years ago by Aymeric Augustin

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