This file is indexed.

/usr/share/doc/python-werkzeug-doc/html/_sources/python3.txt is in python-werkzeug-doc 0.10.4+dfsg1-1ubuntu1.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.. _python3:

==============
Python 3 Notes
==============

This part of the documentation outlines special information required to
use Werkzeug and WSGI on Python 3.

.. warning::

   Python 3 support in Werkzeug is currently highly experimental.  Please
   give feedback on it and help us improve it.


WSGI Environment
================

The WSGI environment on Python 3 works slightly different than it does on
Python 2.  For the most part Werkzeug hides the differences from you if
you work on the higher level APIs.  The main difference between Python 2
and Python 3 is that on Python 2 the WSGI environment contains bytes
whereas the environment on Python 3 contains a range of differently
encoded strings.

There are two different kinds of strings in the WSGI environ on Python 3:

-   unicode strings restricted to latin1 values.  These are the used for
    HTTP headers and a few other things.
-   unicode strings carrying binary payload, roundtripped through latin1
    values.  This is usually referred as “WSGI encoding dance” throughout
    Werkzeug.

Werkzeug provides you with functionality to deal with these automatically
so that you don't need to be aware of the inner workings.  The following
functions and classes should be used to read information out of the
WSGI environment:

-   :func:`~werkzeug.wsgi.get_current_url`
-   :func:`~werkzeug.wsgi.get_host`
-   :func:`~werkzeug.wsgi.get_script_name`
-   :func:`~werkzeug.wsgi.get_path_info`
-   :func:`~werkzeug.wsgi.get_query_string`
-   :func:`~werkzeug.datastructures.EnvironHeaders`

Applications are strongly discouraged to create and modify a WSGI
environment themselves on Python 3 unless they take care of the proper
decoding step.  All high level interfaces in Werkzeug will apply the
correct encoding and decoding steps as necessary.

URLs
====

URLs in Werkzeug attempt to represent themselves as unicode strings on
Python 3.  All the parsing functions generally also provide functionality
that allow operations on bytes.  In some cases functions that deal with
URLs allow passing in `None` as charset to change the return value to byte
objects.  Internally Werkzeug will now unify URIs and IRIs as much as
possible.

Request Cleanup
===============

Request objects on Python 3 and PyPy require explicit closing when file
uploads are involved.  This is required to properly close temporary file
objects created by the multipart parser.  For that purpose the ``close()``
method was introduced.

In addition to that request objects now also act as context managers that
automatically close.