[Django] #27308: BytesWarning exception raised when running with python 3 -bb option

28 views
Skip to first unread message

Django

unread,
Oct 3, 2016, 1:53:26 PM10/3/16
to django-...@googlegroups.com
#27308: BytesWarning exception raised when running with python 3 -bb option
-------------------------------------------+--------------------
Reporter: Gustavo J. A. M. Carneiro | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------------+--------------------
When your template file does not exist, naturally Django gives an
exception. But if TEMPLATE_DEBUG is True, it also tries to generate a
pretty html traceback, and this is where the bug is, if you try to run
with the python 3 -bb option, which complains when you try to do str() on
a bytes value.

I have Django version 1.10.1.

{{{
$ python3 -bb
Python 3.5.2 (default, Sep 10 2016, 08:21:44)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> str(b'')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
BytesWarning: str() on a bytes instance
>>> repr(b'')
"b''"
>>>
}}}

Traceback:

{{{
2016-10-03 17:47:29,582 ERROR production.py:138 GET /login ->
TemplateDoesNotExist(b'loginxxx.html',)
Traceback (most recent call last):
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args,
**callback_kwargs)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/utils/decorators.py", line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/gjc/projects/molly/mollybet/apps/home/views.py", line 124,
in login
new_molly_url=settings.NEW_MOLLY_URL)
File "/home/gjc/projects/molly/mollybet/webutils.py", line 167, in
render
t = loader.get_template((name + '.html').encode("ascii"))
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/template/loader.py", line 25, in get_template
raise TemplateDoesNotExist(template_name, chain=chain)
django.template.exceptions.TemplateDoesNotExist: <unprintable
TemplateDoesNotExist object>
Internal Server Error: /login
Traceback (most recent call last):
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args,
**callback_kwargs)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/utils/decorators.py", line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/gjc/projects/molly/mollybet/apps/home/views.py", line 124,
in login
new_molly_url=settings.NEW_MOLLY_URL)
File "/home/gjc/projects/molly/mollybet/webutils.py", line 167, in
render
t = loader.get_template((name + '.html').encode("ascii"))
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/template/loader.py", line 25, in get_template
raise TemplateDoesNotExist(template_name, chain=chain)
django.template.exceptions.TemplateDoesNotExist: <unprintable
TemplateDoesNotExist object>
2016-10-03 17:47:29,583 ERROR exception.py:124 Internal Server Error:
/login
Traceback (most recent call last):
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args,
**callback_kwargs)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/utils/decorators.py", line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/gjc/projects/molly/mollybet/apps/home/views.py", line 124,
in login
new_molly_url=settings.NEW_MOLLY_URL)
File "/home/gjc/projects/molly/mollybet/webutils.py", line 167, in
render
t = loader.get_template((name + '.html').encode("ascii"))
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/template/loader.py", line 25, in get_template
raise TemplateDoesNotExist(template_name, chain=chain)
django.template.exceptions.TemplateDoesNotExist: <unprintable
TemplateDoesNotExist object>
2016-10-03 17:47:29,599 ERROR production.py:138 GET /login ->
BytesWarning('str() on a bytes instance',)
Traceback (most recent call last):
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args,
**callback_kwargs)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/utils/decorators.py", line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/gjc/projects/molly/mollybet/apps/home/views.py", line 124,
in login
new_molly_url=settings.NEW_MOLLY_URL)
File "/home/gjc/projects/molly/mollybet/webutils.py", line 167, in
render
t = loader.get_template((name + '.html').encode("ascii"))
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/template/loader.py", line 25, in get_template
raise TemplateDoesNotExist(template_name, chain=chain)
django.template.exceptions.TemplateDoesNotExist: <unprintable
TemplateDoesNotExist object>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "/home/gjc/projects/molly/mollybet/apps/home/geoipblocking.py",
line 17, in middleware
return get_response(request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 41, in inner
response = response_for_exception(request, exc)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 86, in
response_for_exception
response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 128, in
handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/views/debug.py", line 84, in technical_500_response
html = reporter.get_traceback_html()
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/views/debug.py", line 316, in get_traceback_html
c = Context(self.get_traceback_data(), use_l10n=False)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/views/debug.py", line 308, in get_traceback_data
c['exception_value'] = smart_text(self.exc_value, errors='replace')
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/utils/encoding.py", line 41, in smart_text
return force_text(s, encoding, strings_only, errors)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/utils/encoding.py", line 76, in force_text
s = six.text_type(s)
BytesWarning: str() on a bytes instance
Internal Server Error: /login
Traceback (most recent call last):
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args,
**callback_kwargs)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/utils/decorators.py", line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/gjc/projects/molly/mollybet/apps/home/views.py", line 124,
in login
new_molly_url=settings.NEW_MOLLY_URL)
File "/home/gjc/projects/molly/mollybet/webutils.py", line 167, in
render
t = loader.get_template((name + '.html').encode("ascii"))
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/template/loader.py", line 25, in get_template
raise TemplateDoesNotExist(template_name, chain=chain)
django.template.exceptions.TemplateDoesNotExist: <unprintable
TemplateDoesNotExist object>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "/home/gjc/projects/molly/mollybet/apps/home/geoipblocking.py",
line 17, in middleware
return get_response(request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 41, in inner
response = response_for_exception(request, exc)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 86, in
response_for_exception
response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 128, in
handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/views/debug.py", line 84, in technical_500_response
html = reporter.get_traceback_html()
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/views/debug.py", line 316, in get_traceback_html
c = Context(self.get_traceback_data(), use_l10n=False)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/views/debug.py", line 308, in get_traceback_data
c['exception_value'] = smart_text(self.exc_value, errors='replace')
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/utils/encoding.py", line 41, in smart_text
return force_text(s, encoding, strings_only, errors)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/utils/encoding.py", line 76, in force_text
s = six.text_type(s)
BytesWarning: str() on a bytes instance
2016-10-03 17:47:29,601 ERROR exception.py:124 Internal Server Error:
/login
Traceback (most recent call last):
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args,
**callback_kwargs)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/utils/decorators.py", line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/gjc/projects/molly/mollybet/apps/home/views.py", line 124,
in login
new_molly_url=settings.NEW_MOLLY_URL)
File "/home/gjc/projects/molly/mollybet/webutils.py", line 167, in
render
t = loader.get_template((name + '.html').encode("ascii"))
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/template/loader.py", line 25, in get_template
raise TemplateDoesNotExist(template_name, chain=chain)
django.template.exceptions.TemplateDoesNotExist: <unprintable
TemplateDoesNotExist object>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "/home/gjc/projects/molly/mollybet/apps/home/geoipblocking.py",
line 17, in middleware
return get_response(request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 41, in inner
response = response_for_exception(request, exc)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 86, in
response_for_exception
response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 128, in
handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/views/debug.py", line 84, in technical_500_response
html = reporter.get_traceback_html()
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/views/debug.py", line 316, in get_traceback_html
c = Context(self.get_traceback_data(), use_l10n=False)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/views/debug.py", line 308, in get_traceback_data
c['exception_value'] = smart_text(self.exc_value, errors='replace')
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/utils/encoding.py", line 41, in smart_text
return force_text(s, encoding, strings_only, errors)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/utils/encoding.py", line 76, in force_text
s = six.text_type(s)
BytesWarning: str() on a bytes instance
2016-10-03 17:47:29,687 ERROR production.py:138 GET /login ->
BytesWarning('str() on a bytes instance',)
Traceback (most recent call last):
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args,
**callback_kwargs)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/utils/decorators.py", line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/gjc/projects/molly/mollybet/apps/home/views.py", line 124,
in login
new_molly_url=settings.NEW_MOLLY_URL)
File "/home/gjc/projects/molly/mollybet/webutils.py", line 167, in
render
t = loader.get_template((name + '.html').encode("ascii"))
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/template/loader.py", line 25, in get_template
raise TemplateDoesNotExist(template_name, chain=chain)
django.template.exceptions.TemplateDoesNotExist: <unprintable
TemplateDoesNotExist object>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "/home/gjc/projects/molly/mollybet/apps/home/geoipblocking.py",
line 17, in middleware
return get_response(request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 41, in inner
response = response_for_exception(request, exc)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 86, in
response_for_exception
response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 128, in
handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/views/debug.py", line 84, in technical_500_response
html = reporter.get_traceback_html()
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/views/debug.py", line 316, in get_traceback_html
c = Context(self.get_traceback_data(), use_l10n=False)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/views/debug.py", line 308, in get_traceback_data
c['exception_value'] = smart_text(self.exc_value, errors='replace')
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/utils/encoding.py", line 41, in smart_text
return force_text(s, encoding, strings_only, errors)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/utils/encoding.py", line 76, in force_text
s = six.text_type(s)
BytesWarning: str() on a bytes instance

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "/home/gjc/projects/molly/mollybet/apps/home/auth.py", line 113, in
middleware
return get_response(request)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 41, in inner
response = response_for_exception(request, exc)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 86, in
response_for_exception
response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/core/handlers/exception.py", line 128, in
handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/views/debug.py", line 84, in technical_500_response
html = reporter.get_traceback_html()
File "/home/gjc/projects/molly/env/lib/python3.4/site-
packages/django/views/debug.py", line 317, in get_traceback_html
return t.render(c)
[...]
}}}

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

Django

unread,
Oct 3, 2016, 3:30:07 PM10/3/16
to django-...@googlegroups.com
#27308: BytesWarning exception raised when running with python 3 -bb option
-------------------------------------+-------------------------------------
Reporter: Gustavo J. A. M. | Owner: nobody
Carneiro |

Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

I'm not familiar with the `-bb` flag. Can a bug happen as a result of this
warning?

Should we be trying to get Django's test suite to pass with it enabled?
Currently there are 2 failures and 14 errors with a few exceptions coming
from `PIL` rather than Django itself.

--
Ticket URL: <https://code.djangoproject.com/ticket/27308#comment:1>

Django

unread,
Oct 3, 2016, 6:29:19 PM10/3/16
to django-...@googlegroups.com
#27308: BytesWarning exception raised when running with python 3 -bb option
-------------------------------------+-------------------------------------
Reporter: Gustavo J. A. M. | Owner: nobody
Carneiro |

Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Gustavo J. A. M. Carneiro):

{{{
-b Issue warnings about str(bytes_instance),
str(bytear‐
ray_instance) and comparing bytes/bytearray with str.
(-bb:
issue errors)
}}}
The main point is to catch bugs due to mixing bytes vs str. Also, how
many times have you done in Python 3 this type of bug:
{{{
>>> def create_key(param1):
... return "foo:bar:" + str(param1)
...
>>> create_redis_key("zbr")
'foo:bar:zbr'
}}}
But if param1 comes from e.g. a network socket and you forget to decode
the bytes:
{{{
>>> create_key(b"zbr")
"foo:bar:b'zbr'"
}}}
So I like running my app with -bb (just one -b just gives a warning, but
warnings often pass silently). So it is useful if Django works with -bb.
I am certainly running a production Django app with -bb, for a few weeks,
and this is the first problem that I see caused by it.

--
Ticket URL: <https://code.djangoproject.com/ticket/27308#comment:2>

Django

unread,
Oct 4, 2016, 1:00:50 PM10/4/16
to django-...@googlegroups.com
#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
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* type: Uncategorized => Cleanup/optimization
* component: Uncategorized => Core (Other)
* stage: Unreviewed => Accepted


Comment:

The goal of this ticket could be to get Django's test suite passing with
`-bb`, but I'm not sure if it's feasible due to errors coming from
dependencies like Pillow.

--
Ticket URL: <https://code.djangoproject.com/ticket/27308#comment:3>

Django

unread,
Oct 5, 2016, 11:40:55 AM10/5/16
to django-...@googlegroups.com
#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

unread,
Feb 17, 2017, 5:03:01 PM2/17/17
to django-...@googlegroups.com
#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: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/8077 PR] to fix `BytesWarnings`
identified by Django's test suite.

--
Ticket URL: <https://code.djangoproject.com/ticket/27308#comment:5>

Django

unread,
Feb 18, 2017, 4:50:53 AM2/18/17
to django-...@googlegroups.com
#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: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* version: 1.10 => master
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/27308#comment:6>

Django

unread,
Feb 18, 2017, 6:42:26 AM2/18/17
to django-...@googlegroups.com
#27308: BytesWarning exception raised when running with python 3 -bb option
-------------------------------------+-------------------------------------
Reporter: Gustavo J. A. M. | Owner: nobody
Carneiro |
Type: | Status: closed

Cleanup/optimization |
Component: Core (Other) | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"75f0070a54925bc8d10b1f5a2b6a50fe3a1f7f50" 75f0070a]:
{{{
#!CommitTicketReference repository=""
revision="75f0070a54925bc8d10b1f5a2b6a50fe3a1f7f50"
Fixed #27308 -- Fixed BytesWarnings in the test suite.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27308#comment:7>

Django

unread,
Jun 3, 2017, 9:07:22 PM6/3/17
to django-...@googlegroups.com
#27308: BytesWarning exception raised when running with python 3 -bb option
-------------------------------------+-------------------------------------
Reporter: Gustavo J. A. M. | Owner: nobody
Carneiro |
Type: | Status: closed
Cleanup/optimization |
Component: Core (Other) | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"0a66aa158a47564fa11ff7aa99ffd3d7d73890ed" 0a66aa15]:
{{{
#!CommitTicketReference repository=""
revision="0a66aa158a47564fa11ff7aa99ffd3d7d73890ed"
Refs #27308, #27753 -- Removed obsolete cookie test mixing bytes with str.

Python 3's SimpleCookie treats all values as strings. Passing a bytes
object coerces to the repr value.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27308#comment:8>

Reply all
Reply to author
Forward
0 new messages