瀏覽代碼

Fixed #26831 -- Documented session data must be JSON encodable for JSONSerializer.

Md. Sadaf Noor 8 年之前
父節點
當前提交
1f82b857ce
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      docs/topics/http/sessions.txt

+ 3 - 0
docs/topics/http/sessions.txt

@@ -348,6 +348,9 @@ Bundled serializers
         >>> request.session['0']
         'bar'
 
+    Similarly, data that can't be encoded in JSON, such as non-UTF8 bytes like
+    ``'\xd9'`` (which raises :exc:`UnicodeDecodeError`), can't be stored.
+
     See the :ref:`custom-serializers` section for more details on limitations
     of JSON serialization.