Code

Opened 6 months ago

Closed 6 months 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.

Attachments (0)

Change History (6)

comment:1 Changed 6 months ago by claudep

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Severity changed from Normal to Release blocker
  • Triage Stage changed from Unreviewed to Accepted

comment:2 follow-up: Changed 6 months ago by 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.

comment:3 in reply to: ↑ 2 Changed 6 months ago by bmispelon

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 6 months ago by claudep

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 6 months ago by github@…

  • Cc github@… added

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

  • Resolution set to fixed
  • Status changed from new to closed

In 848a7594748c0124a208425dbf0fd2cc861995c3:

Fixed #21362 -- Restored Python 2.5 compatibility.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.