--
Ticket URL: <https://code.djangoproject.com/ticket/27025>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by timgraham):
A couple failures bisected to
[https://github.com/python/cpython/commit/56376cacd2a0f6af834fe4d2a20b1a1095afb26f
the implementation] of [https://www.python.org/dev/peps/pep-0495/ PEP 495]
-- Local Time Disambiguation.
{{{
======================================================================
FAIL: test_localtime_naive (utils_tests.test_timezone.TimezoneTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/tim/code/django/tests/utils_tests/test_timezone.py", line
32, in test_localtime_naive
timezone.localtime(datetime.datetime.now())
AssertionError: ValueError not raised
======================================================================
FAIL: test_make_naive (utils_tests.test_timezone.TimezoneTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/tim/code/django/tests/utils_tests/test_timezone.py", line
140, in test_make_naive
timezone.make_naive(datetime.datetime(2011, 9, 1, 13, 20, 30), EAT)
AssertionError: ValueError not raised
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:1>
Comment (by aaugustin):
Likely the time zone docs need some small additions to acknowledge the
existence of PEP 495 -- even if the code can't rely on it until we drop
support for Python < 3.6.
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:2>
Comment (by GitHub <noreply@…>):
In [changeset:"35225e2ade08ea32e36a994cd4ff90842c599e20" 35225e2a]:
{{{
#!CommitTicketReference repository=""
revision="35225e2ade08ea32e36a994cd4ff90842c599e20"
Refs #27025 -- Fixed a servers test on Python 3.6.
After https://hg.python.org/cpython/rev/4ea79767ff75/,
test_strips_underscore_headers fails with:
'Stub' object has no attribute 'sendall'.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:3>
Comment (by GitHub <noreply@…>):
In [changeset:"a7a7ecd2b026c61a39a46d2d7eced0e06a92c970" a7a7ecd2]:
{{{
#!CommitTicketReference repository=""
revision="a7a7ecd2b026c61a39a46d2d7eced0e06a92c970"
Refs #27025 -- Fixed a couple timezone tests for Python 3.6.
Reflects behavior changes in PEP 495 (Local Time Disambiguation).
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:4>
Comment (by timgraham):
Django's test are passing with master @
2b759c94c562c9ee9b6ca970739be15014050fda and cpython master @
47f6c10084ed9aa8a08dbac20d5f6b814063c2df.
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:5>
Comment (by Tim Graham <timograham@…>):
In [changeset:"49412f55a5de7c3fa773e8a911439beb1568b901" 49412f55]:
{{{
#!CommitTicketReference repository=""
revision="49412f55a5de7c3fa773e8a911439beb1568b901"
Refs #27025 -- Fixed a test for the new re.RegexFlag in Python 3.6.
http://bugs.python.org/issue28082
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:7>
Comment (by Tim Graham <timograham@…>):
In [changeset:"16202863facc8629a7422cf74cd3df30142d3aaf" 16202863]:
{{{
#!CommitTicketReference repository=""
revision="16202863facc8629a7422cf74cd3df30142d3aaf"
Refs #27025 -- Fixed tests for the new ModuleNotFoundError in Python 3.6.
http://bugs.python.org/issue15767
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:6>
Comment (by Tim Graham <timograham@…>):
In [changeset:"e43ea36b7681e43ea99505a2cf7550d4d36016b3" e43ea36]:
{{{
#!CommitTicketReference repository=""
revision="e43ea36b7681e43ea99505a2cf7550d4d36016b3"
Refs #27025 -- Fixed a timezone test for Python 3.6.
Reflects behavior changes in PEP 495 (Local Time Disambiguation).
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:9>
Comment (by Tim Graham <timograham@…>):
In [changeset:"8119b679eb85cdc0ae3d321e54d06dd0200a1e82" 8119b679]:
{{{
#!CommitTicketReference repository=""
revision="8119b679eb85cdc0ae3d321e54d06dd0200a1e82"
Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.
http://bugs.python.org/issue27364
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:8>
Comment (by Tim Graham <timograham@…>):
In [changeset:"b5aac66b28c615b2bda63548cbd695dbb5a0c381" b5aac66b]:
{{{
#!CommitTicketReference repository=""
revision="b5aac66b28c615b2bda63548cbd695dbb5a0c381"
Refs #27025 -- Fixed ArrayField querying on Python 3.6.
Python 3.6 parses strings like '0_1' as numeric literals.
http://bugs.python.org/issue26331
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:10>
Comment (by Tim Graham):
I setup a more complete test environment that includes all of the test
suite dependencies and identified a few more failures fixed in the above
commits.
2 failures remain as of Django b5aac66b28c615b2bda63548cbd695dbb5a0c381
and cpython
[https://github.com/python/cpython/commit/d614d687d9db1100d0a4ec8c67e0cb3ce773342b
d614d687d9db1100d0a4ec8c67e0cb3ce773342b] due to a sqlparse
incompatibility with Python 3.6. I submitted a
[https://github.com/andialbrecht/sqlparse/pull/292 PR] to fix it and it's
merged awaiting the next release.
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:11>
Comment (by Tim Graham):
cpython fixed compatibility with sqlparse in
https://hg.python.org/cpython/rev/1a2b8398f045/ so a new sqlparse release
isn't needed and all tests are passing as of now.
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:12>
Comment (by Andrii Soldatenko):
just tested with last Django master
e044026dce063ec53c16d0f755ec75eb8c84b318 and Python 3.6.0b4 works for me.
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:13>
Comment (by Tim Graham):
I have a local Jenkins running with the cpython 3.6 branch and Django
master that I check every couple days. I don't think we'll add Python 3.6
compatibility to older versions of Django such as 1.10 but we'll discuss
it on the DevelopersMailingList if anyone feel it's important.
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:14>
Comment (by Anthony King):
py3.6 breaks calling `super()` (in the python3 style) inside Models with:
`RuntimeError: super(): empty __class__ cell`
This is also present on 1.8 and 1.10
{{{
class ModelToBreak(models.Model):
def save(self, *args, **kwargs):
return super().save(*args, **kwargs)
}}}
{{{#!python
>>> m = ModelToBreak()
>>> m.save()
Traceback (most recent call last):
File "/home/cybo/work/3.6-test/testing/d/tests.py", line 9, in
test_empty_class_fail
m.save()
File "/home/cybo/work/3.6-test/testing/d/models.py", line 5, in save
return super().save(*args, **kwargs)
RuntimeError: super(): empty __class__ cell
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:15>
Comment (by Tim Graham):
Thanks, the relevant commit in cpython is
https://hg.python.org/cpython/rev/feb1ae9d5381.
I'm not sure if Django or cpython is at fault.
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:16>
Comment (by Tim Graham):
After some discussion on the [https://bugs.python.org/issue23722 cpython
issue], I've created a [https://github.com/django/django/pull/7653 PR] to
address the issue, but cpython may also restore backwards-compatibility
and add a deprecation path.
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:17>
Comment (by Anthony King):
Thanks. I'll check all other MetaClasses for similar behaviour today or
tomorrow.
Will also add Py3 tests for them.
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:18>
Comment (by Tim Graham):
I'm not particularly worried about tests since cpython added a deprecation
path. Also, when we drop Python 2 compatibility in master in January,
we'll probably change all `super()` calls to the new style.
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:19>
Comment (by GitHub <noreply@…>):
In [changeset:"dd99e69fa8f89263d0396f23e0db9aa8fa667b01" dd99e69f]:
{{{
#!CommitTicketReference repository=""
revision="dd99e69fa8f89263d0396f23e0db9aa8fa667b01"
Refs #27025 -- Fixed Python 3.6 deprecation warning for empty model
super() calls.
https://bugs.python.org/issue23722
Thanks Nick Coghlan for advice and review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:20>
Comment (by Tim Graham <timograham@…>):
In [changeset:"4701abd56e382bca72d4ff8e0b015948c9ab3feb" 4701abd5]:
{{{
#!CommitTicketReference repository=""
revision="4701abd56e382bca72d4ff8e0b015948c9ab3feb"
Refs #27025 -- Documented Python 3.6 compatibility for Django 1.11.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:21>
* status: new => closed
* resolution: => fixed
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:22>
Comment (by Tim Graham <timograham@…>):
In [changeset:"72be3152d77cd87c90f70a0c365ae7752804a86c" 72be3152]:
{{{
#!CommitTicketReference repository=""
revision="72be3152d77cd87c90f70a0c365ae7752804a86c"
Refs #27025 -- Added Python 3.6 to tox.ini.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:23>
Comment (by Tim Graham <timograham@…>):
In [changeset:"d4d79d0f200357b28419203557cc61c8168316ab" d4d79d0f]:
{{{
#!CommitTicketReference repository=""
revision="d4d79d0f200357b28419203557cc61c8168316ab"
Refs #27025 -- Fixed "invalid escape sequence" warning in auth_tests on
Python 3.6.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:24>
Comment (by Tim Graham <timograham@…>):
In [changeset:"e34cce79ff667876bf55ea41395f15f0d2534a40" e34cce79]:
{{{
#!CommitTicketReference repository=""
revision="e34cce79ff667876bf55ea41395f15f0d2534a40"
[1.11.x] Refs #27025 -- Fixed "invalid escape sequence" warning in
auth_tests on Python 3.6.
Backport of d4d79d0f200357b28419203557cc61c8168316ab from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:25>
Comment (by Tim Graham <timograham@…>):
In [changeset:"f0ffa3f4ea277f9814285085fde20baff60fc386" f0ffa3f4]:
{{{
#!CommitTicketReference repository=""
revision="f0ffa3f4ea277f9814285085fde20baff60fc386"
Refs #27025, #28593 -- Fixed "invalid escape sequence" warnings in
urls/resolvers.py.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:26>
Comment (by Tim Graham <timograham@…>):
In [changeset:"5091bb6a07caf4afe5d43c83a045c3f04a441dc3" 5091bb6]:
{{{
#!CommitTicketReference repository=""
revision="5091bb6a07caf4afe5d43c83a045c3f04a441dc3"
[2.0.x] Refs #27025, #28593 -- Fixed "invalid escape sequence" warnings in
urls/resolvers.py.
Backport of f0ffa3f4ea277f9814285085fde20baff60fc386 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:27>
Comment (by Jeroen Pulles):
Would it be possible to backport dd99e69fa8f89263d0396f23e0db9aa8fa667b01
(metaclass magic) to Django 1.8?
I'm seeing quite a few warnings for this, hiding the more useful
warnings...
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:28>
Comment (by Tim Graham):
No, Django 1.8 doesn't have official support for Python 3.6 and only
receives data loss and security fixes its end-of-life in April 2018.
Perhaps you can use `warnings.filterwarnings()` to hide the warnings.
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:29>
Comment (by Jeroen Pulles):
Okay. For the record: Adding this snippet to my development settings in my
otherwise meta-class-free project, works for me:
{{{
import warnings
warnings.filterwarnings(
action="ignore",
message=".*Was __classcell__ propagated to type[.]__new__.*")
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:30>
Comment (by GitHub <noreply@…>):
In [changeset:"717ee63e5615a6c3a018351a07028513f9b01f0b" 717ee63e]:
{{{
#!CommitTicketReference repository=""
revision="717ee63e5615a6c3a018351a07028513f9b01f0b"
Refs #27025 -- Removed obsolete sqlite3 transaction management workaround
for Python 3.6+.
Obsolete per https://bugs.python.org/issue10740#msg274816.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27025#comment:31>