Opened 11 years ago

Closed 11 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 by Claude Paroz, 11 years ago

Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

comment:2 by Claude Paroz, 11 years ago

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.

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

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 by Claude Paroz, 11 years ago

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

comment:5 by github@…, 11 years ago

Cc: github@… added

comment:6 by Florian Apolloner <florian@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 848a7594748c0124a208425dbf0fd2cc861995c3:

Fixed #21362 -- Restored Python 2.5 compatibility.

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