Opened 10 years ago

Closed 6 years ago

Last modified 20 months ago

#23919 closed Cleanup/optimization (fixed)

Cleanups for when we drop Python 2 compatibility

Reported by: Tim Graham Owned by: nobody
Component: Core (Other) Version:
Severity: Normal Keywords:
Cc: cmawebsite@…, Tom Forbes Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Collin Anderson)

This is a tracking ticket of things that we can remove when we drop Python 2 compatibility in Django 2.0. Please edit the description of the ticket as you come across new items.

  • django.core.mail.message.make_msgid() #23905
  • django.dispatch.weakref_backports
  • django.http.cookie workarounds (remains for Python 3.4)
  • django.utils.2to3_fixes
  • django.utils.decorators.ContextDecorator
  • django.utils.encoding
    • @python_2_unicode_compatible
    • force/smart _unicode
    • either force/smart _text or force/smart _str PR
  • django.utils.html_parser.use_workaround
  • django.utils.http functions like urlquote_plus -- I think the versions of these functions on Python 3 don't have the unicode characters bug we are working around PR
  • Stop using django.utils.lru_cache
  • Figure the deprecation plan for django.utils.lru_cache (staying for now)
  • django.utils.six
  • from __future__ import unicode_literals
  • str() stuff for environment variables, e.g. 0bfb53866199f366ed140d49938fd185e5898156
  • str() stuff for type(name) and __name__
  • Inheriting from object in django.core.servers.basehttp (and perhaps other places) ala 4ee06ec3fc8e94d164afbd2f9c880c60c658a9ac
  • git grep 'long int' (mostly docs)
  • django.utils._os [npath,upath]
  • In tests: contextlib.closing(self.urlopen (contextlib.closing no longer needed)
  • Support for pysqlite (doesn't support Python 3)
  • Replace super(ClassName, self) with super() PR
  • Remove # -*- coding: utf-8 -*- source file encoding (that's the default on Python 3)
  • Evaluate replacement of custom __del__ methods by weakref.finalize
  • Remove __ne__ from objects already defining a __eq__
  • Remove note about PYTHONHASHSEED (see #26243)
  • Remove Field.creation_counter (replace by metaclass __prepare__ returning OrderedDict(), https://docs.python.org/3/reference/datamodel.html#preparing-the-class-namespace) (see comment:95)
  • django.test.utils.reset_warning_registry()
  • Replace errno checks by IOError subclasses defined by PEP 3151 PR
  • django.utils.glob
  • django.utils.cookies.SimpleCookie (remains for Python 3.4 compatibility)
  • django.test.mock
  • Replace tempfile.mkdtemp + remove with tempfile.TemporaryDirectory context manager
  • Replace io.open() by a plain open()
  • Evaluate need for assertRegex, assertRaisesRegex in tests. Some usage is merely to account for differences in messages between Python 2 and 3.
  • re.U, re.UNICODE (default behavior of Python 3) - PR 7879

Change History (148)

comment:1 by Wojtek Ruszczewski, 10 years ago

Various nonlocal workarounds (example).

comment:2 by Collin Anderson, 9 years ago

Description: modified (diff)

comment:3 by Tim Graham, 9 years ago

Description: modified (diff)

comment:4 by Anssi Kääriäinen, 9 years ago

I believe we can get rid of the Field.creation_counter hack. In Python 3 it is possible to store the attrs in a sorted dictionary. See http://stackoverflow.com/questions/4459531/how-to-read-class-attributes-in-the-same-order-as-declared.

comment:5 by Collin Anderson, 9 years ago

Description: modified (diff)

comment:6 by Tim Graham, 9 years ago

Description: modified (diff)

comment:7 by Tim Graham, 9 years ago

Description: modified (diff)

comment:8 by Collin Anderson, 9 years ago

Cc: cmawebsite@… added
Description: modified (diff)

comment:9 by Collin Anderson, 9 years ago

Description: modified (diff)

comment:10 by Curtis Maloney, 9 years ago

In far too many tests we rely on the fact six aliases builtins [like input] instead of using mock.

I submitted a patch recently to clean up a couple of these I found, but I am finding more.

comment:11 by Curtis Maloney, 9 years ago

Description: modified (diff)

comment:12 by Tim Graham, 9 years ago

Description: modified (diff)

comment:13 by Tim Graham, 9 years ago

Description: modified (diff)

comment:14 by Moritz Sichert, 9 years ago

Description: modified (diff)

comment:15 by Tim Graham, 9 years ago

Description: modified (diff)

comment:16 by Claude Paroz, 9 years ago

Description: modified (diff)

comment:17 by Simon Charette, 9 years ago

Description: modified (diff)

comment:18 by Collin Anderson, 8 years ago

Description: modified (diff)

comment:19 by Anssi Kääriäinen, 8 years ago

Description: modified (diff)

comment:20 by Tim Graham, 8 years ago

Description: modified (diff)

comment:21 by Jon Dufresne, 8 years ago

Description: modified (diff)

comment:22 by Curtis Maloney, 8 years ago

Description: modified (diff)

comment:23 by Curtis Maloney, 8 years ago

Description: modified (diff)

comment:24 by Jon Dufresne, 8 years ago

Description: modified (diff)

comment:25 by Claude Paroz, 8 years ago

Description: modified (diff)

comment:26 by Tim Graham, 8 years ago

Description: modified (diff)

comment:27 by Tim Graham, 7 years ago

Description: modified (diff)

comment:28 by Claude Paroz, 7 years ago

Note that I have a local branch which does some boring removals (unicode_literals, utf-8 preambles, some six usage). So ping me as soon as the Django 2.0 deprecated stuff is removed and I'll offer a patch for that.

comment:29 by Asif Saifuddin Auvi, 7 years ago

I am also working to remove python2 workarounds by following a module by module approach.

comment:30 by Aymeric Augustin, 7 years ago

If Claude has already prepared these changes, perhaps you should wait for his patch instead of duplicating his work?

in reply to:  30 comment:31 by Asif Saifuddin Auvi, 7 years ago

Replying to Aymeric Augustin:

If Claude has already prepared these changes, perhaps you should wait for his patch instead of duplicating his work?

Yes I talked with Claude on IRC to pause before his work is merged.

in reply to:  4 comment:32 by Josh Smeaton, 7 years ago

Replying to Anssi Kääriäinen:

I believe we can get rid of the Field.creation_counter hack. In Python 3 it is possible to store the attrs in a sorted dictionary. See http://stackoverflow.com/questions/4459531/how-to-read-class-attributes-in-the-same-order-as-declared.

We could also remove this when we support python 3.6, as class attributes retain their order. I'm guessing this is a consequence (or the cause of) dictionaries retaining insertion order. https://docs.python.org/3.6/whatsnew/3.6.html#pep-520-preserving-class-attribute-definition-order

comment:33 by Claude Paroz <claude@…>, 7 years ago

In d7b9aaa:

Refs #23919 -- Removed encoding preambles and future imports

comment:34 by Claude Paroz <claude@…>, 7 years ago

In f3c43ad:

Refs #23919 -- Removed python_2_unicode_compatible decorator usage

comment:35 by Tim Graham, 7 years ago

Triage Stage: Someday/MaybeAccepted

PR for removing Python 2 references from docs.

comment:36 by Claude Paroz <claude@…>, 7 years ago

In c716fe87:

Refs #23919 -- Removed six.PY2/PY3 usage

Thanks Tim Graham for the review.

comment:37 by GitHub <noreply@…>, 7 years ago

In f6acd1d:

Refs #23919 -- Removed Python 2 notes in docs.

comment:38 by Claude Paroz <claude@…>, 7 years ago

In 7b2f2e74:

Refs #23919 -- Removed six.<various>_types usage

Thanks Tim Graham and Simon Charette for the reviews.

comment:39 by Claude Paroz <claude@…>, 7 years ago

In 2b281cc3:

Refs #23919 -- Removed most of remaining six usage

Thanks Tim Graham for the review.

comment:40 by Aymeric Augustin, 7 years ago

Description: modified (diff)

comment:41 by Claude Paroz, 7 years ago

Description: modified (diff)

comment:42 by Mariusz Felisiak, 7 years ago

Description: modified (diff)

comment:43 by Tim Graham <timograham@…>, 7 years ago

In 3cc5f01d:

Refs #23919 -- Stopped using django.utils.lru_cache().

comment:44 by Tim Graham <timograham@…>, 7 years ago

In eb422e47:

Refs #23919 -- Removed obsolete ne() methods.

ne() defaults to the opposite of eq() on Python 3
when it doesn't return NotImplemented.

comment:45 by Tim Graham <timograham@…>, 7 years ago

In a5563963:

Refs #23919 -- Replaced io.open() with open().

io.open() is an alias for open() on Python 3.

comment:46 by Simon Charette, 7 years ago

Description: modified (diff)

comment:47 by Simon Charette, 7 years ago

Description: modified (diff)

comment:48 by Claude Paroz <claude@…>, 7 years ago

In cecc079:

Refs #23919 -- Stopped inheriting from object to define new style classes.

comment:49 by ChillarAnand, 7 years ago

Description: modified (diff)

comment:50 by GitHub <noreply@…>, 7 years ago

In 5320fa7:

Refs #23919 -- Removed obsolete contextlib.closing() calls (for Python 2).

comment:51 by GitHub <noreply@…>, 7 years ago

In e5c67f0:

Refs #23919 -- Removed reset_warning_registry() workaround for Python < 3.4.2.

comment:52 by Simon Charette <charette.s@…>, 7 years ago

In 4c5ed3e6:

Refs #23919 -- Removed nonzero() methods (for Python 2).

Thanks Tim for the review.

comment:53 by Tim Graham <timograham@…>, 7 years ago

In 41e0033c:

Refs #23919 -- Removed usage of django.utils.decorators.ContextDecorator.

comment:54 by Simon Charette <charette.s@…>, 7 years ago

In 9695b14:

Refs #23919 -- Removed str() conversion of type and method name.

comment:55 by Simon Charette, 7 years ago

Description: modified (diff)

comment:56 by GitHub <noreply@…>, 7 years ago

In d4bb3759:

Refs #23919 -- Removed obsolete compare_digest() and pbkdf2() implementations.

comment:57 by GitHub <noreply@…>, 7 years ago

In 9e917cc2:

Fixed #23905, refs #23919 -- Used make_msgid() from stdlib.

comment:58 by GitHub <noreply@…>, 7 years ago

In 9d27478:

Refs #23919 -- Removed docs references to long integers.

comment:59 by Tim Graham <timograham@…>, 7 years ago

In 9ee47ce7:

Refs #23919 -- Removed enum ImportError handling for Python 2.

comment:60 by Tim Graham <timograham@…>, 7 years ago

In eb0b921c:

Refs #23919 -- Removed SessionBase.iterkeys(), itervalues(), iteritems().

These methods only work on Python 2.

comment:61 by Tim Graham <timograham@…>, 7 years ago

In fedda6d:

Refs #23919 -- Removed Python 2 version check in django.http.cookie.

comment:62 by Tim Graham <timograham@…>, 7 years ago

In bf1c9570:

Refs #23919 -- Removed Python 2 workaround for hashing Oracle params (refs #27632).

comment:63 by Tim Graham, 7 years ago

Description: modified (diff)

comment:64 by ChillarAnand, 7 years ago

Description: modified (diff)

comment:65 by Claude Paroz <claude@…>, 7 years ago

In dc8834ca:

Refs #23919 -- Removed unneeded force_str calls

comment:66 by Aymeric Augustin <aymeric.augustin@…>, 7 years ago

In 109b33f:

Refs #23919 -- Simplified assertRaisesRegex()'s that accounted for Python 2.

comment:67 by GitHub <noreply@…>, 7 years ago

In 4e729fea:

Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.

These functions do nothing on Python 3.

comment:68 by Claude Paroz <claude@…>, 7 years ago

In 042b735:

Refs #23919 -- Removed unneeded str() calls

comment:69 by Claude Paroz, 7 years ago

Description: modified (diff)

comment:70 by Tim Graham <timograham@…>, 7 years ago

In 7aba691:

Refs #23919 -- Removed django.test.mock Python 2 compatibility shim.

comment:71 by Claude Paroz <claude@…>, 7 years ago

In 289fc1bf:

Refs #23919 -- Removed str_prefix usage

comment:72 by Tim Graham <timograham@…>, 7 years ago

In 1b06d5e6:

Refs #23919 -- Removed pysqlite support (it's Python 2 only).

comment:73 by GitHub <noreply@…>, 7 years ago

In 9e6e32bf:

Refs #23919 -- Removed django.utils.decorators.available_attrs() usage.

It's only needed to workaround a bug on Python 2.

comment:74 by Tim Graham <timograham@…>, 7 years ago

In c222122:

Refs #23919 -- Removed re.U and re.UNICODE (default on Python 3).

comment:75 by Mariusz Felisiak, 7 years ago

Description: modified (diff)

comment:76 by GitHub <noreply@…>, 7 years ago

In d170c63:

Refs #23919 -- Removed misc references to Python 2.

comment:77 by ChillarAnand, 7 years ago

Description: modified (diff)

comment:78 by Claude Paroz <claude@…>, 7 years ago

In 6e55e1d:

Refs #23919 -- Replaced six.reraise by raise

comment:79 by Claude Paroz, 7 years ago

Description: modified (diff)

comment:80 by GitHub <noreply@…>, 7 years ago

In 435e4bf3:

Refs #23919 -- Removed traceback setting needed for Python 2.

Partially reverted refs #25761 and refs #16245.

comment:81 by Tim Graham <timograham@…>, 7 years ago

In 5b95d42:

Refs #23919 -- Removed a MySQLdb workaround (refs #6052) for Python 2.

comment:82 by GitHub <noreply@…>, 7 years ago

In 632c4ffd:

Refs #23919 -- Replaced errno checking with PEP 3151 exceptions.

comment:83 by GitHub <noreply@…>, 7 years ago

In 2d96c027:

Refs #23919 -- Removed obsolete MySQLdb references.

comment:84 by Tim Graham <timograham@…>, 7 years ago

In dc165ec8:

Refs #23919 -- Replaced super(ClassName, self) with super() in docs.

comment:85 by Tim Graham <timograham@…>, 7 years ago

In d6eaf7c:

Refs #23919 -- Replaced super(ClassName, self) with super().

comment:86 by GitHub <noreply@…>, 7 years ago

In 1c466994:

Refs #23919 -- Removed misc Python 2/3 references.

comment:87 by Aymeric Augustin, 7 years ago

Description: modified (diff)

comment:88 by Tim Graham <timograham@…>, 7 years ago

In d1bab24:

Refs #23919, #27778 -- Removed obsolete mentions of unicode.

comment:89 by Claude Paroz <claude@…>, 7 years ago

In fee42fd9:

Refs #23919 -- Replaced usage of django.utils.http utilities with Python equivalents

Thanks Tim Graham for the review.

comment:90 by Tim Graham <timograham@…>, 7 years ago

In 6478e07:

Refs #23919 -- Replaced tempfile.mkdtemp() with TemporaryDirectory() context manager.

comment:91 by Claude Paroz, 7 years ago

Description: modified (diff)

comment:92 by ChillarAnand, 7 years ago

Description: modified (diff)

comment:93 by GitHub <noreply@…>, 7 years ago

In e07e743e:

Refs #23919 -- Used DeclarativeFieldsMetaclass.prepare() for tracking form field order.

comment:94 by GitHub <noreply@…>, 7 years ago

In 9e9e7373:

Refs #23919 -- Removed an obsolete test for a Python 2 code path (refs #15662).

Fixed #21628 by removing the last usage of the imp module.

comment:95 by Josh Smeaton, 7 years ago

I had an attempt at dropping the creation_counter for model fields, but I *think* it might be more costly than the current method, considering so many things rely on the order being consistent. My attempt was here, with associated discussion I'll copy some of below: https://github.com/django/django/pull/7983

I'm not sure this is worth continuing with, at least not in the same way. Too many systems rely on the fields being ordered, which isn't going to be possible without maintaining another list of fields such as definition_order = []. This can be done for local fields, but then proxy/parent fields will need to be returned in the same definition order. This might be something like:

parent_fields + [field for field in self.definition_order if field in local_fields]

Then we'd need to account for private and hidden fields. But what's the point? We'd now be storing a separate list of all field references for each model, rather than a counter (int) on each field, and reordering fields in _get_fields() whether or not they need to be ordered. Of course I'd be happy to see a better solution that worked, I'm just giving up on this particular method for the moment.

comment:96 by Tim Graham, 7 years ago

Description: modified (diff)

I also looked briefly at models field and manager usage of creation_counter but it wasn't obvious if the __prepare__() approach was feasible or if it would be simpler. I think we can defer that task for now.

comment:97 by Claude Paroz <claude@…>, 7 years ago

In c688336e:

Refs #23919 -- Assumed request COOKIES and META are str

comment:98 by Claude Paroz <claude@…>, 7 years ago

In 52138b1f:

Refs #23919 -- Removed usage of obsolete SafeBytes class

The class will be removed as part of #27753.
Thanks Tim Graham for the review.

comment:99 by Tim Graham <timograham@…>, 7 years ago

In 84126f27:

Refs #23919 -- Removed unneeded code in force_text().

Unneeded since 7b2f2e74adb36a4334e83130f6abc2f79d395235.

comment:100 by Tim Graham <timograham@…>, 7 years ago

In 8838d4d:

Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments.

comment:101 by Collin Anderson, 7 years ago

Description: modified (diff)

Can we remove empty init.py (and init.py-tpl) files?

comment:102 by Aymeric Augustin, 7 years ago

IIRC there's a risk to making everything a namespace package: it means that if you have conflicting package / module names, they're somehow merged instead of having the first one shadow the other. (Perhaps someone more familiar with the topic can describe this more precisely.) I think it's safer to keep the __init__ files.

Last edited 6 years ago by Tim Graham (previous) (diff)

comment:103 by Nick Pope, 7 years ago

Given that Django 2.0 is targeting Python 3.5+, are there other things that could be cleaned up that were added to support <3.5 or could be used now that 3.5 is the minimum version?

For example, there are many places with the following pattern:

try:
    ...
except ...:
    pass

These could be replaced with contextlib.suppress() which is available since 3.4.

Other potentially interesting things are:

There may be more - this was just a quick look at the What's New pages for 3.4 and 3.5.

comment:104 by Tim Graham, 7 years ago

Usage of Python 3 features could be proposed in new tickets (e.g. #27804). Master is still supporting Python 3.4 right now as per django-developers discussion.

comment:105 by GitHub <noreply@…>, 7 years ago

In 2d899ce:

Refs #23919 -- Removed a Python 2 code path in force_text().

Reverted the obsolete fix and tests for refs #12302.

comment:106 by GitHub <noreply@…>, 7 years ago

In 21f13ff5:

Refs #23919 -- Removed an used block in ExceptionReporter.get_traceback_data().

The test from refs #20368 only runs this block on Python 2.

comment:107 by Tim Graham <timograham@…>, 7 years ago

In 500532c9:

Refs #23919 -- Removed default 'utf-8' argument for str.encode()/decode().

comment:108 by Collin Anderson, 7 years ago

Description: modified (diff)

Should we deprecate cache.has_key() ?.... Nevermind, it takes the "version" argument....

Last edited 7 years ago by Collin Anderson (previous) (diff)

comment:109 by Collin Anderson, 7 years ago

Description: modified (diff)

comment:110 by Collin Anderson, 7 years ago

The "Python 3 is recommended" text here could probably be rephrased:

https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-should-i-use-with-django

comment:111 by Tim Graham <timograham@…>, 7 years ago

In 4cffa9a1:

Fixed #27878, refs #23919 -- Used python3 shebangs.

comment:112 by Tim Graham <timograham@…>, 7 years ago

In 3dcc351:

Refs #23919 -- Used yield from.

comment:113 by Tim Graham <timograham@…>, 7 years ago

In 784a53b:

Reverted "Fixed #27878, refs #23919 -- Used python3 shebangs."

This reverts commit 4cffa9a1ffb37d4de7e99a851a9ed87b3c02d229.

comment:114 by Tim Graham <timograham@…>, 7 years ago

In ed0cbc8:

Refs #23919 -- Removed some Python 2 compatibility code and comments.

comment:115 by GitHub <noreply@…>, 7 years ago

In 84dcd162:

Refs #23919 -- Used "raise from" instead of cause in reraising backend-specific database exceptions.

Thanks Tim Graham for the review.

comment:116 by Tim Graham <timograham@…>, 7 years ago

In 9b538ba:

Refs #23919 -- Removed File's Python 2 proxied methods.

comment:117 by Claude Paroz <claude@…>, 7 years ago

In 59f8118c:

Refs #23919 -- Removed force_text() in Python deserializer needed only on Python 2

comment:118 by Tim Graham <timograham@…>, 7 years ago

In 3eb3907b:

Refs #23919 -- Replaced stray super(ClassName, self) with super().

comment:119 by GitHub <noreply@…>, 7 years ago

In 3d0a0ecd:

Refs #23919 -- Removed support for broken Model.str() in Model.repr().

Returning invalid bytestrings in str() is unlikely in Python 3.

comment:120 by Tim Graham <timograham@…>, 7 years ago

In 081e787:

Refs #23919 -- Stopped inheriting from object to define new style classes.

Tests and docs complement to cecc079168e8669138728d31611ff3a1e7eb3a9f.

comment:121 by Tim Graham <timograham@…>, 7 years ago

In 4af88cc:

Refs #23919 -- Removed Python 2 reference in django_bash_completion.

comment:122 by Sergey Fedoseev <fedoseev.sergey@…>, 7 years ago

In 59a4b12a:

Refs #23919 -- Removed LazyObject.getstate() needed only on Python 2.

comment:123 by Tom Forbes, 7 years ago

I was looking at potential cleanups I could help with and noticed a lot of os.path functions that could be replaced with pathlib - we have 219 occurrences of os.path (excluding usages in tests).

Is this something worth spending time on? It's pretty easy to convert, and it makes path related code a lot more readable IMO (no need for nested, multiple os.path.* calls in a single line for example). In 3.5 and above there is also a read_text method on paths which is quite useful in some cases.

comment:124 by Tim Graham, 7 years ago

Sure, start small and we can see if the changes look like an improvement.

comment:125 by Tim Graham <timograham@…>, 7 years ago

In 462f158:

Refs #23919 -- Updated contrib.admin's compress.py to use pathlib.

comment:126 by Tom Forbes, 7 years ago

Cc: Tom Forbes added

comment:127 by Tim Graham <timograham@…>, 7 years ago

In 5b1c3896:

Refs #23919 -- Replaced usage of django.utils.functional.curry() with functools.partial()/partialmethod().

comment:128 by Tim Graham <timograham@…>, 7 years ago

In d896809a:

Refs #23919 -- Removed unneeded float()/int() calls.

comment:129 by Tim Graham <timograham@…>, 7 years ago

In e3a30f2d:

Refs #23919 -- Corrected django.utils.http.urlencode()'s documented signature.

Follow up to fee42fd99ee470528858c2ccb3621135c30ec262.

comment:130 by Tim Graham <timograham@…>, 7 years ago

In 3eb447d8:

[2.0.x] Refs #23919 -- Corrected django.utils.http.urlencode()'s documented signature.

Follow up to fee42fd99ee470528858c2ccb3621135c30ec262.

Backport of e3a30f2d16d65e7f0b870e997e92425a2f795587 from master

comment:131 by Tim Graham <timograham@…>, 7 years ago

In 23e551c:

Refs #23919 -- Updated references to urllib.quote() to Python 3 location.

comment:132 by Tim Graham <timograham@…>, 7 years ago

In 542e6b02:

[2.0.x] Refs #23919 -- Updated references to urllib.quote() to Python 3 location.

Backport of 23e551ce6c7956e4c143357643dab2e89d30bfe0 from master

comment:133 by GitHub <noreply@…>, 7 years ago

In 7945bc1d:

Refs #23919 -- Replaced doc references to django.utils.http.urlquote() and urlquote_plus() with standard library alternatives.

Follow up to fee42fd99ee470528858c2ccb3621135c30ec262.

comment:134 by Tim Graham <timograham@…>, 7 years ago

In f1efedf0:

[2.0.x] Refs #23919 -- Replaced doc references to django.utils.http.urlquote() and urlquote_plus() with standard library alternatives.

Follow up to fee42fd99ee470528858c2ccb3621135c30ec262.

Backport of 7945bc1d08f7c8fd8f25eed0327e71dca81975e4 from master

comment:135 by Tim Graham <timograham@…>, 7 years ago

In c68f66e0:

Refs #23919 -- Replaced super() calls for old-style classes.

comment:136 by Tim Graham, 6 years ago

Resolution: fixed
Status: newclosed

comment:137 by Tim Graham <timograham@…>, 6 years ago

In ccc25bfe:

Refs #23919 -- Removed obsolete init.py files in management command directories.

comment:138 by GitHub <noreply@…>, 6 years ago

In c76d8742:

Refs #23919 -- Removed obsolete comments about u prefixes.

comment:139 by Tim Graham <timograham@…>, 6 years ago

In 45808895:

Refs #23919 -- Removed obsolete u-prefix stripping in inspectdb.

comment:140 by Tim Graham <timograham@…>, 6 years ago

In 1c0bf95f:

Refs #23919 -- Removed a stray object-inheritance.

Follow up to 081e78716085ff4af08604af5d084c8fd27c0730.

comment:141 by Tim Graham <timograham@…>, 5 years ago

In ce7293b:

Refs #23919 -- Replaced codecs.open() with open().

On Python 3, open() handles encodings.

comment:142 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In d0861fcb:

Refs #23919 -- Replaced super(ASGIHandler, self) with super().

comment:143 by Carlton Gibson <carlton.gibson@…>, 5 years ago

In 86a0231e:

Refs #23919 -- Replaced super(...) with super() in metaclasses.

comment:144 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In b7d05b2e:

Refs #23919 -- Used yield from in inspectdb.

comment:145 by Claude Paroz <claude@…>, 4 years ago

In 6686238c:

Refs #23919 -- Removed obsolete comment in signing.py

comment:146 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

In 578b3046:

Reverted "Refs #23919 -- Removed obsolete init.py files in management command directories."

This reverts commit ccc25bfe4f0964a00df3af6f91c2d9e20159a0c2.

https://groups.google.com/d/topic/django-developers/GVHMH2ciAnk/discussion

comment:147 by GitHub <noreply@…>, 3 years ago

In 712fe12:

Refs #23919 -- Removed unneeded AttributeError catching in collectstatic's link_file().

os.symlink() exists always on Python 3.2+.

comment:148 by GitHub <noreply@…>, 20 months ago

In 7c884afe:

Refs #23919 -- Updated obsolete buffer() references to memoryview().

Obsolete since 8cdc84726e13da4c796db614765658835d4786a1.

Note: See TracTickets for help on using tickets.
Back to Top