Module string has no more attribute letters in python 3

Bug #1360861 reported by François Magimel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Low
François Magimel

Bug Description

According to the Python doc (https://docs.python.org/3.0/whatsnew/3.0.html), string.letters is not anymore in Python 3 due to its locale-specific behavior. Instead, it is recommended to use string.ascii_letters.
This method is used only in the generate_key function (in horizon/utils/secret_key.py) to generate a random key for the settings.py file.

Changed in horizon:
assignee: nobody → François Magimel (linkid)
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Hopefully it is nice to have Hacking rule to detect Python3 compat. It helps us to do the similar thing manually in the future.

Changed in horizon:
status: New → Confirmed
importance: Undecided → Low
tags: added: horizon-core python3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/116516

Changed in horizon:
status: Confirmed → In Progress
David Lyle (david-lyle)
Changed in horizon:
milestone: none → juno-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/116516
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=84d8e08080ea7f81356a4bee1e90e39b86e133d3
Submitter: Jenkins
Branch: master

commit 84d8e08080ea7f81356a4bee1e90e39b86e133d3
Author: François Magimel <email address hidden>
Date: Sun Aug 24 20:22:55 2014 +0200

    Use string.ascii_letters to be python 3 compatible

    Use string.ascii_letters instead of string.letter. The only consequence
    is to loose the locale-specific behavior but it seems not to be a bad
    thing for generating a secret key.

    Change-Id: Id985d798042eaa7541692d137027233537ed3bb4
    Closes-Bug: #1360861

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: juno-rc1 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.