Skip to content

Commit

Permalink
Document that "coding: utf-8" is supported in requirements.txt
Browse files Browse the repository at this point in the history
Fixes #7182
  • Loading branch information
ananyo2012 committed Oct 14, 2019
1 parent a0b75cc commit d4cc484
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/html/reference/pip_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ and the newline following it is effectively ignored.

Comments are stripped *before* line continuations are processed.

To interpret the requirements file in UTF-8 format add a comment ``# -*- coding: utf-8 -*-`` to the first or second line of the file.

The following options are supported:

* :ref:`-i, --index-url <--index-url>`
Expand Down
1 change: 1 addition & 0 deletions news/7182.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Document that "coding: utf-8" is supported in requirements.txt
4 changes: 3 additions & 1 deletion src/pip/_internal/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
def get_file_content(url, comes_from=None, session=None):
# type: (str, Optional[str], Optional[PipSession]) -> Tuple[str, Text]
"""Gets the content of a file; it may be a filename, file: URL, or
http: URL. Returns (location, content). Content is unicode.
http: URL. Returns (location, content). Default encoding of content is
unicode. To use utf-8 encoding use encoding declaration in first or
second line of requirements file
:param url: File path or url.
:param comes_from: Origin description of requirements.
Expand Down

0 comments on commit d4cc484

Please sign in to comment.