TypeError: decoding str is not supported

Issue #41 resolved
Jason Chen created an issue

{{{

!python

====================================================================== FAIL: Doctest: modeltests.many_to_one.models.test.API_TESTS


Traceback (most recent call last): File "/usr/local/lib/python3.1/dist-packages/django/test/_doctest.py", line 2222, in runTest raise self.failureException(self.format_failure(new.getvalue())) AssertionError: Failed doctest test for modeltests.many_to_one.models.test.API_TESTS File "/home/jason/Desktop/workspace/django-3k/build/tests/modeltests/many_to_one/models.py", line unknown line number, in API_TESTS


File "/home/jason/Desktop/workspace/django-3k/build/tests/modeltests/many_to_one/models.py", line ?, in modeltests.many_to_one.models.test.API_TESTS Failed example: Article.objects.select_related().dates('pub_date', 'day') Exception raised: Traceback (most recent call last): File "/usr/local/lib/python3.1/dist-packages/django/test/_doctest.py", line 1307, in run compileflags, 1), test.globs) File "<doctest modeltests.many_to_one.models.test.API_TESTS[100]>", line 1, in <module> Article.objects.select_related().dates('pub_date', 'day') File "/usr/local/lib/python3.1/dist-packages/django/test/_doctest.py", line 1278, in py3_displayhook if not value: File "/usr/local/lib/python3.1/dist-packages/django/db/models/query.py", line 110, in bool__ next(iter(self)) File "/usr/local/lib/python3.1/dist-packages/django/db/models/query.py", line 104, in _result_iter self._fill_cache() File "/usr/local/lib/python3.1/dist-packages/django/db/models/query.py", line 755, in _fill_cache self._result_cache.append(next(self._iter)) File "/usr/local/lib/python3.1/dist-packages/django/db/models/sql/compiler.py", line 960, in results_iter date = typecast_timestamp(str(date)) File "/usr/local/lib/python3.1/dist-packages/django/db/backends/util.py", line 73, in typecast_timestamp if not ' ' in s: return typecast_date(s) File "/usr/local/lib/python3.1/dist-packages/django/db/backends/util.py", line 55, in typecast_date s = str(s, encoding='utf8') TypeError: decoding str is not supported


File "/home/jason/Desktop/workspace/django-3k/build/tests/modeltests/many_to_one/models.py", line ?, in modeltests.many_to_one.models.test.API_TESTS Failed example: Article.objects.select_related().dates('pub_date', 'month') Exception raised: Traceback (most recent call last): File "/usr/local/lib/python3.1/dist-packages/django/test/_doctest.py", line 1307, in run compileflags, 1), test.globs) File "<doctest modeltests.many_to_one.models.test.API_TESTS[101]>", line 1, in <module> Article.objects.select_related().dates('pub_date', 'month') File "/usr/local/lib/python3.1/dist-packages/django/test/_doctest.py", line 1278, in py3_displayhook if not value: File "/usr/local/lib/python3.1/dist-packages/django/db/models/query.py", line 110, in bool__ next(iter(self)) File "/usr/local/lib/python3.1/dist-packages/django/db/models/query.py", line 104, in _result_iter self._fill_cache() File "/usr/local/lib/python3.1/dist-packages/django/db/models/query.py", line 755, in _fill_cache self._result_cache.append(next(self._iter)) File "/usr/local/lib/python3.1/dist-packages/django/db/models/sql/compiler.py", line 960, in results_iter date = typecast_timestamp(str(date)) File "/usr/local/lib/python3.1/dist-packages/django/db/backends/util.py", line 73, in typecast_timestamp if not ' ' in s: return typecast_date(s) File "/usr/local/lib/python3.1/dist-packages/django/db/backends/util.py", line 55, in typecast_date s = str(s, encoding='utf8') TypeError: decoding str is not supported


File "/home/jason/Desktop/workspace/django-3k/build/tests/modeltests/many_to_one/models.py", line ?, in modeltests.many_to_one.models.test.API_TESTS Failed example: Article.objects.select_related().dates('pub_date', 'year') Exception raised: Traceback (most recent call last): File "/usr/local/lib/python3.1/dist-packages/django/test/_doctest.py", line 1307, in run compileflags, 1), test.globs) File "<doctest modeltests.many_to_one.models.test.API_TESTS[102]>", line 1, in <module> Article.objects.select_related().dates('pub_date', 'year') File "/usr/local/lib/python3.1/dist-packages/django/test/_doctest.py", line 1278, in py3_displayhook if not value: File "/usr/local/lib/python3.1/dist-packages/django/db/models/query.py", line 110, in bool__ next(iter(self)) File "/usr/local/lib/python3.1/dist-packages/django/db/models/query.py", line 104, in _result_iter self._fill_cache() File "/usr/local/lib/python3.1/dist-packages/django/db/models/query.py", line 755, in _fill_cache self._result_cache.append(next(self._iter)) File "/usr/local/lib/python3.1/dist-packages/django/db/models/sql/compiler.py", line 960, in results_iter date = typecast_timestamp(str(date)) File "/usr/local/lib/python3.1/dist-packages/django/db/backends/util.py", line 73, in typecast_timestamp if not ' ' in s: return typecast_date(s) File "/usr/local/lib/python3.1/dist-packages/django/db/backends/util.py", line 55, in typecast_date s = str(s, encoding='utf8') TypeError: decoding str is not supported

}}}

A bug introduced by Andrew's ticket #39 fix, it didn't have this error before.

Comments (4)

  1. Nate Margono

    this issue should be closed because it shouldn't appear anymore after my fix to #44. try running it under the new build.

  2. Log in to comment