#27308: BytesWarning exception raised when running with python 3 -bb option
-------------------------------------+-------------------------------------
     Reporter:  Gustavo J. A. M.     |                    Owner:  nobody
  Carneiro                           |
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Core (Other)         |                  Version:  1.10
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Claude Paroz):

 In the reported issue, I think the warning and the problem come from that
 line in the user's project where the template name is unexpectedly
 converted to bytes:
 `loader.get_template((name + '.html').encode("ascii"))`.

 I see we are giving some bytestrings to some debug view tests in the
 Django test suite. It's probably fine to test that as long as we are
 supporting Python 2, but after dropping that support, we could simply
 assume exception messages are strings, not bytes. Unless Django is itself
 creating exception with bytes content on Python 3, which would be
 something to fix, I don't think we should do anything more now on Django's
 side.

--
Ticket URL: <https://code.djangoproject.com/ticket/27308#comment:4>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.640e80e2d1c1c521f4e9baad5b5c7d22%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to