Opened 10 years ago

Closed 10 years ago

#23373 closed Bug (wontfix)

Django 1.5.*: django.contrib.markup.tests.Templates.test_textile() fails with Python 3

Reported by: Arfrever Owned by: nobody
Component: Uncategorized Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

django.contrib.markup.tests.Templates.test_textile() fails with Python 3.
textile needs to be installed for Python 3 to reproduce this error. Otherwise this test is skipped.
textile.textile() requires str with Python 3, not bytes, but Django passes bytes.
(textile.textile() accepts both str and unicode with Python 2.)

======================================================================
ERROR: test_textile (django.contrib.markup.tests.Templates)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/Django-1.5.9/django/contrib/markup/tests.py", line 52, in test_textile
    rendered = t.render(Context({'textile_content':self.textile_content})).strip()
  File "/tmp/Django-1.5.9/django/template/base.py", line 140, in render
    return self._render(context)
  File "/tmp/Django-1.5.9/django/test/utils.py", line 66, in instrumented_test_render
    return self.nodelist.render(context)
  File "/tmp/Django-1.5.9/django/template/base.py", line 830, in render
    bit = self.render_node(node, context)
  File "/tmp/Django-1.5.9/django/template/base.py", line 844, in render_node
    return node.render(context)
  File "/tmp/Django-1.5.9/django/template/base.py", line 881, in render
    output = self.filter_expression.resolve(context)
  File "/tmp/Django-1.5.9/django/template/base.py", line 606, in resolve
    new_obj = func(obj, *arg_vals)
  File "/tmp/Django-1.5.9/django/contrib/markup/templatetags/markup.py", line 30, in textile
    return mark_safe(force_text(textile.textile(force_bytes(value), encoding='utf-8', output='utf-8')))
  File "/usr/lib64/python3.3/site-packages/textile/functions.py", line 1683, in textile
    html_type=html_type)
  File "/usr/lib64/python3.3/site-packages/textile/functions.py", line 239, in textile
    False) and version_info < (3,)
  File "/usr/lib64/python3.3/site-packages/textile/functions.py", line 238, in <genexpr>
    self.text_has_unicode = next((True for c in text if ord(c) > 128),
TypeError: ord() expected string of length 1, but int found

----------------------------------------------------------------------

Change History (1)

comment:1 by Tim Graham, 10 years ago

Resolution: wontfix
Status: newclosed

Sorry, we're not going to fix this as Django 1.5 is currently receiving only security updates and will be unsupported when 1.7 is released shortly.

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