commit facbc7981d9668312b189a21d94a4c60dd1d4342
Author: Jonas Haag <jonas@lophus.org>
Date:   Fri Mar 23 18:51:06 2012 +0100

    stuff.patch

diff --git a/django/contrib/sessions/tests.py b/django/contrib/sessions/tests.py
index 4d2fefe..0368ca2 100644
--- a/django/contrib/sessions/tests.py
+++ b/django/contrib/sessions/tests.py
@@ -404,10 +404,7 @@ class SessionMiddlewareTests(unittest.TestCase):
 
         # Handle the response through the middleware
         response = middleware.process_response(request, response)
-        # If it isn't in the cookie, that's fine (Python 2.5)
-        if 'httponly' in settings.SESSION_COOKIE_NAME:
-            self.assertFalse(
-               response.cookies[settings.SESSION_COOKIE_NAME]['httponly'])
+        self.assertFalse(response.cookies[settings.SESSION_COOKIE_NAME]['httponly'])
 
         self.assertNotIn('httponly',
                          str(response.cookies[settings.SESSION_COOKIE_NAME]))
diff --git a/django/core/cache/__init__.py b/django/core/cache/__init__.py
index 346deae..9eac8ec 100644
--- a/django/core/cache/__init__.py
+++ b/django/core/cache/__init__.py
@@ -25,12 +25,7 @@ try:
     # The mod_python version is more efficient, so try importing it first.
     from mod_python.util import parse_qsl
 except ImportError:
-    try:
-        # Python 2.6 and greater
-        from urlparse import parse_qsl
-    except ImportError:
-        # Python 2.5.  Works on Python 2.6 but raises PendingDeprecationWarning
-        from cgi import parse_qsl
+    from urlparse import parse_qsl
 
 __all__ = [
     'get_cache', 'cache', 'DEFAULT_CACHE_ALIAS'
diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py
index 176ccef..2f1775e 100644
--- a/django/core/management/commands/loaddata.py
+++ b/django/core/management/commands/loaddata.py
@@ -1,6 +1,3 @@
-# This is necessary in Python 2.5 to enable the with statement, in 2.6
-# and up it is no longer necessary.
-
 import sys
 import os
 import gzip
@@ -15,7 +12,7 @@ from django.core.management.color import no_style
 from django.db import (connections, router, transaction, DEFAULT_DB_ALIAS,
       IntegrityError, DatabaseError)
 from django.db.models import get_apps
-from django.utils.itercompat import product
+from itertools import product
 
 try:
     import bz2
diff --git a/django/http/__init__.py b/django/http/__init__.py
index 94478ae..5f407a4 100644
--- a/django/http/__init__.py
+++ b/django/http/__init__.py
@@ -18,17 +18,9 @@ try:
     # The mod_python version is more efficient, so try importing it first.
     from mod_python.util import parse_qsl
 except ImportError:
-    try:
-        # Python 2.6 and greater
-        from urlparse import parse_qsl
-    except ImportError:
-        # Python 2.5. Works on Python 2.6 but raises PendingDeprecationWarning
-        from cgi import parse_qsl
+    from urlparse import parse_qsl
 
 import Cookie
-# httponly support exists in Python 2.6's Cookie library,
-# but not in Python 2.5.
-_morsel_supports_httponly = 'httponly' in Cookie.Morsel._reserved
 # Some versions of Python 2.7 and later won't need this encoding bug fix:
 _cookie_encodes_correctly = Cookie.SimpleCookie().value_encode(';') == (';', '"\\073"')
 # See ticket #13007, http://bugs.python.org/issue2193 and http://trac.edgewall.org/ticket/2256
@@ -39,28 +31,10 @@ try:
 except Cookie.CookieError:
     _cookie_allows_colon_in_names = False
 
-if _morsel_supports_httponly and _cookie_encodes_correctly and _cookie_allows_colon_in_names:
+if _cookie_encodes_correctly and _cookie_allows_colon_in_names:
     SimpleCookie = Cookie.SimpleCookie
 else:
-    if not _morsel_supports_httponly:
-        class Morsel(Cookie.Morsel):
-            def __setitem__(self, K, V):
-                K = K.lower()
-                if K == "httponly":
-                    if V:
-                        # The superclass rejects httponly as a key,
-                        # so we jump to the grandparent.
-                        super(Cookie.Morsel, self).__setitem__(K, V)
-                else:
-                    super(Morsel, self).__setitem__(K, V)
-
-            def OutputString(self, attrs=None):
-                output = super(Morsel, self).OutputString(attrs)
-                if "httponly" in self:
-                    output += "; httponly"
-                return output
-    else:
-        Morsel = Cookie.Morsel
+    Morsel = Cookie.Morsel
 
     class SimpleCookie(Cookie.SimpleCookie):
         if not _cookie_encodes_correctly:
@@ -88,7 +62,7 @@ else:
 
                 return val, encoded
 
-        if not _cookie_allows_colon_in_names or not _morsel_supports_httponly:
+        if not _cookie_allows_colon_in_names:
             def load(self, rawdata):
                 self.bad_cookies = set()
                 super(SimpleCookie, self).load(rawdata)
diff --git a/django/utils/http.py b/django/utils/http.py
index d343a37..dbd18d8 100644
--- a/django/utils/http.py
+++ b/django/utils/http.py
@@ -207,20 +207,9 @@ def quote_etag(etag):
     """
     return '"%s"' % etag.replace('\\', '\\\\').replace('"', '\\"')
 
-if sys.version_info >= (2, 6):
-    def same_origin(url1, url2):
-        """
-        Checks if two URLs are 'same-origin'
-        """
-        p1, p2 = urlparse.urlparse(url1), urlparse.urlparse(url2)
-        return (p1.scheme, p1.hostname, p1.port) == (p2.scheme, p2.hostname, p2.port)
-else:
-    # Python 2.5 compatibility. This actually works for Python 2.6 and above,
-    # but the above definition is much more obviously correct and so is
-    # preferred going forward.
-    def same_origin(url1, url2):
-        """
-        Checks if two URLs are 'same-origin'
-        """
-        p1, p2 = urlparse.urlparse(url1), urlparse.urlparse(url2)
-        return p1[0:2] == p2[0:2]
+def same_origin(url1, url2):
+    """
+    Checks if two URLs are 'same-origin'
+    """
+    p1, p2 = urlparse.urlparse(url1), urlparse.urlparse(url2)
+    return (p1.scheme, p1.hostname, p1.port) == (p2.scheme, p2.hostname, p2.port)
diff --git a/django/utils/itercompat.py b/django/utils/itercompat.py
index 82434b7..83a8bec 100644
--- a/django/utils/itercompat.py
+++ b/django/utils/itercompat.py
@@ -7,23 +7,7 @@ these implementations if necessary.
 import __builtin__
 import itertools
 import warnings
-
-# Fallback for Python 2.5
-def product(*args, **kwds):
-    """
-    Taken from http://docs.python.org/library/itertools.html#itertools.product
-    """
-    # product('ABCD', 'xy') --> Ax Ay Bx By Cx Cy Dx Dy
-    # product(range(2), repeat=3) --> 000 001 010 011 100 101 110 111
-    pools = map(tuple, args) * kwds.get('repeat', 1)
-    result = [[]]
-    for pool in pools:
-        result = [x+[y] for x in result for y in pool]
-    for prod in result:
-        yield tuple(prod)
-
-if hasattr(itertools, 'product'):
-    product = itertools.product
+from itertools import product
 
 def is_iterable(x):
     "A implementation independent way of checking for iterables"
diff --git a/setup.py b/setup.py
index 1f14245..a19f660 100644
--- a/setup.py
+++ b/setup.py
@@ -88,7 +88,6 @@ setup(
         'License :: OSI Approved :: BSD License',
         'Operating System :: OS Independent',
         'Programming Language :: Python',
-        'Programming Language :: Python :: 2.5',
         'Programming Language :: Python :: 2.6',
         'Programming Language :: Python :: 2.7',
         'Topic :: Internet :: WWW/HTTP',
diff --git a/tests/modeltests/serializers/tests.py b/tests/modeltests/serializers/tests.py
index d474937..02538b0 100644
--- a/tests/modeltests/serializers/tests.py
+++ b/tests/modeltests/serializers/tests.py
@@ -1,5 +1,3 @@
-# This is necessary in Python 2.5 to enable the with statement, in 2.6
-# and up it is no longer necessary.
 from __future__ import absolute_import
 
 # -*- coding: utf-8 -*-
