#29179: format_html() can falsely interpret a strack trace as a str.format
replacement field
-------------------------------------+-------------------------------------
     Reporter:  Stephan Michaud      |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Utilities            |                  Version:  1.10
     Severity:  Normal               |               Resolution:
     Keywords:  format_html, string  |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Stephan Michaud):

 Replying to [comment:2 Tim Graham]:
 > Could you give a minimal example that reproduces the issue (i.e. give
 the minimal string from the traceback and the arguments for
 `format_html()`)?

 Sure! Here's the string passed in to `format_html()`:
 {{{#!python
 <div class="ui-state-default ui-corner-all show_node"
 style="cursor:pointer;padding:4px;min-width:50px">show</div><div
 class="hidden_menu">Traceback (most recent call last):
 File "/home/tool/www/project/common/utils.py", line 52, in inner
 ret = func(*args, **kwargs)
 File
 "/home/tool/www/project/servers/management/commands/servers_getindexation.py",
 line 31, in handle
 server.fetch_content()
 File "/home/tool/www/project/common/abstract_models.py", line 289, in
 fetch_content
 get=params[1],
 File "/home/tool/www/project/proxies/models.py", line 99, in
 append_process
 process.get_proxy_response()
 File "/home/tool/www/project/proxies/models.py", line 254, in
 get_proxy_response
 data = urllib.parse.urlencode({'request': self.get_serialized_data()})
 File "/home/tool/www/project/proxies/models.py", line 216, in
 get_serialized_data
 'useragent': self.request_useragent,
 File "/home/tool/venv/lib/python3.5/base64.py", line 59, in b64encode
 encoded = binascii.b2a_base64(s)[:-1]
 TypeError: a bytes-like object is required, not 'str'
 </div>
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29179#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.41f9605f68533fff786bf62bcae55e78%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to