Kaydet (Commit) 13532eb9 authored tarafından Jannis Leidel's avatar Jannis Leidel

Fixed #12892 - Fixed unicode related bug in a utility function of the admindocs…

Fixed #12892 - Fixed unicode related bug in a utility function of the admindocs app that prevented it to be used in non-English environments together with certain versions of docutils.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13192 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst e3a3175d
...@@ -5,6 +5,7 @@ from email.Parser import HeaderParser ...@@ -5,6 +5,7 @@ from email.Parser import HeaderParser
from email.Errors import HeaderParseError from email.Errors import HeaderParseError
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.utils.encoding import smart_str
try: try:
import docutils.core import docutils.core
import docutils.nodes import docutils.nodes
...@@ -64,7 +65,7 @@ def parse_rst(text, default_reference_context, thing_being_parsed=None): ...@@ -64,7 +65,7 @@ def parse_rst(text, default_reference_context, thing_being_parsed=None):
"link_base" : reverse('django-admindocs-docroot').rstrip('/') "link_base" : reverse('django-admindocs-docroot').rstrip('/')
} }
if thing_being_parsed: if thing_being_parsed:
thing_being_parsed = "<%s>" % thing_being_parsed thing_being_parsed = smart_str("<%s>" % thing_being_parsed)
parts = docutils.core.publish_parts(text, source_path=thing_being_parsed, parts = docutils.core.publish_parts(text, source_path=thing_being_parsed,
destination_path=None, writer_name='html', destination_path=None, writer_name='html',
settings_overrides=overrides) settings_overrides=overrides)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment