Opened 3 years ago

Closed 3 years ago

#21362 closed Bug (fixed)

Django 1.4.9 breaks Python 2.5 compatibility

Reported by: kahlfuss@… Owned by: nobody
Component: Python 2 Version: 1.4
Severity: Release blocker Keywords:
Cc: github@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

      File "/usr/local/lib/python2.5/site-packages/django/utils/crypto.py", line 137
        password += b'\x00' * (inner.block_size - len(password))
                          ^
    SyntaxError: invalid syntax

According to http://docs.python.org/2/whatsnew/2.6.html#pep-3112-byte-literals the b notation was introduced in Python 2.6.

Change History (6)

comment:1 Changed 3 years ago by Claude Paroz

Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

comment:2 Changed 3 years ago by Claude Paroz

I think the fix is as simple as removing the b prefix on 1.4, as Python 3 compatibility is not an issue on 1.4.

comment:3 in reply to:  2 Changed 3 years ago by Baptiste Mispelon

Replying to claudep:

I think the fix is as simple as removing the b prefix on 1.4, as Python 3 compatibility is not an issue on 1.4.

Yes, that should work. The question is, are there other instances of bytes literals anywhere else?

We should also fix our CI server to include python2.5 as part of the automated testing.

comment:4 Changed 3 years ago by Claude Paroz

Note also that hmac.trans36 does not exist on Python 2.5. I wonder if commit [1e4f53a6eb8d181] should not simply be reverted...

comment:5 Changed 3 years ago by github@…

Cc: github@… added

comment:6 Changed 3 years ago by Florian Apolloner <florian@…>

Resolution: fixed
Status: newclosed

In 848a7594748c0124a208425dbf0fd2cc861995c3:

Fixed #21362 -- Restored Python 2.5 compatibility.

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