[Django] #25502: Django test suite fails with Python 3.5.0 because of deprecation warnings

16 views
Skip to first unread message

Django

unread,
Oct 4, 2015, 4:38:44 PM10/4/15
to django-...@googlegroups.com
#25502: Django test suite fails with Python 3.5.0 because of deprecation warnings
-------------------------+-------------------------------------------------
Reporter: | Owner: nobody
arielpontes |
Type: Bug | Status: new
Component: Testing | Version: 1.8
framework | Keywords: deprecation warning test python
Severity: Normal | 3.5.0
Triage Stage: | Has patch: 0
Unreviewed |
Easy pickings: 0 | UI/UX: 0
-------------------------+-------------------------------------------------
When running the test suite locally with Python 3.5.0, the following tests
fail:

{{{
$ ./tests/runtests.py
...
FAIL: test_old_style_storage (file_storage.tests.FileFieldStorageTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/Users/arielpontes/Projects/python/django/tests/file_storage/tests.py",
line 566, in test_old_style_storage
self.assertEqual(len(warns), 2)
AssertionError: 4 != 2

======================================================================
FAIL: test_migrate_legacy_router (multiple_database.tests.RouterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/path/to/project/django/tests/multiple_database/tests.py", line
954, in test_migrate_legacy_router
self.assertEqual(recorded, [])
AssertionError: Lists differ: [<warnings.WarningMessage object at
0x10d65ca58>] != []

First list contains 1 additional elements.
First extra element 0:
{message : DeprecationWarning('inspect.getargspec() is deprecated, use
inspect.signature() instead',), category : 'DeprecationWarning', filename
: '/path/to/project/django/django/db/utils.py', lineno : 336, line : None}

- [<warnings.WarningMessage object at 0x10d65ca58>]
+ []
}}}

In inspecting the warnings with ipdb, it turns out these are the
extra/unexpected ones:

`inspect.getargspec() is deprecated, use inspect.signature() instead`

Its seems this is a new warning in Python 3.5. The latest version of
Python that Django supports isn't declared anywhere. The Django 1.8
documentation says it `requires Python 2.7 or above, though we highly
recommend the latest minor release`, but Python 3.5 clearly hasn't been
actually tested. I believe these statements should be more careful,
something along the lines of "it has been tested with Python 2.7 up to
3.4". These errors don't seem to be serious, but god knows what may break
each time a new version of Python is released.

--
Ticket URL: <https://code.djangoproject.com/ticket/25502>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 4, 2015, 5:58:52 PM10/4/15
to django-...@googlegroups.com
#25502: Django test suite fails with Python 3.5.0 because of deprecation warnings
-------------------------------------+-------------------------------------
Reporter: arielpontes | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.8
Severity: Normal | Resolution:
Keywords: deprecation warning | Triage Stage:
test python 3.5.0 | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by knbk):

* needs_docs: => 0
* component: Testing framework => Documentation
* needs_tests: => 0
* needs_better_patch: => 0


Comment:

The supported Python versions for each Django release are documented
[https://docs.djangoproject.com/en/1.8/faq/install/#faq-python-version-
support in the FAQ]. Django 1.8 only supports Python 2.7 and 3.2 through
3.4. Django 1.9 adds support for 3.5, but also removes any usage of
`inspect.getargspec()`. At http://djangoci.com/ you can see that each
Django version is continuously tested against the full matrix of supported
Python versions and databases, so you don't have to worry that anything
suddenly breaks in any of the supported Python versions.

Where exactly does it say `Python 2.7 or above`? It should be reworded to
accurately reflect the supported versions.

--
Ticket URL: <https://code.djangoproject.com/ticket/25502#comment:1>

Django

unread,
Oct 5, 2015, 2:24:52 AM10/5/15
to django-...@googlegroups.com
#25502: Django test suite fails with Python 3.5.0 because of deprecation warnings
-------------------------------------+-------------------------------------
Reporter: arielpontes | Owner: nobody
Type: Bug | Status: new

Component: Documentation | Version: 1.8
Severity: Normal | Resolution:
Keywords: deprecation warning | Triage Stage:
test python 3.5.0 | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by uranusjr):

I think the OP is referring to the “Python Compatibility” section in the
release notes. The exact line can be seen in the
[https://docs.djangoproject.com/en/1.8/releases/1.8/#python-compatibility
1.8] release notes, and
[https://docs.djangoproject.com/en/1.7/releases/1.7/#python-compatibility
1.7 uses similar wording as well].

--
Ticket URL: <https://code.djangoproject.com/ticket/25502#comment:2>

Django

unread,
Oct 5, 2015, 4:04:35 AM10/5/15
to django-...@googlegroups.com
#25502: Django test suite fails with Python 3.5.0 because of deprecation warnings
-------------------------------------+-------------------------------------
Reporter: arielpontes | Owner: nobody
Type: Bug | Status: new

Component: Documentation | Version: 1.8
Severity: Normal | Resolution:
Keywords: deprecation warning | Triage Stage:
test python 3.5.0 | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by arielpontes):

Oops, sorry about that, it was precipitate of me to claim the supported
versions weren't declared anywhere. Thanks for linking to the detailed
information. But yes, uranusjr is right, I was referring to the "Python
Compatibility" section and I think the wording should be changed. Its
misleading and might cause other people to think that's all that is
documented.

--
Ticket URL: <https://code.djangoproject.com/ticket/25502#comment:3>

Django

unread,
Oct 5, 2015, 9:20:34 AM10/5/15
to django-...@googlegroups.com
#25502: Be explicit about supported Python versions in release notes
-------------------------------------+-------------------------------------
Reporter: arielpontes | Owner: timgraham
Type: | Status: assigned
Cleanup/optimization |

Component: Documentation | Version: 1.8
Severity: Normal | Resolution:
Keywords: deprecation warning | Triage Stage: Accepted
test python 3.5.0 |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* status: new => assigned
* owner: nobody => timgraham
* has_patch: 0 => 1
* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted


Comment:

I already improved the 1.9 and 1.10 release notes, but here's a
[https://github.com/django/django/pull/5394 PR] for older versions.

--
Ticket URL: <https://code.djangoproject.com/ticket/25502#comment:4>

Django

unread,
Oct 5, 2015, 2:19:58 PM10/5/15
to django-...@googlegroups.com
#25502: Be explicit about supported Python versions in release notes
-------------------------------------+-------------------------------------
Reporter: arielpontes | Owner: timgraham
Type: | Status: closed

Cleanup/optimization |
Component: Documentation | Version: 1.8
Severity: Normal | Resolution: fixed

Keywords: deprecation warning | Triage Stage: Accepted
test python 3.5.0 |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"b215a3ab63d1c34746855594656e988561484fe3" b215a3a]:
{{{
#!CommitTicketReference repository=""
revision="b215a3ab63d1c34746855594656e988561484fe3"
Fixed #25502 -- Added supported Python versions in 1.7, 1.8 release notes.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25502#comment:5>

Django

unread,
Oct 5, 2015, 2:20:27 PM10/5/15
to django-...@googlegroups.com
#25502: Be explicit about supported Python versions in release notes
-------------------------------------+-------------------------------------
Reporter: arielpontes | Owner: timgraham
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 1.8
Severity: Normal | Resolution: fixed
Keywords: deprecation warning | Triage Stage: Accepted
test python 3.5.0 |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"bf42888801e927104b7f116df48bacbbda826113" bf428888]:
{{{
#!CommitTicketReference repository=""
revision="bf42888801e927104b7f116df48bacbbda826113"
[1.8.x] Fixed #25502 -- Added supported Python versions in 1.7, 1.8
release notes.

Backport of b215a3ab63d1c34746855594656e988561484fe3 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25502#comment:6>

Django

unread,
Oct 5, 2015, 2:20:30 PM10/5/15
to django-...@googlegroups.com
#25502: Be explicit about supported Python versions in release notes
-------------------------------------+-------------------------------------
Reporter: arielpontes | Owner: timgraham
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 1.8
Severity: Normal | Resolution: fixed
Keywords: deprecation warning | Triage Stage: Accepted
test python 3.5.0 |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"9f31439e67989bfbe4ccdecf79b379b28351ceee" 9f31439]:
{{{
#!CommitTicketReference repository=""
revision="9f31439e67989bfbe4ccdecf79b379b28351ceee"
[1.9.x] Fixed #25502 -- Added supported Python versions in 1.7, 1.8
release notes.

Backport of b215a3ab63d1c34746855594656e988561484fe3 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25502#comment:7>

Reply all
Reply to author
Forward
0 new messages