Code

Opened 8 years ago

Closed 3 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'

Attachments (0)

Change History (5)

comment:1 Changed 7 years ago by Gary Wilson <gary.wilson@…>

  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 7 years ago by mtredinnick

  • Resolution set to invalid
  • Status changed from new to closed

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

  • Easy pickings unset
  • Summary changed from AttributeError: 'NoneType' object has no attribute 'split' to 'float' object has no attribute 'split'

comment:4 Changed 3 years ago by anonymous

  • Resolution invalid deleted
  • Status changed from closed to 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

  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 3 years ago by anonymous (next)

comment:5 Changed 3 years ago by aaugustin

  • Resolution set to invalid
  • Status changed from reopened to 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.