← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1345642] [NEW] use force_text instead of force_unicode

 

Public bug reported:

Horizon's code base uses force_unicode()[0] function to ensure the an
object is correctly transformed to unicode text, this function is part
of Django. This function is deprecated.

Since Django 1.5 there are new functions to string handling[1] and
force_unicode() since then is an alias of force_text(), but only
available when Django is running in a Python 2.x interpreter, Django
doesn't provide the alias when is running on Python 3.x[2]

Horizon should start using force_text() to be able to run on Python 3

[0] https://docs.djangoproject.com/en/1.4/ref/unicode/#conversion-functions
[1] https://docs.djangoproject.com/en/1.5/topics/python3/#string-handling
[2] https://github.com/django/django/blob/1.5/django/utils/encoding.py#L171

** Affects: horizon
     Importance: Undecided
     Assignee: Felipe Reyes (freyes)
         Status: In Progress

** Changed in: horizon
     Assignee: (unassigned) => Felipe Reyes (freyes)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1345642

Title:
  use force_text instead of force_unicode

Status in OpenStack Dashboard (Horizon):
  In Progress

Bug description:
  Horizon's code base uses force_unicode()[0] function to ensure the an
  object is correctly transformed to unicode text, this function is part
  of Django. This function is deprecated.

  Since Django 1.5 there are new functions to string handling[1] and
  force_unicode() since then is an alias of force_text(), but only
  available when Django is running in a Python 2.x interpreter, Django
  doesn't provide the alias when is running on Python 3.x[2]

  Horizon should start using force_text() to be able to run on Python 3

  [0] https://docs.djangoproject.com/en/1.4/ref/unicode/#conversion-functions
  [1] https://docs.djangoproject.com/en/1.5/topics/python3/#string-handling
  [2] https://github.com/django/django/blob/1.5/django/utils/encoding.py#L171

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1345642/+subscriptions


Follow ups

References