Skip to content

Commit

Permalink
Merge pull request pypa#5092 from pfmoore/vendor_fixes
Browse files Browse the repository at this point in the history
Fixes to vendoring scripts so they work on Windows
  • Loading branch information
pfmoore authored Mar 20, 2018
2 parents 86da211 + 359bd4f commit 8dbdb74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Patches must have Unix-style line endings, even on Windows
tasks/vendoring/patches/* eol=lf
4 changes: 2 additions & 2 deletions tasks/vendoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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):
Expand Down

0 comments on commit 8dbdb74

Please sign in to comment.