diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..9c9d2993c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Patches must have Unix-style line endings, even on Windows +tasks/vendoring/patches/* eol=lf diff --git a/tasks/vendoring/__init__.py b/tasks/vendoring/__init__.py index 36bbdec68..9e0e4d494 100644 --- a/tasks/vendoring/__init__.py +++ b/tasks/vendoring/__init__.py @@ -73,7 +73,7 @@ def rewrite_imports(package_dir, vendored_libs): def rewrite_file_imports(item, vendored_libs): """Rewrite 'import xxx' and 'from xxx import' for vendored_libs""" - text = item.read_text() + text = item.read_text(encoding='utf-8') # Revendor pkg_resources.extern first text = re.sub(r'pkg_resources.extern', r'pip._vendor', text) for lib in vendored_libs: @@ -87,7 +87,7 @@ def rewrite_file_imports(item, vendored_libs): r'\1from pip._vendor.%s' % lib, text, ) - item.write_text(text) + item.write_text(text, encoding='utf-8') def apply_patch(ctx, patch_file_path):