Skip to content

Commit 5c49381

Browse files
fixup! Reorder requirements file decoding
1 parent 60c6bb9 commit 5c49381

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

docs/html/reference/requirements-file-format.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,14 @@ examples of all these forms, see {ref}`pip install Examples`.
5656

5757
### Encoding
5858

59-
It is simplest to encode your requirements files with UTF-8.
60-
The process for decoding requirements files is:
61-
62-
- Check for any Byte Order Mark at the start of the file and if found use
63-
the corresponding encoding to decode the file.
64-
- Check for any {pep}`263` style comment (e.g. `# -*- coding: <encoding name> -*-`)
65-
and if found decode with the given encoding.
66-
- Try and decode with UTF-8, and if that fails,
67-
- fallback to trying to decode using the locale defined encoding.
59+
The default encoding for requirement files is `UTF-8` unless a different
60+
encoding is specified using a {pep}`263` style comment (e.g. `# -*- coding:
61+
<encoding name> -*-`).
62+
63+
```{warning}
64+
pip will fallback to the locale defined encoding if `UTF-8` decoding fails. This is a quirk
65+
of pip's parser. This behaviour is *deprecated* and should not be relied upon.
66+
```
6867

6968
### Line continuations
7069

0 commit comments

Comments
 (0)