Ticket #16155: drop-support-for-python24.patch

File drop-support-for-python24.patch, 20.2 KB (added by Aymeric Augustin, 13 years ago)
  • docs/intro/install.txt

     
    1010--------------
    1111
    1212Being a Python Web framework, Django requires Python. It works with any Python
    13 version from 2.4 to 2.7 (due to backwards
    14 incompatibilities in Python 3.0, Django does not currently work with
    15 Python 3.0; see :doc:`the Django FAQ </faq/install>` for more
    16 information on supported Python versions and the 3.0 transition), but we
    17 recommend installing Python 2.5 or later. If you do so, you won't need to set
    18 up a database just yet: Python 2.5 or later includes a lightweight database
    19 called SQLite_.
     13version from 2.5 to 2.7 (due to backwards incompatibilities in Python 3.0,
     14Django does not currently work with Python 3.0; see :doc:`the Django FAQ
     15</faq/install>` for more information on supported Python versions and the 3.0
     16transition), but we recommend installing Python 2.5 or later. If you do so, you
     17won't need to set up a database just yet: Python 2.5 or later includes a
     18lightweight database called SQLite_.
    2019
    2120.. _sqlite: http://sqlite.org/
    2221
  • docs/internals/contributing/writing-code/branch-policy.txt

     
    135135Once you've retrieved the branch's code, you'll need to change your Python
    136136``site-packages`` directory so that it points to the branch version of the
    137137``django`` directory. (The ``site-packages`` directory is somewhere such as
    138 ``/usr/lib/python2.4/site-packages`` or
    139 ``/usr/local/lib/python2.4/site-packages`` or ``C:\Python\site-packages``.)
     138``/usr/lib/python2.7/site-packages`` or
     139``/usr/local/lib/python2.7/site-packages`` or ``C:\Python\site-packages``.)
    140140
    141141The simplest way to do this is by renaming the old ``django`` directory to
    142142``django.OLD`` and moving the trunk version of the code into the directory
     
    169169    # On windows a path may look like this:
    170170    # C:/path/to/<branch>
    171171
    172 If you're using Django 0.95 or earlier and installed it using
    173 ``python setup.py install``, you'll have a directory called something like
    174 ``Django-0.95-py2.4.egg`` instead of ``django``. In this case, edit the file
    175 ``setuptools.pth`` and remove the line that references the Django ``.egg``
    176 file. Then copy the branch's version of the ``django`` directory into
    177 ``site-packages``.
    178 
    179172.. _path file: http://docs.python.org/library/site.html
    180173.. _django-developers: http://groups.google.com/group/django-developers
  • docs/topics/install.txt

     
    99
    1010Being a Python Web framework, Django requires Python.
    1111
    12 It works with any Python version from 2.4 to 2.7 (due to backwards
     12It works with any Python version from 2.5 to 2.7 (due to backwards
    1313incompatibilities in Python 3.0, Django does not currently work with
    1414Python 3.0; see :doc:`the Django FAQ </faq/install>` for more
    1515information on supported Python versions and the 3.0 transition).
     
    102102  will also want to read the database-specific :ref:`notes for the MySQL
    103103  backend <mysql-notes>`.
    104104
    105 * If you're using SQLite and Python 2.4, you'll need pysqlite_. Use version
    106   2.0.3 or higher. Python 2.5 ships with an SQLite wrapper in the standard
    107   library, so you don't need to install anything extra in that case. Please
    108   read the :ref:`SQLite backend notes <sqlite-notes>`.
    109 
    110105* If you're using Oracle, you'll need a copy of cx_Oracle_, but please
    111106  read the database-specific :ref:`notes for the Oracle backend <oracle-notes>`
    112107  for important information regarding supported versions of both Oracle and
  • docs/topics/db/transactions.txt

     
    7979                # this code executes inside a transaction
    8080                # ...
    8181
    82       This technique works with all supported version of Python (that is, with
    83       Python 2.4 and greater).
    84 
    8582    * As a `context manager`_ around a particular block of code::
    8683
    8784            from django.db import transaction
     
    9693                    # this code executes inside a transaction
    9794                    # ...
    9895
    99       The ``with`` statement is new in Python 2.5, and so this syntax can only
    100       be used with Python 2.5 and above.
     96Both techniques work with all supported version of Python. However, in Python
     972.5, you must add ``from __future__ import with_statement`` at the beginning
     98of your module if you are using the ``with`` statement.
    10199
    102100.. _decorator: http://docs.python.org/glossary.html#term-decorator
    103101.. _context manager: http://docs.python.org/glossary.html#term-context-manager
  • docs/topics/testing.txt

     
    7979    adding some extremely useful features. To ensure that every Django
    8080    project can benefit from these new features, Django ships with a
    8181    copy of unittest2_, a copy of the Python 2.7 unittest library,
    82     backported for Python 2.4 compatibility.
     82    backported for Python 2.5 compatibility.
    8383
    8484    To access this library, Django provides the
    8585    ``django.utils.unittest`` module alias. If you are using Python
  • docs/topics/logging.txt

     
    441441    * ``request``: The request object that generated the logging
    442442      message.
    443443
    444 .. note::
    445     Due to a limitation in the logging library, this extra
    446     context is not available if you are using Python 2.4.
    447 
    448444``django.db.backends``
    449445~~~~~~~~~~~~~~~~~~~~~~
    450446
     
    462458``settings.DEBUG`` is set to ``True``, regardless of the logging
    463459level or handlers that are installed.
    464460
    465 .. note::
    466     Due to a limitation in the logging library, this extra
    467     context is not available if you are using Python 2.4.
    468 
    469461Handlers
    470462--------
    471463
  • docs/releases/1.4.txt

     
    1313.. _new features: `What's new in Django 1.4`_
    1414.. _backwards incompatible changes: backwards-incompatible-changes-1.4_
    1515
     16Python compatibility
     17====================
     18
     19While not a new feature, it's important to note that Django 1.4 introduces the
     20second shift in our Python compatibility policy since Django's initial public
     21debut. Django 1.2 dropped support for Python 2.3; now Django 1.4 drops support
     22for Python 2.4. As such, the minimum Python version required for Django is now
     232.5, and Django is tested and supported on Python 2.5, 2.6 and 2.7.
     24
     25This change should affect only a small number of Django users, as most
     26operating-system vendors today are shipping Python 2.5 or newer as their default
     27version. If you're still using Python 2.4, however, you'll need to stick to
     28Django 1.3 until you can upgrade; per :doc:`our support policy
     29</internals/release-process>`, Django 1.3 will continue to receive security
     30support until the release of Django 1.5.
     31
     32Django does not support Python 3.x at this time. A document outlining our full
     33timeline for deprecating Python 2.x and moving to Python 3.x will be published
     34before the release of Django 1.4.
     35
    1636What's new in Django 1.4
    1737========================
    1838
  • docs/faq/install.txt

     
    1616What are Django's prerequisites?
    1717--------------------------------
    1818
    19 Django requires Python_, specifically any version of Python from 2.4
     19Django requires Python_, specifically any version of Python from 2.5
    2020through 2.7. No other Python libraries are required for basic Django
    2121usage.
    2222
     
    4040.. _`SQLite 3`: http://www.sqlite.org/
    4141.. _Oracle: http://www.oracle.com/
    4242
    43 Do I lose anything by using Python 2.4 versus newer Python versions, such as Python 2.5 or 2.6?
     43Do I lose anything by using Python 2.5 versus newer Python versions, such as Python 2.6 or 2.7?
    4444-----------------------------------------------------------------------------------------------
    4545
    4646Not in the core framework. Currently, Django itself officially supports any
    47 version of Python from 2.4 through 2.7, inclusive. However, newer versions of
     47version of Python from 2.5 through 2.7, inclusive. However, newer versions of
    4848Python are often faster, have more features, and are better supported. If you
    4949use a newer version of Python you will also have access to some APIs that
    50 aren't available under older versions of Python. For example Django provides
    51 some `context managers`_ for various operations. If you use Python 2.4 you
    52 won't be able to use them, however other APIs which provide the same
    53 functionality are always made available.
     50aren't available under older versions of Python. For example, since Python 2.6,
     51you can use the advanced string formatting described in `PEP 3101`_.
    5452
    5553Third-party applications for use with Django are, of course, free to set their
    5654own version requirements.
     
    6159
    6260All else being equal, we recommend that you use the latest 2.x release
    6361(currently Python 2.7). This will let you take advantage of the numerous
    64 improvements and optimizations to the Python language since version 2.4, and
     62improvements and optimizations to the Python language since version 2.5, and
    6563will help ease the process of dropping support for older Python versions on
    6664the road to Python 3.
    6765
    68 .. _context managers: http://docs.python.org/reference/datamodel.html#context-managers
     66.. _PEP 3101: http://www.python.org/dev/peps/pep-3101/
    6967
    7068Can I use Django with Python 2.4?
    7169---------------------------------
  • docs/ref/contrib/gis/install.txt

     
    88========
    99In general, GeoDjango installation requires:
    1010
    11 1. :ref:`python24` and :ref:`django`
     111. :ref:`python25` and :ref:`django`
    12122. :ref:`spatial_database`
    13133. :ref:`geospatial_libs`
    1414
     
    3232Requirements
    3333============
    3434
    35 .. _python24:
    36 
    37 Python 2.4+
    38 -----------
    39 
    40 Python 2.4 is the minimum version supported by Django, however Python 2.5+ is
    41 recommended because the `ctypes`__ module comes included; otherwise, 2.4 users
    42 will need to `download and install ctypes`__.
    43 
    44 __ http://docs.python.org/lib/module-ctypes.html
    45 __ http://sourceforge.net/projects/ctypes/files/
    46 
     35.. _python25:
    4736.. _django:
    4837
    49 Django
    50 ------
     38Python and Django
     39-----------------
    5140
    5241Because GeoDjango is included with Django, please refer to Django's
    5342:doc:`installation instructions </intro/install>` for details on how to install.
     
    10341023* ``flex``: required to build PostGIS
    10351024* ``postgresql-8.1``
    10361025* ``postgresql-server-dev-8.1``: for ``pg_config``
    1037 * ``python-ctypes``: Python 2.4 needs to have ctypes installed separately
    10381026* ``python-psycopg2``
    10391027* ``python-setuptools``: for ``easy_install``
    10401028
  • django/http/__init__.py

     
    1717        # Python 2.6 and greater
    1818        from urlparse import parse_qsl
    1919    except ImportError:
    20         # Python 2.5, 2.4.  Works on Python 2.6 but raises
    21         # PendingDeprecationWarning
     20        # Python 2.5.  Works on Python 2.6 but raises PendingDeprecationWarning
    2221        from cgi import parse_qsl
    2322
    2423import Cookie
    2524# httponly support exists in Python 2.6's Cookie library,
    26 # but not in Python 2.4 or 2.5.
     25# but not in Python 2.5.
    2726_morsel_supports_httponly = Cookie.Morsel._reserved.has_key('httponly')
    2827# Some versions of Python 2.7 and later won't need this encoding bug fix:
    2928_cookie_encodes_correctly = Cookie.SimpleCookie().value_encode(';') == (';', '"\\073"')
  • django/db/models/base.py

     
    914914    return cls.__new__(cls)
    915915model_unpickle.__safe_for_unpickle__ = True
    916916
    917 if sys.version_info < (2, 5):
    918     # Prior to Python 2.5, Exception was an old-style class
    919     def subclass_exception(name, parents, unused):
    920         return types.ClassType(name, parents, {})
    921 else:
    922     def subclass_exception(name, parents, module):
    923         return type(name, parents, {'__module__': module})
     917def subclass_exception(name, parents, module):
     918    return type(name, parents, {'__module__': module})
  • django/db/backends/oracle/base.py

     
    176176        # classes to normalize values from the database (the to_python
    177177        # method is used for validation and isn't what we want here).
    178178        elif isinstance(value, Database.Timestamp):
    179             # In Python 2.3, the cx_Oracle driver returns its own
    180             # Timestamp object that we must convert to a datetime class.
    181             if not isinstance(value, datetime.datetime):
    182                 value = datetime.datetime(value.year, value.month,
    183                         value.day, value.hour, value.minute, value.second,
    184                         value.fsecond)
    185179            if field and field.get_internal_type() == 'DateTimeField':
    186180                pass
    187181            elif field and field.get_internal_type() == 'DateField':
  • django/core/cache/__init__.py

     
    2929        # Python 2.6 and greater
    3030        from urlparse import parse_qsl
    3131    except ImportError:
    32         # Python 2.5, 2.4.  Works on Python 2.6 but raises
    33         # PendingDeprecationWarning
     32        # Python 2.5.  Works on Python 2.6 but raises PendingDeprecationWarning
    3433        from cgi import parse_qsl
    3534
    3635__all__ = [
  • django/utils/translation/trans_real.py

     
    6363class DjangoTranslation(gettext_module.GNUTranslations):
    6464    """
    6565    This class sets up the GNUTranslations context with regard to output
    66     charset. Django uses a defined DEFAULT_CHARSET as the output charset on
    67     Python 2.4.
     66    charset.
    6867    """
    6968    def __init__(self, *args, **kw):
    7069        gettext_module.GNUTranslations.__init__(self, *args, **kw)
  • django/utils/http.py

     
    198198        p1, p2 = urlparse.urlparse(url1), urlparse.urlparse(url2)
    199199        return (p1.scheme, p1.hostname, p1.port) == (p2.scheme, p2.hostname, p2.port)
    200200else:
    201     # Python 2.4, 2.5 compatibility. This actually works for Python 2.6 and
    202     # above, but the above definition is much more obviously correct and so is
     201    # Python 2.5 compatibility. This actually works for Python 2.6 and above,
     202    # but the above definition is much more obviously correct and so is
    203203    # preferred going forward.
    204204    def same_origin(url1, url2):
    205205        """
  • django/utils/itercompat.py

     
    77import itertools
    88import warnings
    99
    10 # Fallback for Python 2.4, Python 2.5
     10# Fallback for Python 2.5
    1111def product(*args, **kwds):
    1212    """
    1313    Taken from http://docs.python.org/library/itertools.html#itertools.product
  • django/utils/hashcompat.py

     
    33hashlib module containing both hash algorithms. Here, we provide a common
    44interface to the md5 and sha constructors, depending on system version.
    55"""
    6 import sys
    7 import warnings
    86
     7import warnings
    98warnings.warn("django.utils.hashcompat is deprecated; use hashlib instead",
    10               PendingDeprecationWarning)
     9              DeprecationWarning)
    1110
    12 if sys.version_info >= (2, 5):
    13     import hashlib
    14     md5_constructor = hashlib.md5
    15     md5_hmac = md5_constructor
    16     sha_constructor = hashlib.sha1
    17     sha_hmac = sha_constructor
    18 else:
    19     import md5
    20     md5_constructor = md5.new
    21     md5_hmac = md5
    22     import sha
    23     sha_constructor = sha.new
    24     sha_hmac = sha
     11import hashlib
     12md5_constructor = hashlib.md5
     13md5_hmac = md5_constructor
     14sha_constructor = hashlib.sha1
     15sha_hmac = sha_constructor
  • tests/regressiontests/admin_scripts/tests.py

     
    11261126        "--help is handled as a special case"
    11271127        args = ['--help']
    11281128        out, err = self.run_manage(args)
    1129         if sys.version_info < (2, 5):
    1130             self.assertOutput(out, "usage: manage.py subcommand [options] [args]")
    1131         else:
    1132             self.assertOutput(out, "Usage: manage.py subcommand [options] [args]")
     1129        self.assertOutput(out, "Usage: manage.py subcommand [options] [args]")
    11331130        self.assertOutput(out, "Type 'manage.py help <subcommand>' for help on a specific subcommand.")
    11341131
    11351132    def test_short_help(self):
    11361133        "-h is handled as a short form of --help"
    11371134        args = ['-h']
    11381135        out, err = self.run_manage(args)
    1139         if sys.version_info < (2, 5):
    1140             self.assertOutput(out, "usage: manage.py subcommand [options] [args]")
    1141         else:
    1142             self.assertOutput(out, "Usage: manage.py subcommand [options] [args]")
     1136        self.assertOutput(out, "Usage: manage.py subcommand [options] [args]")
    11431137        self.assertOutput(out, "Type 'manage.py help <subcommand>' for help on a specific subcommand.")
    11441138
    11451139    def test_specific_help(self):
  • tests/regressiontests/httpwrappers/tests.py

     
    248248        """
    249249        Test that we don't output tricky characters in encoded value
    250250        """
    251         # Python 2.4 compatibility note: Python 2.4's cookie implementation
    252         # always returns Set-Cookie headers terminating in semi-colons.
    253         # That's not the bug this test is looking for, so ignore it.
    254251        c = SimpleCookie()
    255252        c['test'] = "An,awkward;value"
    256253        self.assertTrue(";" not in c.output().rstrip(';')) # IE compat
  • INSTALL

     
    11Thanks for downloading Django.
    22
    3 To install it, make sure you have Python 2.4 or greater installed. Then run
     3To install it, make sure you have Python 2.5 or greater installed. Then run
    44this command from the command prompt:
    55
    66    python setup.py install
     
    99site-packages directory, which is located wherever your Python installation
    1010lives. Some places you might check are:
    1111
     12    /usr/lib/python2.7/site-packages (Unix, Python 2.7)
     13    /usr/lib/python2.6/site-packages (Unix, Python 2.6)
    1214    /usr/lib/python2.5/site-packages (Unix, Python 2.5)
    13     /usr/lib/python2.4/site-packages (Unix, Python 2.4)
    1415    C:\\PYTHON\site-packages         (Windows)
    1516
    1617For more detailed instructions, see docs/intro/install.txt.
Back to Top